From 274c3cbad5dc7ab5366296839fac75e8e47e2082e6dc28e06bf31320caa22965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 16 Oct 2019 12:00:39 +0000 Subject: [PATCH] - Add patch to sort outputs for better reproducability: * sort-for-reproducibility.patch - Add missing dep on ordered-set as it is now in the vendored dir too OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=181 --- python-setuptools.changes | 8 +++++++ python-setuptools.spec | 5 ++++- sort-for-reproducibility.patch | 39 ++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 sort-for-reproducibility.patch diff --git a/python-setuptools.changes b/python-setuptools.changes index f372414..d8ff5d8 100644 --- a/python-setuptools.changes +++ b/python-setuptools.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Oct 16 11:55:57 UTC 2019 - Tomáš Chvátal + +- Add patch to sort outputs for better reproducability: + * sort-for-reproducibility.patch +- Add missing dep on ordered-set as it is now in the vendored + dir too + ------------------------------------------------------------------- Fri Oct 11 09:29:35 UTC 2019 - Marketa Calabkova diff --git a/python-setuptools.spec b/python-setuptools.spec index de82424..27cbb11 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -31,12 +31,13 @@ Version: 41.4.0 Release: 0 Summary: Enhancements to distutils for building and distributing Python packages License: Python-2.0 OR ZPL-2.0 -Group: Development/Languages/Python URL: https://github.com/pypa/setuptools Source: https://files.pythonhosted.org/packages/source/s/setuptools/setuptools-%{version}.zip Source1: psfl.txt Source2: zpl.txt +Patch0: sort-for-reproducibility.patch BuildRequires: %{python_module appdirs} +BuildRequires: %{python_module ordered-set} BuildRequires: %{python_module packaging} BuildRequires: %{python_module six} BuildRequires: %{python_module xml} @@ -46,6 +47,7 @@ BuildRequires: unzip # needed for SLE Requires: python Requires: python-appdirs +Requires: python-ordered-set Requires: python-packaging Requires: python-six Requires: python-xml @@ -85,6 +87,7 @@ especially ones that have dependencies on other packages. %prep %setup -q -n setuptools-%{version} +%patch0 -p1 find . -type f -name "*.orig" -delete # fix rpmlint spurious-executable-perm diff --git a/sort-for-reproducibility.patch b/sort-for-reproducibility.patch new file mode 100644 index 0000000..131279c --- /dev/null +++ b/sort-for-reproducibility.patch @@ -0,0 +1,39 @@ +Index: setuptools-41.4.0/setuptools/command/easy_install.py +=================================================================== +--- setuptools-41.4.0.orig/setuptools/command/easy_install.py ++++ setuptools-41.4.0/setuptools/command/easy_install.py +@@ -417,7 +417,7 @@ class easy_install(Command): + for spec in self.args: + self.easy_install(spec, not self.no_deps) + if self.record: +- outputs = self.outputs ++ outputs = list(sorted(self.outputs)) + if self.root: # strip any package prefix + root_len = len(self.root) + for counter in range(len(outputs)): +Index: setuptools-41.4.0/setuptools/command/egg_info.py +=================================================================== +--- setuptools-41.4.0.orig/setuptools/command/egg_info.py ++++ setuptools-41.4.0/setuptools/command/egg_info.py +@@ -638,7 +638,7 @@ def warn_depends_obsolete(cmd, basename, + 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) + + +Index: setuptools-41.4.0/setuptools/dist.py +=================================================================== +--- setuptools-41.4.0.orig/setuptools/dist.py ++++ setuptools-41.4.0/setuptools/dist.py +@@ -195,7 +195,7 @@ def write_pkg_file(self, file): + self.long_description_content_type + ) + if self.provides_extras: +- for extra in self.provides_extras: ++ for extra in sorted(self.provides_extras): + write_field('Provides-Extra', extra) + +