diff --git a/062f0e54d99f58e53be36be5a45adad89e2429fb.patch b/062f0e54d99f58e53be36be5a45adad89e2429fb.patch new file mode 100644 index 0000000000000000000000000000000000000000..aaf4b13f0c93ef2bebf70d8724da4c7029ba1bc5 --- /dev/null +++ b/062f0e54d99f58e53be36be5a45adad89e2429fb.patch @@ -0,0 +1,86 @@ +diff --git a/news/4a85b5f1-5f9a-4f6b-8960-3334570ae591.trivial.rst b/news/4a85b5f1-5f9a-4f6b-8960-3334570ae591.trivial.rst +new file mode 100644 +index 0000000000..e69de29bb2 +diff --git a/src/pip/_internal/models/format_control.py b/src/pip/_internal/models/format_control.py +index fc2747c950..eb46f25359 100644 +--- a/src/pip/_internal/models/format_control.py ++++ b/src/pip/_internal/models/format_control.py +@@ -36,10 +36,6 @@ def __eq__(self, other): + for k in self.__slots__ + ) + +- def __ne__(self, other): +- # type: (object) -> bool +- return not self.__eq__(other) +- + def __repr__(self): + # type: () -> str + return "{}({}, {})".format( +diff --git a/src/pip/_internal/resolution/resolvelib/candidates.py b/src/pip/_internal/resolution/resolvelib/candidates.py +index 2453b65ac6..6725684a51 100644 +--- a/src/pip/_internal/resolution/resolvelib/candidates.py ++++ b/src/pip/_internal/resolution/resolvelib/candidates.py +@@ -164,11 +164,6 @@ def __eq__(self, other): + return self._link == other._link + return False + +- # Needed for Python 2, which does not implement this by default +- def __ne__(self, other): +- # type: (Any) -> bool +- return not self.__eq__(other) +- + @property + def source_link(self): + # type: () -> Optional[Link] +@@ -378,11 +373,6 @@ def __eq__(self, other): + return self.name == other.name and self.version == other.version + return False + +- # Needed for Python 2, which does not implement this by default +- def __ne__(self, other): +- # type: (Any) -> bool +- return not self.__eq__(other) +- + @property + def project_name(self): + # type: () -> str +@@ -475,11 +465,6 @@ def __eq__(self, other): + return self.base == other.base and self.extras == other.extras + return False + +- # Needed for Python 2, which does not implement this by default +- def __ne__(self, other): +- # type: (Any) -> bool +- return not self.__eq__(other) +- + @property + def project_name(self): + # type: () -> str +diff --git a/src/pip/_internal/utils/models.py b/src/pip/_internal/utils/models.py +index e7db67a933..c14e9ff926 100644 +--- a/src/pip/_internal/utils/models.py ++++ b/src/pip/_internal/utils/models.py +@@ -34,9 +34,6 @@ def __ge__(self, other): + def __eq__(self, other): + return self._compare(other, operator.__eq__) + +- def __ne__(self, other): +- return self._compare(other, operator.__ne__) +- + def _compare(self, other, method): + if not isinstance(other, self._defining_class): + return NotImplemented +diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py +index 7b24c8983b..9c43d55314 100644 +--- a/tests/unit/test_utils.py ++++ b/tests/unit/test_utils.py +@@ -847,8 +847,7 @@ def test_equality_same_secret(self): + hidden2 = HiddenText('secret', redacted='####') + + assert hidden1 == hidden2 +- # Also test __ne__. This assertion fails in Python 2 without +- # defining HiddenText.__ne__. ++ # Also test __ne__. + assert not hidden1 != hidden2 + + def test_equality_different_secret(self): diff --git a/35604e5a4c0b95de54ededf9d68eac865ab3d407.patch b/35604e5a4c0b95de54ededf9d68eac865ab3d407.patch new file mode 100644 index 0000000000000000000000000000000000000000..d0ffb15183ae745dc88e1fffa3e4f68b99f85b96 --- /dev/null +++ b/35604e5a4c0b95de54ededf9d68eac865ab3d407.patch @@ -0,0 +1,60 @@ +diff --git a/news/2905cccb-2fe8-4b0d-8734-303510a7e4ce.trivial.rst b/news/2905cccb-2fe8-4b0d-8734-303510a7e4ce.trivial.rst +new file mode 100644 +index 0000000000..e69de29bb2 +diff --git a/src/pip/_internal/vcs/bazaar.py b/src/pip/_internal/vcs/bazaar.py +index ee78b5d27c..6af3e35ff8 100644 +--- a/src/pip/_internal/vcs/bazaar.py ++++ b/src/pip/_internal/vcs/bazaar.py +@@ -96,6 +96,7 @@ def get_remote_url(cls, location): + + @classmethod + def get_revision(cls, location): ++ # type: (str) -> str + revision = cls.run_command( + ['revno'], cwd=location, + ) +diff --git a/src/pip/_internal/vcs/git.py b/src/pip/_internal/vcs/git.py +index e540e02dd8..88a56d6add 100644 +--- a/src/pip/_internal/vcs/git.py ++++ b/src/pip/_internal/vcs/git.py +@@ -345,6 +345,7 @@ def has_commit(cls, location, rev): + + @classmethod + def get_revision(cls, location, rev=None): ++ # type: (str, Optional[str]) -> str + if rev is None: + rev = 'HEAD' + current_rev = cls.run_command( +diff --git a/src/pip/_internal/vcs/mercurial.py b/src/pip/_internal/vcs/mercurial.py +index e7988d1ac2..98c288864f 100644 +--- a/src/pip/_internal/vcs/mercurial.py ++++ b/src/pip/_internal/vcs/mercurial.py +@@ -97,6 +97,7 @@ def get_remote_url(cls, location): + + @classmethod + def get_revision(cls, location): ++ # type: (str) -> str + """ + Return the repository-local changeset revision number, as an integer. + """ +diff --git a/src/pip/_internal/vcs/subversion.py b/src/pip/_internal/vcs/subversion.py +index b6b7010bfc..0582ab0c7b 100644 +--- a/src/pip/_internal/vcs/subversion.py ++++ b/src/pip/_internal/vcs/subversion.py +@@ -49,6 +49,7 @@ def get_base_rev_args(rev): + + @classmethod + def get_revision(cls, location): ++ # type: (str) -> str + """ + Return the maximum revision for all files under a given location + """ +@@ -73,7 +74,7 @@ def get_revision(cls, location): + dirs[:] = [] + continue # not part of the same svn tree, skip it + revision = max(revision, localrev) +- return revision ++ return str(revision) + + @classmethod + def get_netloc_and_auth(cls, netloc, scheme): diff --git a/a61cb200b5853fbbc10217aa3ede509695722533.patch b/a61cb200b5853fbbc10217aa3ede509695722533.patch new file mode 100644 index 0000000000000000000000000000000000000000..bbda4dcbbcdb064cffce24a5bd87566733aaa457 --- /dev/null +++ b/a61cb200b5853fbbc10217aa3ede509695722533.patch @@ -0,0 +1,42 @@ +diff --git a/news/0dd6ac6d-b127-4551-a404-404b0ee8dcd3.trivial.rst b/news/0dd6ac6d-b127-4551-a404-404b0ee8dcd3.trivial.rst +new file mode 100644 +index 0000000000..e69de29bb2 +diff --git a/src/pip/_internal/vcs/subversion.py b/src/pip/_internal/vcs/subversion.py +index 85ce2aa916..b6b7010bfc 100644 +--- a/src/pip/_internal/vcs/subversion.py ++++ b/src/pip/_internal/vcs/subversion.py +@@ -128,7 +128,11 @@ def get_remote_url(cls, location): + ) + raise RemoteNotFoundError + +- return cls._get_svn_url_rev(location)[0] ++ url, _rev = cls._get_svn_url_rev(location) ++ if url is None: ++ raise RemoteNotFoundError ++ ++ return url + + @classmethod + def _get_svn_url_rev(cls, location): +diff --git a/tests/functional/test_vcs_subversion.py b/tests/functional/test_vcs_subversion.py +index c71c793f89..194019da95 100644 +--- a/tests/functional/test_vcs_subversion.py ++++ b/tests/functional/test_vcs_subversion.py +@@ -15,3 +15,17 @@ def test_get_remote_url__no_remote(script, tmpdir): + + with pytest.raises(RemoteNotFoundError): + Subversion().get_remote_url(repo_dir) ++ ++ ++@need_svn ++def test_get_remote_url__no_remote_with_setup(script, tmpdir): ++ repo_dir = tmpdir / 'temp-repo' ++ repo_dir.mkdir() ++ setup = repo_dir / "setup.py" ++ setup.touch() ++ repo_dir = str(repo_dir) ++ ++ _create_svn_repo(script, repo_dir) ++ ++ with pytest.raises(RemoteNotFoundError): ++ Subversion().get_remote_url(repo_dir) diff --git a/df6ac53382d6bd58d5d0f6cad3fce4452cab1c93.patch b/df6ac53382d6bd58d5d0f6cad3fce4452cab1c93.patch new file mode 100644 index 0000000000000000000000000000000000000000..c14081c336dcafd68961cc372d0b09fd750c4530 --- /dev/null +++ b/df6ac53382d6bd58d5d0f6cad3fce4452cab1c93.patch @@ -0,0 +1,89 @@ +diff --git a/src/pip/_internal/commands/install.py b/src/pip/_internal/commands/install.py +index cd97ecb604..a1167887f5 100644 +--- a/src/pip/_internal/commands/install.py ++++ b/src/pip/_internal/commands/install.py +@@ -50,8 +50,6 @@ def get_check_binary_allowed(format_control): + # type: (FormatControl) -> BinaryAllowedPredicate + def check_binary_allowed(req): + # type: (InstallRequirement) -> bool +- if req.use_pep517: +- return True + canonical_name = canonicalize_name(req.name) + allowed_formats = format_control.get_allowed_formats(canonical_name) + return "binary" in allowed_formats +diff --git a/src/pip/_internal/wheel_builder.py b/src/pip/_internal/wheel_builder.py +index 27fce66c26..e315fe1110 100644 +--- a/src/pip/_internal/wheel_builder.py ++++ b/src/pip/_internal/wheel_builder.py +@@ -68,6 +68,9 @@ def _should_build( + if req.editable or not req.source_dir: + return False + ++ if req.use_pep517: ++ return True ++ + if not check_binary_allowed(req): + logger.info( + "Skipping wheel build for %s, due to binaries " +@@ -75,7 +78,7 @@ def _should_build( + ) + return False + +- if not req.use_pep517 and not is_wheel_installed(): ++ if not is_wheel_installed(): + # we don't build legacy requirements if wheel is not installed + logger.info( + "Using legacy 'setup.py install' for %s, " +diff --git a/tests/unit/test_wheel_builder.py b/tests/unit/test_wheel_builder.py +index dcaa1e793a..bd42f30595 100644 +--- a/tests/unit/test_wheel_builder.py ++++ b/tests/unit/test_wheel_builder.py +@@ -53,17 +53,44 @@ def __init__( + @pytest.mark.parametrize( + "req, disallow_binaries, expected", + [ +- (ReqMock(), False, True), +- (ReqMock(), True, False), ++ # When binaries are allowed, we build. ++ (ReqMock(use_pep517=True), False, True), ++ (ReqMock(use_pep517=False), False, True), ++ # When binaries are disallowed, we don't build, unless pep517 is ++ # enabled. ++ (ReqMock(use_pep517=True), True, True), ++ (ReqMock(use_pep517=False), True, False), ++ # We don't build constraints. + (ReqMock(constraint=True), False, False), ++ # We don't build reqs that are already wheels. + (ReqMock(is_wheel=True), False, False), ++ # We don't build editables. + (ReqMock(editable=True), False, False), + (ReqMock(source_dir=None), False, False), + # By default (i.e. when binaries are allowed), VCS requirements + # should be built in install mode. +- (ReqMock(link=Link("git+https://g.c/org/repo")), False, True), ++ ( ++ ReqMock(link=Link("git+https://g.c/org/repo"), use_pep517=True), ++ False, ++ True, ++ ), ++ ( ++ ReqMock(link=Link("git+https://g.c/org/repo"), use_pep517=False), ++ False, ++ True, ++ ), + # Disallowing binaries, however, should cause them not to be built. +- (ReqMock(link=Link("git+https://g.c/org/repo")), True, False), ++ # unless pep517 is enabled. ++ ( ++ ReqMock(link=Link("git+https://g.c/org/repo"), use_pep517=True), ++ True, ++ True, ++ ), ++ ( ++ ReqMock(link=Link("git+https://g.c/org/repo"), use_pep517=False), ++ True, ++ False, ++ ), + ], + ) + def test_should_build_for_install_command(req, disallow_binaries, expected): diff --git a/python-pip.spec b/python-pip.spec index 3d035b59a33f24b5c58f6925acf4d9cb6a79f840..ec066629c4cc77dc0cf266d0d4105637dd4adb45 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -6,7 +6,7 @@ pip is the package installer for Python. You can use pip to install packages fro %global bashcompdir %(b=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null); echo ${b:-%{_sysconfdir}/bash_completion.d}) Name: python-%{srcname} Version: 20.2.2 -Release: 3 +Release: 4 Summary: A tool for installing and managing Python packages License: MIT and Python and ASL 2.0 and BSD and ISC and LGPLv2 and MPLv2.0 and (ASL 2.0 or BSD) URL: http://www.pip-installer.org @@ -16,6 +16,10 @@ Patch1: allow-stripping-given-prefix-from-wheel-RECORD-files.patch Patch2: emit-a-warning-when-running-with-root-privileges.patch Patch3: remove-existing-dist-only-if-path-conflicts.patch Patch6000: dummy-certifi.patch +Patch6001: a61cb200b5853fbbc10217aa3ede509695722533.patch +Patch6002: df6ac53382d6bd58d5d0f6cad3fce4452cab1c93.patch +Patch6003: 35604e5a4c0b95de54ededf9d68eac865ab3d407.patch +Patch6004: 062f0e54d99f58e53be36be5a45adad89e2429fb.patch Source10: pip-allow-older-versions.patch %description %{_description} @@ -112,6 +116,9 @@ install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir} %{python_wheeldir}/%{python_wheelname} %changelog +* 20210102025849754649 patch-tracking 20.2.2-4 +- append patch file of upstream repository from to <062f0e54d99f58e53be36be5a45adad89e2429fb> + * Wed Nov 4 2020 wangjie -20.2.2-3 - Type:NA - ID:NA @@ -161,4 +168,4 @@ install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir} - DESC: Synchronize a patch * Mon Sep 23 2019 openEuler Buildteam - 18.0-6 -- Package init +- Package init \ No newline at end of file