diff --git a/3977babbabab5c4ff4bb03539f8ccdb17c98210f.patch b/3977babbabab5c4ff4bb03539f8ccdb17c98210f.patch new file mode 100644 index 0000000000000000000000000000000000000000..a80a5df12aa505b2744fed05aa317ab5cddb31d1 --- /dev/null +++ b/3977babbabab5c4ff4bb03539f8ccdb17c98210f.patch @@ -0,0 +1,16 @@ +diff --git a/news/857785f2-1d4e-4067-9b4b-acc6ae741aef.trivial.rst b/news/857785f2-1d4e-4067-9b4b-acc6ae741aef.trivial.rst +new file mode 100644 +index 0000000000..e69de29bb2 +diff --git a/tests/functional/test_wheel.py b/tests/functional/test_wheel.py +index 286d694356..b2ea414ac9 100644 +--- a/tests/functional/test_wheel.py ++++ b/tests/functional/test_wheel.py +@@ -301,7 +301,7 @@ def test_pip_wheel_ext_module_with_tmpdir_inside(script, data, common_wheels): + + # To avoid a test dependency on a C compiler, we set the env vars to "noop" + # The .c source is empty anyway +- script.environ['CC'] = script.environ['LDSHARED'] = str('true') ++ script.environ['CC'] = script.environ['LDSHARED'] = 'true' + + result = script.pip( + 'wheel', data.src / 'extension', diff --git a/4e48ba838b48d9d24afa312c6183346f3b0243e9.patch b/4e48ba838b48d9d24afa312c6183346f3b0243e9.patch new file mode 100644 index 0000000000000000000000000000000000000000..1ca893f9c1399ad49f40aec463b4bccbf55e1cc4 --- /dev/null +++ b/4e48ba838b48d9d24afa312c6183346f3b0243e9.patch @@ -0,0 +1,132 @@ +diff --git a/news/275aa0e8-ebb1-4eaf-aee0-e5582a8c5d58.trivial.rst b/news/275aa0e8-ebb1-4eaf-aee0-e5582a8c5d58.trivial.rst +new file mode 100644 +index 0000000000..e69de29bb2 +diff --git a/src/pip/_internal/index/collector.py b/src/pip/_internal/index/collector.py +index 2715fcf92a..6ad72de5c5 100644 +--- a/src/pip/_internal/index/collector.py ++++ b/src/pip/_internal/index/collector.py +@@ -21,7 +21,6 @@ + from pip._internal.models.link import Link + from pip._internal.models.search_scope import SearchScope + from pip._internal.network.utils import raise_for_status +-from pip._internal.utils.compat import lru_cache + from pip._internal.utils.filetypes import is_archive_file + from pip._internal.utils.misc import pairwise, redact_auth_from_url + from pip._internal.utils.typing import MYPY_CHECK_RUNNING +@@ -311,7 +310,7 @@ def with_cached_html_pages( + `page` has `page.cache_link_parsing == False`. + """ + +- @lru_cache(maxsize=None) ++ @functools.lru_cache(maxsize=None) + def wrapper(cacheable_page): + # type: (CacheablePageContent) -> List[Link] + return list(fn(cacheable_page.page)) +diff --git a/src/pip/_internal/index/package_finder.py b/src/pip/_internal/index/package_finder.py +index cd76870481..adb2459227 100644 +--- a/src/pip/_internal/index/package_finder.py ++++ b/src/pip/_internal/index/package_finder.py +@@ -3,6 +3,7 @@ + # The following comment should be removed at some point in the future. + # mypy: strict-optional=False + ++import functools + import logging + import re + +@@ -23,7 +24,6 @@ + from pip._internal.models.selection_prefs import SelectionPreferences + from pip._internal.models.target_python import TargetPython + from pip._internal.models.wheel import Wheel +-from pip._internal.utils.compat import lru_cache + from pip._internal.utils.filetypes import WHEEL_EXTENSION + from pip._internal.utils.logging import indent_log + from pip._internal.utils.misc import build_netloc +@@ -790,7 +790,7 @@ def process_project_url(self, project_url, link_evaluator): + + return package_links + +- @lru_cache(maxsize=None) ++ @functools.lru_cache(maxsize=None) + def find_all_candidates(self, project_name): + # type: (str) -> List[InstallationCandidate] + """Find all available InstallationCandidate for project_name +@@ -853,7 +853,7 @@ def make_candidate_evaluator( + hashes=hashes, + ) + +- @lru_cache(maxsize=None) ++ @functools.lru_cache(maxsize=None) + def find_best_candidate( + self, + project_name, # type: str +diff --git a/src/pip/_internal/resolution/resolvelib/found_candidates.py b/src/pip/_internal/resolution/resolvelib/found_candidates.py +index a669e89367..439259818f 100644 +--- a/src/pip/_internal/resolution/resolvelib/found_candidates.py ++++ b/src/pip/_internal/resolution/resolvelib/found_candidates.py +@@ -1,9 +1,9 @@ ++import functools + import itertools + import operator + + from pip._vendor.six.moves import collections_abc # type: ignore + +-from pip._internal.utils.compat import lru_cache + from pip._internal.utils.typing import MYPY_CHECK_RUNNING + + if MYPY_CHECK_RUNNING: +@@ -88,7 +88,7 @@ def __len__(self): + # performance reasons). + raise NotImplementedError("don't do this") + +- @lru_cache(maxsize=1) ++ @functools.lru_cache(maxsize=1) + def __bool__(self): + # type: () -> bool + if self._prefers_installed and self._installed: +diff --git a/src/pip/_internal/utils/compat.py b/src/pip/_internal/utils/compat.py +index cc8ecd0f68..6eeb712ad6 100644 +--- a/src/pip/_internal/utils/compat.py ++++ b/src/pip/_internal/utils/compat.py +@@ -5,7 +5,6 @@ + # mypy: disallow-untyped-defs=False + + import codecs +-import functools + import locale + import logging + import os +@@ -14,15 +13,7 @@ + from pip._internal.utils.typing import MYPY_CHECK_RUNNING + + if MYPY_CHECK_RUNNING: +- from typing import Callable, Optional, Protocol, TypeVar, Union +- +- # Used in the @lru_cache polyfill. +- F = TypeVar('F') +- +- class LruCache(Protocol): +- def __call__(self, maxsize=None): +- # type: (Optional[int]) -> Callable[[F], F] +- raise NotImplementedError ++ from typing import Optional, Union + + try: + import ipaddress +@@ -185,16 +176,3 @@ def expanduser(path): + # windows detection, covers cpython and ironpython + WINDOWS = (sys.platform.startswith("win") or + (sys.platform == 'cli' and os.name == 'nt')) +- +- +-# Fallback to noop_lru_cache in Python 2 +-# TODO: this can be removed when python 2 support is dropped! +-def noop_lru_cache(maxsize=None): +- # type: (Optional[int]) -> Callable[[F], F] +- def _wrapper(f): +- # type: (F) -> F +- return f +- return _wrapper +- +- +-lru_cache = getattr(functools, "lru_cache", noop_lru_cache) # type: LruCache diff --git a/fe741a261057881c7f0b344ee4864706d643da6b.patch b/fe741a261057881c7f0b344ee4864706d643da6b.patch new file mode 100644 index 0000000000000000000000000000000000000000..2ff58b4703d5f7b4ea6198299c9058cac8d31362 --- /dev/null +++ b/fe741a261057881c7f0b344ee4864706d643da6b.patch @@ -0,0 +1,34 @@ +diff --git a/news/7ced09a1-9af6-4190-8249-05a6328e379e.trivial.rst b/news/7ced09a1-9af6-4190-8249-05a6328e379e.trivial.rst +new file mode 100644 +index 0000000000..e69de29bb2 +diff --git a/src/pip/_internal/utils/direct_url_helpers.py b/src/pip/_internal/utils/direct_url_helpers.py +index 87bd61fa01..c6cd976cae 100644 +--- a/src/pip/_internal/utils/direct_url_helpers.py ++++ b/src/pip/_internal/utils/direct_url_helpers.py +@@ -1,3 +1,4 @@ ++import json + import logging + + from pip._internal.models.direct_url import ( +@@ -11,12 +12,6 @@ + from pip._internal.utils.typing import MYPY_CHECK_RUNNING + from pip._internal.vcs import vcs + +-try: +- from json import JSONDecodeError +-except ImportError: +- # PY2 +- JSONDecodeError = ValueError # type: ignore +- + if MYPY_CHECK_RUNNING: + from typing import Optional + +@@ -114,7 +109,7 @@ def dist_get_direct_url(dist): + return DirectUrl.from_json(dist.get_metadata(DIRECT_URL_METADATA_NAME)) + except ( + DirectUrlValidationError, +- JSONDecodeError, ++ json.JSONDecodeError, + UnicodeDecodeError + ) as e: + logger.warning( diff --git a/python-pip.spec b/python-pip.spec index 3d035b59a33f24b5c58f6925acf4d9cb6a79f840..f8eee4103d77a808819116cb9ccc13b3dbce2eda 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,9 @@ 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: 4e48ba838b48d9d24afa312c6183346f3b0243e9.patch +Patch6002: fe741a261057881c7f0b344ee4864706d643da6b.patch +Patch6003: 3977babbabab5c4ff4bb03539f8ccdb17c98210f.patch Source10: pip-allow-older-versions.patch %description %{_description} @@ -112,6 +115,9 @@ install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir} %{python_wheeldir}/%{python_wheelname} %changelog +* 20201226175849753759 patch-tracking 20.2.2-4 +- append patch file of upstream repository from <4e48ba838b48d9d24afa312c6183346f3b0243e9> to <3977babbabab5c4ff4bb03539f8ccdb17c98210f> + * Wed Nov 4 2020 wangjie -20.2.2-3 - Type:NA - ID:NA @@ -161,4 +167,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