diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2016-04-20 09:25:21 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2016-04-20 09:25:21 -0400 |
commit | 085247fa441f9b0fac05117ca1a3283e3510fb32 (patch) | |
tree | b068b08a093257c4b60b86f6fbf1e164f8e3125a /setuptools/command/egg_info.py | |
parent | df05ebf3e88858ae7ac74071bd20c86782e1415d (diff) | |
download | external_python_setuptools-085247fa441f9b0fac05117ca1a3283e3510fb32.tar.gz external_python_setuptools-085247fa441f9b0fac05117ca1a3283e3510fb32.tar.bz2 external_python_setuptools-085247fa441f9b0fac05117ca1a3283e3510fb32.zip |
Use OrderedDict to retain deterministic ordering of version info in egg_info command. Remove lexicographic ordering in setopt.edit_config. Ref #553
Diffstat (limited to 'setuptools/command/egg_info.py')
-rwxr-xr-x | setuptools/command/egg_info.py | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index d1bd9b04..3c033300 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -13,6 +13,7 @@ import sys import io import warnings import time +import collections from setuptools.extern import six from setuptools.extern.six.moves import map @@ -66,14 +67,20 @@ class egg_info(Command): self.vtags = None def save_version_info(self, filename): - values = dict( - egg_info=dict( - tag_svn_revision=0, - tag_date=0, - tag_build=self.tags(), - ) - ) - edit_config(filename, values) + """ + Materialize the values of svn_revision and date into the + build tag. Install these keys in a deterministic order + to avoid arbitrary reordering on subsequent builds. + """ + # python 2.6 compatibility + odict = getattr(collections, 'OrderedDict', dict) + egg_info = odict() + # follow the order these keys would have been added + # when PYTHONHASHSEED=0 + egg_info['tag_date'] = 0 + egg_info['tag_svn_revision'] = 0 + egg_info['tag_build'] = self.tags() + edit_config(filename, dict(egg_info=egg_info)) def finalize_options(self): self.egg_name = safe_name(self.distribution.get_name()) |