Source: python-setuptools
Version: 18.4-2
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: timestamps toolchain
X-Debbugs-Cc: [email protected]
Hi,
Whilst working on the "reproducible builds" effort [0], we noticed that
python-setuptools generates non-deterministic output when creating
requires.txt files:
│ │ │ │ [all]
│ │ │ │ -fake-factory==0.5.2
│ │ │ │ -pytz
│ │ │ │ numpy>=1.9.0
│ │ │ │ pytz
│ │ │ │ +pytz
│ │ │ │ django>=1.7
│ │ │ │ +fake-factory==0.5.2
Patch attached.
[0] https://wiki.debian.org/ReproducibleBuilds
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` [email protected] / chris-lamb.co.uk
`-
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index 50f3d5c..7c8ea53 100755
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -406,7 +406,7 @@ def warn_depends_obsolete(cmd, basename, filename):
def _write_requirements(stream, reqs):
lines = yield_lines(reqs or ())
append_cr = lambda line: line + '\n'
- lines = map(append_cr, lines)
+ lines = map(append_cr, sorted(lines))
stream.writelines(lines)