From 1ede3fffefc2997941b4bf79c4ef97276cc380a840cf8d2f79eca384b417f63f Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 18 Jun 2021 19:35:18 +0000 Subject: [PATCH 1/3] Accepting request 900809 from home:bnavigator:branches:devel:languages:python - Add python dist provides for setuptools, pkg_resources and easy_install: work around boo#1186870 - Dont create a package for -test flavor OBS-URL: https://build.opensuse.org/request/show/900809 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=215 --- python-setuptools.changes | 7 +++++++ python-setuptools.spec | 21 ++++++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/python-setuptools.changes b/python-setuptools.changes index 77d1033..94b941f 100644 --- a/python-setuptools.changes +++ b/python-setuptools.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jun 17 17:03:46 UTC 2021 - Ben Greiner + +- Add python dist provides for setuptools, pkg_resources and + easy_install: work around boo#1186870 +- Dont create a package for -test flavor + ------------------------------------------------------------------- Fri Jan 22 19:05:02 UTC 2021 - Matej Cepl diff --git a/python-setuptools.spec b/python-setuptools.spec index 65e8ba4..c1f11e5 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -1,5 +1,5 @@ # -# spec file for package python-setuptools +# spec file # # Copyright (c) 2021 SUSE LLC # @@ -34,6 +34,8 @@ %endif %endif %bcond_without python2 +# in order to avoid rewriting for subpackage generator +%define mypython python Name: python-setuptools%{psuffix} Version: 44.1.1 Release: 0 @@ -63,7 +65,7 @@ Requires: python-packaging Requires: python-six Requires: python-xml Requires(post): update-alternatives -Requires(postun): update-alternatives +Requires(postun):update-alternatives BuildArch: noarch # The dependency download feature may require SSL, which is in python3-base and python(2) %ifpython2 @@ -92,6 +94,17 @@ Obsoletes: %{oldpython}-distribute < %{version} %if %{with wheel} BuildRequires: %{python_module wheel} %endif +%if !%{with test} && !%{with wheel} +# work around boo#1186870 +Provides: %{mypython}%{python_version}dist(setuptools) = %{version} +Provides: %{mypython}%{python_version}dist(easy_install) = %{version} +Provides: %{mypython}%{python_version}dist(pkg_resources) = %{version} +%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3" +Provides: %{mypython}3dist(easy_install) = %{version} +Provides: %{mypython}3dist(pkg_resources) = %{version} +Provides: %{mypython}3dist(setuptools) = %{version} +%endif +%endif %python_subpackages %description @@ -172,8 +185,9 @@ export PYTHONPATH=$(pwd) %python_uninstall_alternative easy_install %endif +%if !%{with test} %files %{python_files} -%if !%{with test} && !%{with wheel} +%if !%{with wheel} %license LICENSE %doc CHANGES.rst README.rst %python_alternative %{_bindir}/easy_install @@ -189,5 +203,6 @@ export PYTHONPATH=$(pwd) %dir %{python_sitelib}/../wheels %{python_sitelib}/../wheels/* %endif +%endif %changelog From 9195e8307bde270d9bd91205d41d23f4aa1eb217f9102033107e18b35b3a7145 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sat, 26 Jun 2021 08:43:14 +0000 Subject: [PATCH 2/3] Accepting request 902450 from home:bnavigator:branches:devel:languages:python - Update to 57.0.0 * big changelog since 44.1, see CHANGES.rst. - No python2 support anymore. - Refresh sort-for-reproducibility.patch and remove_mock.patch. - Drop importlib.patch, fixed upstream. - Remove testdata.tar.gz, packaged upstream. - Update requirements. * New Ring-1 dep: python-jaraco.path <-- python-singledispatch OBS-URL: https://build.opensuse.org/request/show/902450 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=216 --- importlib.patch | 39 ------------ python-setuptools.changes | 12 ++++ python-setuptools.spec | 89 +++++++++----------------- remove_mock.patch | 111 ++++++++++++++++++++------------- setuptools-44.1.1.zip | 3 - setuptools-57.0.0.tar.gz | 3 + sort-for-reproducibility.patch | 40 +++++++----- testdata.tar.gz | 3 - 8 files changed, 136 insertions(+), 164 deletions(-) delete mode 100644 importlib.patch delete mode 100644 setuptools-44.1.1.zip create mode 100644 setuptools-57.0.0.tar.gz delete mode 100644 testdata.tar.gz diff --git a/importlib.patch b/importlib.patch deleted file mode 100644 index 00455bb..0000000 --- a/importlib.patch +++ /dev/null @@ -1,39 +0,0 @@ -Index: setuptools-41.6.0/setuptools/_imp.py -=================================================================== ---- setuptools-41.6.0.orig/setuptools/_imp.py -+++ setuptools-41.6.0/setuptools/_imp.py -@@ -19,7 +19,10 @@ PY_FROZEN = 7 - - def find_module(module, paths=None): - """Just like 'imp.find_module()', but with package support""" -- spec = importlib.util.find_spec(module, paths) -+ if isinstance(paths, list): -+ spec = importlib.machinery.PathFinder.find_spec(module, paths) -+ else: -+ spec = importlib.util.find_spec(module, paths) - if spec is None: - raise ImportError("Can't find %s" % module) - if not spec.has_location and hasattr(spec, 'submodule_search_locations'): -@@ -60,14 +63,20 @@ def find_module(module, paths=None): - - - def get_frozen_object(module, paths=None): -- spec = importlib.util.find_spec(module, paths) -+ if isinstance(paths, list): -+ spec = importlib.machinery.PathFinder.find_spec(module, paths) -+ else: -+ spec = importlib.util.find_spec(module, paths) - if not spec: - raise ImportError("Can't find %s" % module) - return spec.loader.get_code(module) - - - def get_module(module, paths, info): -- spec = importlib.util.find_spec(module, paths) -+ if isinstance(paths, list): -+ spec = importlib.machinery.PathFinder.find_spec(module, paths) -+ else: -+ spec = importlib.util.find_spec(module, paths) - if not spec: - raise ImportError("Can't find %s" % module) - return module_from_spec(spec) diff --git a/python-setuptools.changes b/python-setuptools.changes index 94b941f..db3ff3b 100644 --- a/python-setuptools.changes +++ b/python-setuptools.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri Jun 25 12:46:26 UTC 2021 - Ben Greiner + +- Update to 57.0.0 + * big changelog since 44.1, see CHANGES.rst. +- No python2 support anymore. +- Refresh sort-for-reproducibility.patch and remove_mock.patch. +- Drop importlib.patch, fixed upstream. +- Remove testdata.tar.gz, packaged upstream. +- Update requirements. + * New Ring-1 dep: python-jaraco.path <-- python-singledispatch + ------------------------------------------------------------------- Thu Jun 17 17:03:46 UTC 2021 - Ben Greiner diff --git a/python-setuptools.spec b/python-setuptools.spec index c1f11e5..bd2f2f1 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -16,8 +16,8 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} -%define oldpython python +%{?!python_module:%define python_module() python3-%{**}} +%define skip_python2 1 %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" %define psuffix -test @@ -33,74 +33,63 @@ %bcond_with wheel %endif %endif -%bcond_without python2 # in order to avoid rewriting for subpackage generator %define mypython python Name: python-setuptools%{psuffix} -Version: 44.1.1 +Version: 57.0.0 Release: 0 -Summary: Enhancements to distutils for building and distributing Python packages +Summary: Download, build, install, upgrade, and uninstall Python packages License: MIT URL: https://github.com/pypa/setuptools -Source: https://files.pythonhosted.org/packages/source/s/setuptools/setuptools-%{version}.zip -Source3: testdata.tar.gz +Source: https://files.pythonhosted.org/packages/source/s/setuptools/setuptools-%{version}.tar.gz Patch0: sort-for-reproducibility.patch -Patch1: importlib.patch -# PATCH-FIX-UPSTREAM remove_mock.patch bsc#[0-9]+ mcepl@suse.com -# we don't need stinking mock -Patch2: remove_mock.patch -BuildRequires: %{python_module appdirs} -BuildRequires: %{python_module ordered-set} -BuildRequires: %{python_module packaging} -BuildRequires: %{python_module pyparsing >= 2.0.2} -BuildRequires: %{python_module six} +# PATCH-FIX-OPENSUSE remove_mock.patch mcepl@suse.com +Patch1: remove_mock.patch +BuildRequires: %{python_module appdirs >= 1.4.3} +BuildRequires: %{python_module more-itertools >= 8.8.0} +BuildRequires: %{python_module ordered-set >= 3.1.1} +BuildRequires: %{python_module packaging >= 20.4} +BuildRequires: %{python_module pyparsing >= 2.2.1} BuildRequires: %{python_module xml} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: unzip -Requires: python-appdirs -Requires: python-base -Requires: python-ordered-set -Requires: python-packaging -Requires: python-six +Requires: python-appdirs >= 1.4.3 +Requires: python-base >= 3.6 +Requires: python-more-itertools >= 8.8.0 +Requires: python-ordered-set >= 3.1.1 +Requires: python-packaging >= 20.4 +Requires: python-pyparsing >= 2.2.1 Requires: python-xml Requires(post): update-alternatives Requires(postun):update-alternatives BuildArch: noarch -# The dependency download feature may require SSL, which is in python3-base and python(2) -%ifpython2 -Requires: python -%endif %if %{with test} BuildRequires: %{python_module Paver} +BuildRequires: %{python_module Sphinx} BuildRequires: %{python_module devel} +BuildRequires: %{python_module jaraco.envs} +BuildRequires: %{python_module jaraco.path >= 3.2.0} BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest-fixture-config} BuildRequires: %{python_module pytest-virtualenv} +BuildRequires: %{python_module pytest-xdist} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools >= %{version}} +BuildRequires: %{python_module virtualenv >= 13.0.0} BuildRequires: %{python_module wheel} -%if %{with python2} -BuildRequires: python-futures -%endif %endif %if 0%{?suse_version} || 0%{?fedora_version} >= 24 Recommends: ca-certificates-mozilla %endif -%ifpython2 -Provides: %{oldpython}-distribute = %{version} -Obsoletes: %{oldpython}-distribute < %{version} -%endif %if %{with wheel} BuildRequires: %{python_module wheel} %endif %if !%{with test} && !%{with wheel} # work around boo#1186870 Provides: %{mypython}%{python_version}dist(setuptools) = %{version} -Provides: %{mypython}%{python_version}dist(easy_install) = %{version} Provides: %{mypython}%{python_version}dist(pkg_resources) = %{version} %if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3" -Provides: %{mypython}3dist(easy_install) = %{version} Provides: %{mypython}3dist(pkg_resources) = %{version} Provides: %{mypython}3dist(setuptools) = %{version} %endif @@ -113,15 +102,7 @@ allow you to build and distribute Python packages, especially ones that have dependencies on other packages. %prep -%setup -q -n setuptools-%{version} - -tar -xzvf %{SOURCE3} -%autopatch -p1 - -find . -type f -name "*.orig" -delete - -# fix rpmlint spurious-executable-perm -chmod -x README.rst +%autosetup -p1 -n setuptools-%{version} # strip shebangs to fix rpmlint warnings # "explain the sed": @@ -129,7 +110,7 @@ chmod -x README.rst # s@...@...@ = same as s/.../.../ except with @ instead of / # ^ = start; #!/ = shebang leading characters; .* = rest of line; $ = end # replace with nothing -sed -r -i '1s@^#!/.*$@@' setuptools/command/easy_install.py +sed -r -i '1s@^#!/.*$@@' pkg_resources/_vendor/appdirs.py %if ! %{with wheel} # replace the bundled stuff @@ -158,8 +139,6 @@ find ./ -type f -name \*.py -exec sed -i \ %install %if !%{with test} && !%{with wheel} %python_install -%prepare_alternative easy_install - %python_expand %fdupes %{buildroot}%{$python_sitelib} %endif @@ -171,18 +150,13 @@ find ./ -type f -name \*.py -exec sed -i \ %if %{with test} # the 4 skipped test rely on the bundled packages but they are # not available on virtualenv; this is expected behaviour +donttest="test_clean_env_install or test_pip_upgrade_from_source or test_test_command_install_requirements or test_no_missing_dependencies" +# these 3 tests try to download the wheel wheel from PyPI +donttest="$donttest or (test_distutils_adoption and (distutils_stdlib or distutils_local))" export LANG=en_US.UTF-8 # tests need imports local source dir export PYTHONPATH=$(pwd) -%pytest -k 'not (test_clean_env_install or test_pip_upgrade_from_source or test_test_command_install_requirements or test_no_missing_dependencies)' -%endif - -%if !%{with test} && !%{with wheel} -%post -%python_install_alternative easy_install - -%postun -%python_uninstall_alternative easy_install +%pytest -rfE -n auto -k "not ($donttest)" %endif %if !%{with test} @@ -190,13 +164,12 @@ export PYTHONPATH=$(pwd) %if !%{with wheel} %license LICENSE %doc CHANGES.rst README.rst -%python_alternative %{_bindir}/easy_install %{python_sitelib}/setuptools %{python_sitelib}/setuptools-%{version}-py%{python_version}.egg-info -%{python_sitelib}/easy_install.py* -%pycache_only %{python_sitelib}/__pycache__/easy_install.* %dir %{python_sitelib}/pkg_resources %{python_sitelib}/pkg_resources/* +%{python_sitelib}/_distutils_hack +%{python_sitelib}/distutils-precedence.pth %endif %if %{with wheel} diff --git a/remove_mock.patch b/remove_mock.patch index 3d42ca6..76ea3d5 100644 --- a/remove_mock.patch +++ b/remove_mock.patch @@ -11,17 +11,21 @@ setuptools/tests/test_upload.py | 5 +---- 10 files changed, 13 insertions(+), 18 deletions(-) ---- a/pkg_resources/tests/test_markers.py -+++ b/pkg_resources/tests/test_markers.py +Index: setuptools-57.0.0/pkg_resources/tests/test_markers.py +=================================================================== +--- setuptools-57.0.0.orig/pkg_resources/tests/test_markers.py ++++ setuptools-57.0.0/pkg_resources/tests/test_markers.py @@ -1,4 +1,4 @@ -import mock +from . import mock from pkg_resources import evaluate_marker ---- a/pkg_resources/tests/test_pkg_resources.py -+++ b/pkg_resources/tests/test_pkg_resources.py -@@ -12,10 +12,7 @@ import stat +Index: setuptools-57.0.0/pkg_resources/tests/test_pkg_resources.py +=================================================================== +--- setuptools-57.0.0.orig/pkg_resources/tests/test_pkg_resources.py ++++ setuptools-57.0.0/pkg_resources/tests/test_pkg_resources.py +@@ -9,10 +9,7 @@ import stat import distutils.dist import distutils.command.install_egg_info @@ -31,23 +35,27 @@ - import mock +from . import mock - from pkg_resources import DistInfoDistribution, Distribution, EggInfoDistribution - from setuptools.extern import six ---- a/setuptools/tests/__init__.py -+++ b/setuptools/tests/__init__.py -@@ -4,6 +4,10 @@ import pytest + from pkg_resources import ( + DistInfoDistribution, Distribution, EggInfoDistribution, +Index: setuptools-57.0.0/setuptools/tests/__init__.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/tests/__init__.py ++++ setuptools-57.0.0/setuptools/tests/__init__.py +@@ -5,6 +5,10 @@ import pytest - from setuptools.extern.six import PY2, PY3 + __all__ = ['fail_on_ascii', 'ack_2to3'] +try: + import mock +except ImportError: + from unittest import mock - __all__ = [ - 'fail_on_ascii', 'py2_only', 'py3_only' ---- a/setuptools/tests/test_build_clib.py -+++ b/setuptools/tests/test_build_clib.py + is_ascii = locale.getpreferredencoding() == 'ANSI_X3.4-1968' + fail_on_ascii = pytest.mark.xfail(is_ascii, reason="Test fails in this locale") +Index: setuptools-57.0.0/setuptools/tests/test_build_clib.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/tests/test_build_clib.py ++++ setuptools-57.0.0/setuptools/tests/test_build_clib.py @@ -1,6 +1,6 @@ import pytest @@ -56,19 +64,23 @@ from distutils.errors import DistutilsSetupError from setuptools.command.build_clib import build_clib from setuptools.dist import Distribution ---- a/setuptools/tests/test_easy_install.py -+++ b/setuptools/tests/test_easy_install.py -@@ -14,7 +14,7 @@ import itertools +Index: setuptools-57.0.0/setuptools/tests/test_easy_install.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/tests/test_easy_install.py ++++ setuptools-57.0.0/setuptools/tests/test_easy_install.py +@@ -12,7 +12,7 @@ import itertools import distutils.errors import io import zipfile -import mock +from . import mock import time - - from setuptools.extern import six ---- a/setuptools/tests/test_msvc.py -+++ b/setuptools/tests/test_msvc.py + import re + import subprocess +Index: setuptools-57.0.0/setuptools/tests/test_msvc.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/tests/test_msvc.py ++++ setuptools-57.0.0/setuptools/tests/test_msvc.py @@ -5,7 +5,7 @@ Tests for msvc support module. import os import contextlib @@ -78,19 +90,23 @@ import pytest ---- a/setuptools/tests/test_packageindex.py -+++ b/setuptools/tests/test_packageindex.py -@@ -6,7 +6,7 @@ import distutils.errors +Index: setuptools-57.0.0/setuptools/tests/test_packageindex.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/tests/test_packageindex.py ++++ setuptools-57.0.0/setuptools/tests/test_packageindex.py +@@ -6,7 +6,7 @@ import urllib.request + import urllib.error + import http.client - from setuptools.extern import six - from setuptools.extern.six.moves import urllib, http_client -import mock +from . import mock import pytest - import pkg_resources ---- a/setuptools/tests/test_register.py -+++ b/setuptools/tests/test_register.py + import setuptools.package_index +Index: setuptools-57.0.0/setuptools/tests/test_register.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/tests/test_register.py ++++ setuptools-57.0.0/setuptools/tests/test_register.py @@ -2,10 +2,7 @@ from setuptools.command.register import from setuptools.dist import Distribution from setuptools.errors import RemovedCommandError @@ -103,19 +119,20 @@ import pytest ---- a/setuptools/tests/test_test.py -+++ b/setuptools/tests/test_test.py -@@ -2,7 +2,7 @@ - - from __future__ import unicode_literals - +Index: setuptools-57.0.0/setuptools/tests/test_test.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/tests/test_test.py ++++ setuptools-57.0.0/setuptools/tests/test_test.py +@@ -1,4 +1,4 @@ -import mock +from . import mock from distutils import log import os ---- a/setuptools/tests/test_upload.py -+++ b/setuptools/tests/test_upload.py +Index: setuptools-57.0.0/setuptools/tests/test_upload.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/tests/test_upload.py ++++ setuptools-57.0.0/setuptools/tests/test_upload.py @@ -2,10 +2,7 @@ from setuptools.command.upload import up from setuptools.dist import Distribution from setuptools.errors import RemovedCommandError @@ -128,9 +145,11 @@ import pytest ---- a/setuptools/tests/test_config.py -+++ b/setuptools/tests/test_config.py -@@ -5,7 +5,7 @@ import contextlib +Index: setuptools-57.0.0/setuptools/tests/test_config.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/tests/test_config.py ++++ setuptools-57.0.0/setuptools/tests/test_config.py +@@ -7,7 +7,7 @@ import configparser import pytest from distutils.errors import DistutilsOptionError, DistutilsFileError @@ -138,18 +157,20 @@ +from setuptools.tests import mock from setuptools.dist import Distribution, _Distribution from setuptools.config import ConfigHandler, read_configuration - from setuptools.extern.six.moves import configparser -@@ -880,7 +880,7 @@ class TestExternalSetters: + from distutils.core import Command +@@ -974,7 +974,7 @@ class TestExternalSetters: }) return None - @patch.object(_Distribution, '__init__', autospec=True) + @mock.patch.object(_Distribution, '__init__', autospec=True) - def test_external_setters(self, mock_parent_init, tmpdir): + def test_external_setters(self, mock_parent_init, tmpdir): mock_parent_init.side_effect = self._fake_distribution_init +Index: setuptools-57.0.0/pkg_resources/tests/__init__.py +=================================================================== --- /dev/null -+++ b/pkg_resources/tests/__init__.py ++++ setuptools-57.0.0/pkg_resources/tests/__init__.py @@ -0,0 +1,4 @@ +try: + import mock diff --git a/setuptools-44.1.1.zip b/setuptools-44.1.1.zip deleted file mode 100644 index 826c11e..0000000 --- a/setuptools-44.1.1.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c67aa55db532a0dadc4d2e20ba9961cbd3ccc84d544e9029699822542b5a476b -size 858770 diff --git a/setuptools-57.0.0.tar.gz b/setuptools-57.0.0.tar.gz new file mode 100644 index 0000000..80bdea4 --- /dev/null +++ b/setuptools-57.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:401cbf33a7bf817d08014d51560fc003b895c4cdc1a5b521ad2969e928a07535 +size 2144749 diff --git a/sort-for-reproducibility.patch b/sort-for-reproducibility.patch index c527176..d0d1f6e 100644 --- a/sort-for-reproducibility.patch +++ b/sort-for-reproducibility.patch @@ -1,6 +1,8 @@ ---- a/setuptools/command/easy_install.py -+++ b/setuptools/command/easy_install.py -@@ -423,7 +423,7 @@ class easy_install(Command): +Index: setuptools-57.0.0/setuptools/command/easy_install.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/command/easy_install.py ++++ setuptools-57.0.0/setuptools/command/easy_install.py +@@ -407,7 +407,7 @@ class easy_install(Command): for spec in self.args: self.easy_install(spec, not self.no_deps) if self.record: @@ -9,20 +11,24 @@ if self.root: # strip any package prefix root_len = len(self.root) for counter in range(len(outputs)): ---- a/setuptools/command/egg_info.py -+++ b/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' +Index: setuptools-57.0.0/setuptools/command/egg_info.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/command/egg_info.py ++++ setuptools-57.0.0/setuptools/command/egg_info.py +@@ -654,7 +654,7 @@ def _write_requirements(stream, reqs): + + def append_cr(line): + return line + '\n' - lines = map(append_cr, lines) + lines = map(append_cr, sorted(lines)) stream.writelines(lines) ---- a/setuptools/dist.py -+++ b/setuptools/dist.py -@@ -195,7 +195,7 @@ def write_pkg_file(self, file): +Index: setuptools-57.0.0/setuptools/dist.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/dist.py ++++ setuptools-57.0.0/setuptools/dist.py +@@ -214,7 +214,7 @@ def write_pkg_file(self, file): # noqa: self.long_description_content_type ) if self.provides_extras: @@ -30,10 +36,12 @@ + for extra in sorted(self.provides_extras): write_field('Provides-Extra', extra) - ---- a/setuptools/tests/test_egg_info.py -+++ b/setuptools/tests/test_egg_info.py -@@ -291,8 +291,8 @@ class TestEggInfo: + self._write_list(file, 'License-File', self.license_files or []) +Index: setuptools-57.0.0/setuptools/tests/test_egg_info.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/tests/test_egg_info.py ++++ setuptools-57.0.0/setuptools/tests/test_egg_info.py +@@ -297,8 +297,8 @@ class TestEggInfo: wheel>=0.5 pytest diff --git a/testdata.tar.gz b/testdata.tar.gz deleted file mode 100644 index 6ac88e6..0000000 --- a/testdata.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0b627ac8b927edfbd4154fb31316e700c678017c3b04e6c5452a1ba03eacb00e -size 1618 From e017d2b69f501e29ce9c91cdfe7c27a8ed7deb8e4a583caef4dc8a0b134dc9dd Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 5 Jul 2021 11:33:23 +0000 Subject: [PATCH 3/3] Accepting request 904140 from home:alarrosa:branches:devel:languages:python - Add patch to remove a dependency cycle between python-more-itertools and python-setuptools (which requires the former just for one simple function): * remove-more-itertools-dependency-cycle.patch OBS-URL: https://build.opensuse.org/request/show/904140 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=217 --- python-setuptools.changes | 8 ++ python-setuptools.spec | 4 +- remove-more-itertools-dependency-cycle.patch | 108 +++++++++++++++++++ 3 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 remove-more-itertools-dependency-cycle.patch diff --git a/python-setuptools.changes b/python-setuptools.changes index db3ff3b..4b2eee5 100644 --- a/python-setuptools.changes +++ b/python-setuptools.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Jul 5 09:22:44 UTC 2021 - Antonio Larrosa + +- Add patch to remove a dependency cycle between + python-more-itertools and python-setuptools (which requires the + former just for one simple function): + * remove-more-itertools-dependency-cycle.patch + ------------------------------------------------------------------- Fri Jun 25 12:46:26 UTC 2021 - Ben Greiner diff --git a/python-setuptools.spec b/python-setuptools.spec index bd2f2f1..d5e9a91 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -45,8 +45,9 @@ Source: https://files.pythonhosted.org/packages/source/s/setuptools/setu Patch0: sort-for-reproducibility.patch # PATCH-FIX-OPENSUSE remove_mock.patch mcepl@suse.com Patch1: remove_mock.patch +# PATCH-FIX-OPENSUSE remove-more-itertools-dependency-cycle.patch alarrosa@suse.com +Patch2: remove-more-itertools-dependency-cycle.patch BuildRequires: %{python_module appdirs >= 1.4.3} -BuildRequires: %{python_module more-itertools >= 8.8.0} BuildRequires: %{python_module ordered-set >= 3.1.1} BuildRequires: %{python_module packaging >= 20.4} BuildRequires: %{python_module pyparsing >= 2.2.1} @@ -56,7 +57,6 @@ BuildRequires: python-rpm-macros BuildRequires: unzip Requires: python-appdirs >= 1.4.3 Requires: python-base >= 3.6 -Requires: python-more-itertools >= 8.8.0 Requires: python-ordered-set >= 3.1.1 Requires: python-packaging >= 20.4 Requires: python-pyparsing >= 2.2.1 diff --git a/remove-more-itertools-dependency-cycle.patch b/remove-more-itertools-dependency-cycle.patch new file mode 100644 index 0000000..1000e90 --- /dev/null +++ b/remove-more-itertools-dependency-cycle.patch @@ -0,0 +1,108 @@ +From: Antonio Larrosa +Subject: Remove dependency on more_itertools which generates a dependency cycle + +setuptools buildrequires more_itertools just for one simple function +(unique_everseen) and more_itertools buildrequires setuptools, so +in order to remove the cycle, the unique_everseen function is copied +here so that it can be used without buildrequiring the external package. + +Index: setuptools-57.0.0/setuptools/extern/__init__.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/extern/__init__.py ++++ setuptools-57.0.0/setuptools/extern/__init__.py +@@ -69,5 +69,5 @@ class VendorImporter: + sys.meta_path.append(self) + + +-names = 'packaging', 'pyparsing', 'ordered_set', 'more_itertools', ++names = 'packaging', 'pyparsing', 'ordered_set' + VendorImporter(__name__, names, 'setuptools._vendor').install() +Index: setuptools-57.0.0/setuptools/dist.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/dist.py ++++ setuptools-57.0.0/setuptools/dist.py +@@ -29,7 +29,7 @@ from distutils.version import StrictVers + + from setuptools.extern import packaging + from setuptools.extern import ordered_set +-from setuptools.extern.more_itertools import unique_everseen ++from setuptools.more_itertools import unique_everseen + + from . import SetuptoolsDeprecationWarning + +Index: setuptools-57.0.0/setuptools/more_itertools.py +=================================================================== +--- /dev/null ++++ setuptools-57.0.0/setuptools/more_itertools.py +@@ -0,0 +1,19 @@ ++def unique_everseen(iterable, key=None): ++ """Yield unique elements, preserving order.""" ++ ++ seenset = set() ++ seenset_add = seenset.add ++ seenlist = [] ++ seenlist_add = seenlist.append ++ use_key = key is not None ++ ++ for element in iterable: ++ k = key(element) if use_key else element ++ try: ++ if k not in seenset: ++ seenset_add(k) ++ yield element ++ except TypeError: ++ if k not in seenlist: ++ seenlist_add(k) ++ yield element +Index: setuptools-57.0.0/setuptools/command/build_py.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/command/build_py.py ++++ setuptools-57.0.0/setuptools/command/build_py.py +@@ -8,7 +8,7 @@ import io + import distutils.errors + import itertools + import stat +-from setuptools.extern.more_itertools import unique_everseen ++from setuptools.more_itertools import unique_everseen + + try: + from setuptools.lib2to3_ex import Mixin2to3 +Index: setuptools-57.0.0/setuptools/msvc.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/msvc.py ++++ setuptools-57.0.0/setuptools/msvc.py +@@ -30,7 +30,7 @@ import itertools + import subprocess + import distutils.errors + from setuptools.extern.packaging.version import LegacyVersion +-from setuptools.extern.more_itertools import unique_everseen ++from setuptools.more_itertools import unique_everseen + + from .monkey import get_unpatched + +Index: setuptools-57.0.0/setuptools/package_index.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/package_index.py ++++ setuptools-57.0.0/setuptools/package_index.py +@@ -28,7 +28,7 @@ from distutils import log + from distutils.errors import DistutilsError + from fnmatch import translate + from setuptools.wheel import Wheel +-from setuptools.extern.more_itertools import unique_everseen ++from setuptools.more_itertools import unique_everseen + + + EGG_FRAGMENT = re.compile(r'^egg=([-A-Za-z0-9_.+!]+)$') +Index: setuptools-57.0.0/setuptools/command/test.py +=================================================================== +--- setuptools-57.0.0.orig/setuptools/command/test.py ++++ setuptools-57.0.0/setuptools/command/test.py +@@ -12,7 +12,7 @@ from pkg_resources import (resource_list + working_set, _namespace_packages, evaluate_marker, + add_activation_listener, require, EntryPoint) + from setuptools import Command +-from setuptools.extern.more_itertools import unique_everseen ++from setuptools.more_itertools import unique_everseen + + + class ScanningLoader(TestLoader):