From 2e4023135370fc0f5ece3a34b14f79e882c2b47d Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Mon, 28 Nov 2016 15:48:34 +0100 Subject: [PATCH] setup.py, python/lib/: use sorted glob.glob to improve reproducibility --- python/lib/gen_external.py | 2 +- python/lib/moresetuptools.py | 4 ++-- setup.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/lib/gen_external.py b/python/lib/gen_external.py index 533116eb..c6a13d4f 100644 --- a/python/lib/gen_external.py +++ b/python/lib/gen_external.py @@ -174,7 +174,7 @@ def print_cpp_output_results(lib, cpp_output): def generate_external(header=header, output_path=output_path, usedouble=False, overwrite=True): if not os.path.isdir(output_path): os.mkdir(output_path) - elif not overwrite: return glob.glob(os.path.join(output_path, '*.c')) + elif not overwrite: return sorted(glob.glob(os.path.join(output_path, '*.c'))) cpp_output, cpp_objects = get_cpp_objects(header) diff --git a/python/lib/moresetuptools.py b/python/lib/moresetuptools.py index 8eb61139..08f45920 100644 --- a/python/lib/moresetuptools.py +++ b/python/lib/moresetuptools.py @@ -58,8 +58,8 @@ def add_local_aubio_sources(ext, usedouble = False): # create an empty header, macros will be passed on the command line fake_config_header = os.path.join('python', 'ext', 'config.h') distutils.file_util.write_file(fake_config_header, "") - aubio_sources = glob.glob(os.path.join('src', '**.c')) - aubio_sources += glob.glob(os.path.join('src', '*', '**.c')) + aubio_sources = sorted(glob.glob(os.path.join('src', '**.c'))) + aubio_sources += sorted(glob.glob(os.path.join('src', '*', '**.c'))) ext.sources += aubio_sources # define macros (waf puts them in build/src/config.h) for define_macro in ['HAVE_STDLIB_H', 'HAVE_STDIO_H', diff --git a/setup.py b/setup.py index f79e59a1..277669cd 100755 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ except ImportError: if sys.platform.startswith('darwin'): extra_link_args += ['-framework','CoreFoundation', '-framework','AudioToolbox'] -sources = glob.glob(os.path.join('python', 'ext', '*.c')) +sources = sorted(glob.glob(os.path.join('python', 'ext', '*.c'))) aubio_extension = Extension("aubio._aubio", sources, -- 2.11.0