ref: 2e4023135370fc0f5ece3a34b14f79e882c2b47d
parent: 382026429a407b2865b616d6c44ade5af5e82836
author: Paul Brossier <piem@piem.org>
date: Mon Nov 28 10:48:34 EST 2016
setup.py, python/lib/: use sorted glob.glob to improve reproducibility
--- a/python/lib/gen_external.py
+++ b/python/lib/gen_external.py
@@ -174,7 +174,7 @@
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)
--- a/python/lib/moresetuptools.py
+++ b/python/lib/moresetuptools.py
@@ -58,8 +58,8 @@
# 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',
--- a/setup.py
+++ b/setup.py
@@ -37,7 +37,7 @@
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,