From: Paul Brossier Date: Mon, 28 Nov 2016 14:48:34 +0000 (+0100) Subject: setup.py, python/lib/: use sorted glob.glob to improve reproducibility X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=ac971a5160381f226f38f70d8f49eefb54aec2e8;p=aubio.git setup.py, python/lib/: use sorted glob.glob to improve reproducibility --- diff --git a/python/lib/gen_external.py b/python/lib/gen_external.py index 7a8e7fe8..b642383b 100644 --- a/python/lib/gen_external.py +++ b/python/lib/gen_external.py @@ -175,7 +175,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 7ded26bf..fe853aa6 100644 --- a/python/lib/moresetuptools.py +++ b/python/lib/moresetuptools.py @@ -58,8 +58,8 @@ def add_local_aubio_sources(ext): # 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 7fc102cf..f3afd4b3 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,