diff --git a/67c03c3e810336d0381efdc64fdff577033336ec.patch b/67c03c3e810336d0381efdc64fdff577033336ec.patch new file mode 100644 index 0000000000000000000000000000000000000000..b58ae6c48b164b9cb0970aa0c91982345d75de4e --- /dev/null +++ b/67c03c3e810336d0381efdc64fdff577033336ec.patch @@ -0,0 +1,51 @@ +diff --git a/news/a9950589-8b92-4ec1-a3a1-a6657cf6fd5b.trivial.rst b/news/a9950589-8b92-4ec1-a3a1-a6657cf6fd5b.trivial.rst +new file mode 100644 +index 0000000000..e69de29bb2 +diff --git a/src/pip/_internal/utils/logging.py b/src/pip/_internal/utils/logging.py +index 9fd1d42c70..6e1aff1238 100644 +--- a/src/pip/_internal/utils/logging.py ++++ b/src/pip/_internal/utils/logging.py +@@ -20,31 +20,11 @@ + + + try: +- # Use "import as" and set colorama in the else clause to avoid mypy +- # errors and get the following correct revealed type for colorama: +- # `Union[_importlib_modulespec.ModuleType, None]` +- # Otherwise, we get an error like the following in the except block: +- # > Incompatible types in assignment (expression has type "None", +- # variable has type Module) +- # TODO: eliminate the need to use "import as" once mypy addresses some +- # of its issues with conditional imports. Here is an umbrella issue: +- # https://github.com/python/mypy/issues/1297 +- from pip._vendor import colorama as _colorama ++ from pip._vendor import colorama + # Lots of different errors can come from this, including SystemError and + # ImportError. + except Exception: + colorama = None +-else: +- # Import Fore explicitly rather than accessing below as colorama.Fore +- # to avoid the following error running mypy: +- # > Module has no attribute "Fore" +- # TODO: eliminate the need to import Fore once mypy addresses some of its +- # issues with conditional imports. This particular case could be an +- # instance of the following issue (but also see the umbrella issue above): +- # https://github.com/python/mypy/issues/3500 +- from pip._vendor.colorama import Fore +- +- colorama = _colorama + + + _log_state = threading.local() +@@ -162,8 +142,8 @@ class ColorizedStreamHandler(logging.StreamHandler): + if colorama: + COLORS = [ + # This needs to be in order from highest logging level to lowest. +- (logging.ERROR, _color_wrap(Fore.RED)), +- (logging.WARNING, _color_wrap(Fore.YELLOW)), ++ (logging.ERROR, _color_wrap(colorama.Fore.RED)), ++ (logging.WARNING, _color_wrap(colorama.Fore.YELLOW)), + ] + else: + COLORS = [] diff --git a/adca454611c2312e869956aeb51016947c134b60.patch b/adca454611c2312e869956aeb51016947c134b60.patch new file mode 100644 index 0000000000000000000000000000000000000000..b3f2916d454b8384bd3a3f60de526689be6f07f0 --- /dev/null +++ b/adca454611c2312e869956aeb51016947c134b60.patch @@ -0,0 +1,74 @@ +diff --git a/news/205edb4f-502c-4213-b8b8-c9173718e8ab.trivial.rst b/news/205edb4f-502c-4213-b8b8-c9173718e8ab.trivial.rst +new file mode 100644 +index 0000000000..e69de29bb2 +diff --git a/src/pip/_internal/operations/install/wheel.py b/src/pip/_internal/operations/install/wheel.py +index b6da06f55a..37dcb618c6 100644 +--- a/src/pip/_internal/operations/install/wheel.py ++++ b/src/pip/_internal/operations/install/wheel.py +@@ -46,6 +46,7 @@ + from typing import ( + IO, + Any, ++ BinaryIO, + Callable, + Dict, + Iterable, +@@ -65,7 +66,6 @@ + from pip._vendor.pkg_resources import Distribution + + from pip._internal.models.scheme import Scheme +- from pip._internal.utils.filesystem import NamedTemporaryFileResult + + RecordPath = NewType('RecordPath', str) + InstalledCSVRow = Tuple[RecordPath, str, Union[int, str]] +@@ -742,7 +742,7 @@ def pyc_output_path(path): + + @contextlib.contextmanager + def _generate_file(path, **kwargs): +- # type: (str, **Any) -> Iterator[NamedTemporaryFileResult] ++ # type: (str, **Any) -> Iterator[BinaryIO] + with adjacent_tmp_file(path, **kwargs) as f: + yield f + os.chmod(f.name, generated_file_mode) +diff --git a/src/pip/_internal/utils/filesystem.py b/src/pip/_internal/utils/filesystem.py +index dfa2802f71..1af8c10eaa 100644 +--- a/src/pip/_internal/utils/filesystem.py ++++ b/src/pip/_internal/utils/filesystem.py +@@ -19,12 +19,6 @@ + if MYPY_CHECK_RUNNING: + from typing import Any, BinaryIO, Iterator, List, Union + +- class NamedTemporaryFileResult(BinaryIO): +- @property +- def file(self): +- # type: () -> BinaryIO +- pass +- + + def check_path_owner(path): + # type: (str) -> bool +@@ -86,7 +80,7 @@ def is_socket(path): + + @contextmanager + def adjacent_tmp_file(path, **kwargs): +- # type: (str, **Any) -> Iterator[NamedTemporaryFileResult] ++ # type: (str, **Any) -> Iterator[BinaryIO] + """Return a file-like object pointing to a tmp file next to path. + + The file is created securely and is ensured to be written to disk +@@ -102,12 +96,12 @@ def adjacent_tmp_file(path, **kwargs): + suffix='.tmp', + **kwargs + ) as f: +- result = cast('NamedTemporaryFileResult', f) ++ result = cast('BinaryIO', f) + try: + yield result + finally: +- result.file.flush() +- os.fsync(result.file.fileno()) ++ result.flush() ++ os.fsync(result.fileno()) + + + _replace_retry = retry(stop_max_delay=1000, wait_fixed=250) diff --git a/bad26fb5fe60d3ca81c02f76c88f19ac105b116b.patch b/bad26fb5fe60d3ca81c02f76c88f19ac105b116b.patch new file mode 100644 index 0000000000000000000000000000000000000000..f22cf9ad236dfa0d6b1e0046daed7838bf75529f --- /dev/null +++ b/bad26fb5fe60d3ca81c02f76c88f19ac105b116b.patch @@ -0,0 +1,31 @@ +diff --git a/news/ae7bdce7-d6f3-4f30-9192-6a8e69027d6a.trivial.rst b/news/ae7bdce7-d6f3-4f30-9192-6a8e69027d6a.trivial.rst +new file mode 100644 +index 0000000000..e69de29bb2 +diff --git a/src/pip/_internal/locations.py b/src/pip/_internal/locations.py +index dc5d2e0b2d..2a90329773 100644 +--- a/src/pip/_internal/locations.py ++++ b/src/pip/_internal/locations.py +@@ -5,11 +5,9 @@ + + import os + import os.path +-import platform + import site + import sys + import sysconfig +-from distutils import sysconfig as distutils_sysconfig + from distutils.command.install import SCHEME_KEYS # type: ignore + from distutils.command.install import install as distutils_install_command + +@@ -60,11 +58,6 @@ def get_src_prefix(): + + site_packages = sysconfig.get_path("purelib") # type: Optional[str] + +-# This is because of a bug in PyPy's sysconfig module, see +-# https://bitbucket.org/pypy/pypy/issues/2506/sysconfig-returns-incorrect-paths +-# for more information. +-if platform.python_implementation().lower() == "pypy": +- site_packages = distutils_sysconfig.get_python_lib() + try: + # Use getusersitepackages if this is present, as it ensures that the + # value is initialised properly. diff --git a/python-pip.spec b/python-pip.spec index 3d035b59a33f24b5c58f6925acf4d9cb6a79f840..83c6ff435bbe5269ecf70228a005608489cf6e5d 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: bad26fb5fe60d3ca81c02f76c88f19ac105b116b.patch +Patch6002: adca454611c2312e869956aeb51016947c134b60.patch +Patch6003: 67c03c3e810336d0381efdc64fdff577033336ec.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 +* 20201228155849754502 patch-tracking 20.2.2-4 +- append patch file of upstream repository from to <67c03c3e810336d0381efdc64fdff577033336ec> + * 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