diff --git a/1e558d7c1dac02f148499e79d932fefbe636b4e6.patch b/1e558d7c1dac02f148499e79d932fefbe636b4e6.patch new file mode 100644 index 0000000000000000000000000000000000000000..fbf5e2622b2641183ffd73c80c2909d25252794d --- /dev/null +++ b/1e558d7c1dac02f148499e79d932fefbe636b4e6.patch @@ -0,0 +1,501 @@ +diff --git a/news/bb86bc866fdc4257a445e0df09dd7e64.trivial.rst b/news/bb86bc866fdc4257a445e0df09dd7e64.trivial.rst +new file mode 100644 +index 0000000000..e69de29bb2 +diff --git a/src/pip/_internal/exceptions.py b/src/pip/_internal/exceptions.py +index b60bbbd21a..d8a074f5b6 100644 +--- a/src/pip/_internal/exceptions.py ++++ b/src/pip/_internal/exceptions.py +@@ -7,7 +7,7 @@ + if MYPY_CHECK_RUNNING: + import configparser + from hashlib import _Hash +- from typing import Any, Dict, List, Optional, Text ++ from typing import Any, Dict, List, Optional + + from pip._vendor.pkg_resources import Distribution + from pip._vendor.requests.models import Request, Response +@@ -95,7 +95,7 @@ class NetworkConnectionError(PipError): + """HTTP connection error""" + + def __init__(self, error_msg, response=None, request=None): +- # type: (Text, Response, Request) -> None ++ # type: (str, Response, Request) -> None + """ + Initialize NetworkConnectionError with `request` and `response` + objects. +diff --git a/src/pip/_internal/index/package_finder.py b/src/pip/_internal/index/package_finder.py +index 4fdecd226e..860eb1255c 100644 +--- a/src/pip/_internal/index/package_finder.py ++++ b/src/pip/_internal/index/package_finder.py +@@ -33,7 +33,7 @@ + from pip._internal.utils.urls import url_to_path + + if MYPY_CHECK_RUNNING: +- from typing import FrozenSet, Iterable, List, Optional, Set, Text, Tuple, Union ++ from typing import FrozenSet, Iterable, List, Optional, Set, Tuple, Union + + from pip._vendor.packaging.tags import Tag + from pip._vendor.packaging.version import _BaseVersion +@@ -149,7 +149,7 @@ def __init__( + self.project_name = project_name + + def evaluate_link(self, link): +- # type: (Link) -> Tuple[bool, Optional[Text]] ++ # type: (Link) -> Tuple[bool, Optional[str]] + """ + Determine whether a link is a candidate for installation. + +@@ -736,7 +736,7 @@ def _sort_links(self, links): + return no_eggs + eggs + + def _log_skipped_link(self, link, reason): +- # type: (Link, Text) -> None ++ # type: (Link, str) -> None + if link not in self._logged_links: + # Mark this as a unicode string to prevent "UnicodeEncodeError: + # 'ascii' codec can't encode character" in Python 2 when +@@ -761,9 +761,7 @@ def get_install_candidate(self, link_evaluator, link): + return InstallationCandidate( + name=link_evaluator.project_name, + link=link, +- # Convert the Text result to str since InstallationCandidate +- # accepts str. +- version=str(result), ++ version=result, + ) + + def evaluate_links(self, link_evaluator, links): +diff --git a/src/pip/_internal/models/link.py b/src/pip/_internal/models/link.py +index 4ad4f7bde9..194d68f84d 100644 +--- a/src/pip/_internal/models/link.py ++++ b/src/pip/_internal/models/link.py +@@ -14,7 +14,7 @@ + from pip._internal.utils.urls import path_to_url, url_to_path + + if MYPY_CHECK_RUNNING: +- from typing import Optional, Text, Tuple, Union ++ from typing import Optional, Tuple, Union + + from pip._internal.index.collector import HTMLPage + from pip._internal.utils.hashes import Hashes +@@ -38,7 +38,7 @@ def __init__( + url, # type: str + comes_from=None, # type: Optional[Union[str, HTMLPage]] + requires_python=None, # type: Optional[str] +- yanked_reason=None, # type: Optional[Text] ++ yanked_reason=None, # type: Optional[str] + cache_link_parsing=True, # type: bool + ): + # type: (...) -> None +diff --git a/src/pip/_internal/operations/build/wheel_legacy.py b/src/pip/_internal/operations/build/wheel_legacy.py +index 9da365e4dd..73401cd78c 100644 +--- a/src/pip/_internal/operations/build/wheel_legacy.py ++++ b/src/pip/_internal/operations/build/wheel_legacy.py +@@ -11,14 +11,14 @@ + from pip._internal.utils.typing import MYPY_CHECK_RUNNING + + if MYPY_CHECK_RUNNING: +- from typing import List, Optional, Text ++ from typing import List, Optional + + logger = logging.getLogger(__name__) + + + def format_command_result( + command_args, # type: List[str] +- command_output, # type: Text ++ command_output, # type: str + ): + # type: (...) -> str + """Format command information for logging.""" +@@ -42,7 +42,7 @@ def get_legacy_build_wheel_path( + temp_dir, # type: str + name, # type: str + command_args, # type: List[str] +- command_output, # type: Text ++ command_output, # type: str + ): + # type: (...) -> Optional[str] + """Return the path to the wheel in the temporary build directory.""" +diff --git a/src/pip/_internal/req/req_file.py b/src/pip/_internal/req/req_file.py +index 8c34bc149c..26055b4d6c 100644 +--- a/src/pip/_internal/req/req_file.py ++++ b/src/pip/_internal/req/req_file.py +@@ -156,7 +156,7 @@ def parse_requirements( + + + def preprocess(content): +- # type: (Text) -> ReqFileLines ++ # type: (str) -> ReqFileLines + """Split, filter, and join lines, and return a line iterator + + :param content: the content of the requirements file +@@ -396,7 +396,7 @@ def _parse_file(self, filename, constraint): + def get_line_parser(finder): + # type: (Optional[PackageFinder]) -> LineParser + def parse_line(line): +- # type: (Text) -> Tuple[str, Values] ++ # type: (str) -> Tuple[str, Values] + # Build new parser for each line since it accumulates appendable + # options. + parser = build_parser() +@@ -415,7 +415,7 @@ def parse_line(line): + + + def break_args_options(line): +- # type: (Text) -> Tuple[str, Text] ++ # type: (str) -> Tuple[str, str] + """Break up the line into an args and options string. We only want to shlex + (and then optparse) the options, not the args. args can contain markers + which are corrupted by shlex. +@@ -468,7 +468,7 @@ def join_lines(lines_enum): + comments). The joined line takes on the index of the first line. + """ + primary_line_number = None +- new_line = [] # type: List[Text] ++ new_line = [] # type: List[str] + for line_number, line in lines_enum: + if not line.endswith('\\') or COMMENT_RE.match(line): + if COMMENT_RE.match(line): +@@ -535,7 +535,7 @@ def expand_env_variables(lines_enum): + + + def get_file_content(url, session): +- # type: (str, PipSession) -> Tuple[str, Text] ++ # type: (str, PipSession) -> Tuple[str, str] + """Gets the content of a file; it may be a filename, file: URL, or + http: URL. Returns (location, content). Content is unicode. + Respects # -*- coding: declarations on the retrieved files. +diff --git a/src/pip/_internal/self_outdated_check.py b/src/pip/_internal/self_outdated_check.py +index a44c00cda6..8159412007 100644 +--- a/src/pip/_internal/self_outdated_check.py ++++ b/src/pip/_internal/self_outdated_check.py +@@ -18,7 +18,7 @@ + + if MYPY_CHECK_RUNNING: + import optparse +- from typing import Any, Dict, Text, Union ++ from typing import Any, Dict + + from pip._internal.network.session import PipSession + +@@ -30,7 +30,7 @@ + + + def _get_statefile_name(key): +- # type: (Union[str, Text]) -> str ++ # type: (str) -> str + key_bytes = ensure_binary(key) + name = hashlib.sha224(key_bytes).hexdigest() + return name +diff --git a/src/pip/_internal/utils/compat.py b/src/pip/_internal/utils/compat.py +index 31afee716f..cc8ecd0f68 100644 +--- a/src/pip/_internal/utils/compat.py ++++ b/src/pip/_internal/utils/compat.py +@@ -14,7 +14,7 @@ + from pip._internal.utils.typing import MYPY_CHECK_RUNNING + + if MYPY_CHECK_RUNNING: +- from typing import Callable, Optional, Protocol, Text, TypeVar, Union ++ from typing import Callable, Optional, Protocol, TypeVar, Union + + # Used in the @lru_cache polyfill. + F = TypeVar('F') +@@ -57,7 +57,7 @@ def has_tls(): + + + def str_to_display(data, desc=None): +- # type: (Union[bytes, Text], Optional[str]) -> Text ++ # type: (Union[bytes, str], Optional[str]) -> str + """ + For display or logging purposes, convert a bytes object (or text) to + text (e.g. unicode in Python 2) safe for output. +@@ -124,7 +124,7 @@ def str_to_display(data, desc=None): + + + def console_to_str(data): +- # type: (bytes) -> Text ++ # type: (bytes) -> str + """Return a string, safe for output, of subprocess output. + """ + return str_to_display(data, desc='Subprocess output') +diff --git a/src/pip/_internal/utils/encoding.py b/src/pip/_internal/utils/encoding.py +index 42a57535af..7df6798784 100644 +--- a/src/pip/_internal/utils/encoding.py ++++ b/src/pip/_internal/utils/encoding.py +@@ -6,7 +6,7 @@ + from pip._internal.utils.typing import MYPY_CHECK_RUNNING + + if MYPY_CHECK_RUNNING: +- from typing import List, Text, Tuple ++ from typing import List, Tuple + + BOMS = [ + (codecs.BOM_UTF8, 'utf-8'), +@@ -16,13 +16,13 @@ + (codecs.BOM_UTF32, 'utf-32'), + (codecs.BOM_UTF32_BE, 'utf-32-be'), + (codecs.BOM_UTF32_LE, 'utf-32-le'), +-] # type: List[Tuple[bytes, Text]] ++] # type: List[Tuple[bytes, str]] + + ENCODING_RE = re.compile(br'coding[:=]\s*([-\w.]+)') + + + def auto_decode(data): +- # type: (bytes) -> Text ++ # type: (bytes) -> str + """Check a bytes string for a BOM to correctly detect the encoding + + Fallback to locale.getpreferredencoding(False) like open() on Python3""" +diff --git a/src/pip/_internal/utils/misc.py b/src/pip/_internal/utils/misc.py +index 604494e0c9..c3d969eb22 100644 +--- a/src/pip/_internal/utils/misc.py ++++ b/src/pip/_internal/utils/misc.py +@@ -46,10 +46,8 @@ + Iterator, + List, + Optional, +- Text, + Tuple, + TypeVar, +- Union, + ) + + from pip._vendor.pkg_resources import Distribution +@@ -155,7 +153,7 @@ def rmtree_errorhandler(func, path, exc_info): + + + def path_to_display(path): +- # type: (Optional[Union[str, Text]]) -> Optional[Text] ++ # type: (Optional[str]) -> Optional[str] + """ + Convert a bytes (or text) path to text (unicode in Python 2) for display + and logging purposes. +@@ -181,7 +179,7 @@ def path_to_display(path): + + + def display_path(path): +- # type: (Union[str, Text]) -> str ++ # type: (str) -> str + """Gives the display value for a given path, making it relative to cwd + if possible.""" + path = os.path.normcase(os.path.abspath(path)) +@@ -885,7 +883,7 @@ def is_console_interactive(): + + + def hash_file(path, blocksize=1 << 20): +- # type: (Text, int) -> Tuple[Any, int] ++ # type: (str, int) -> Tuple[Any, int] + """Return (hash, length) for path using hashlib.sha256() + """ + +diff --git a/src/pip/_internal/utils/subprocess.py b/src/pip/_internal/utils/subprocess.py +index 4a5cce469d..25c9020699 100644 +--- a/src/pip/_internal/utils/subprocess.py ++++ b/src/pip/_internal/utils/subprocess.py +@@ -11,7 +11,7 @@ + from pip._internal.utils.typing import MYPY_CHECK_RUNNING + + if MYPY_CHECK_RUNNING: +- from typing import Any, Callable, Iterable, List, Mapping, Optional, Text, Union ++ from typing import Any, Callable, Iterable, List, Mapping, Optional, Union + + CommandArgs = List[Union[str, HiddenText]] + +@@ -66,10 +66,10 @@ def reveal_command_args(args): + def make_subprocess_output_error( + cmd_args, # type: Union[List[str], CommandArgs] + cwd, # type: Optional[str] +- lines, # type: List[Text] ++ lines, # type: List[str] + exit_status, # type: int + ): +- # type: (...) -> Text ++ # type: (...) -> str + """ + Create and return the error message to use to log a subprocess error + with command output. +@@ -117,7 +117,7 @@ def call_subprocess( + spinner=None, # type: Optional[SpinnerInterface] + log_failed_cmd=True # type: Optional[bool] + ): +- # type: (...) -> Text ++ # type: (...) -> str + """ + Args: + show_stdout: if true, use INFO to log the subprocess's stderr and +diff --git a/src/pip/_internal/utils/unpacking.py b/src/pip/_internal/utils/unpacking.py +index fbfa8f5067..5cfba87f81 100644 +--- a/src/pip/_internal/utils/unpacking.py ++++ b/src/pip/_internal/utils/unpacking.py +@@ -19,7 +19,7 @@ + from pip._internal.utils.typing import MYPY_CHECK_RUNNING + + if MYPY_CHECK_RUNNING: +- from typing import Iterable, List, Optional, Text, Union ++ from typing import Iterable, List, Optional + from zipfile import ZipInfo + + +@@ -51,7 +51,7 @@ def current_umask(): + + + def split_leading_dir(path): +- # type: (Union[str, Text]) -> List[Union[str, Text]] ++ # type: (str) -> List[str] + path = path.lstrip('/').lstrip('\\') + if ( + '/' in path and ( +@@ -67,7 +67,7 @@ def split_leading_dir(path): + + + def has_leading_dir(paths): +- # type: (Iterable[Union[str, Text]]) -> bool ++ # type: (Iterable[str]) -> bool + """Returns true if all the paths have the same leading path name + (i.e., everything is in one subdirectory in an archive)""" + common_prefix = None +@@ -83,7 +83,7 @@ def has_leading_dir(paths): + + + def is_within_directory(directory, target): +- # type: ((Union[str, Text]), (Union[str, Text])) -> bool ++ # type: (str, str) -> bool + """ + Return true if the absolute path of target is within the directory + """ +@@ -95,7 +95,7 @@ def is_within_directory(directory, target): + + + def set_extracted_file_to_default_mode_plus_executable(path): +- # type: (Union[str, Text]) -> None ++ # type: (str) -> None + """ + Make file present at path have execute for user/group/world + (chmod +x) is no-op on windows per python docs +diff --git a/src/pip/_internal/utils/urls.py b/src/pip/_internal/utils/urls.py +index 91df4c30d8..5754153f21 100644 +--- a/src/pip/_internal/utils/urls.py ++++ b/src/pip/_internal/utils/urls.py +@@ -6,18 +6,18 @@ + from pip._internal.utils.typing import MYPY_CHECK_RUNNING + + if MYPY_CHECK_RUNNING: +- from typing import Optional, Text, Union ++ from typing import Optional + + + def get_url_scheme(url): +- # type: (Union[str, Text]) -> Optional[Text] ++ # type: (str) -> Optional[str] + if ':' not in url: + return None + return url.split(':', 1)[0].lower() + + + def path_to_url(path): +- # type: (Union[str, Text]) -> str ++ # type: (str) -> str + """ + Convert a path to a file: URL. The path will be made absolute and have + quoted path parts. +diff --git a/src/pip/_internal/vcs/versioncontrol.py b/src/pip/_internal/vcs/versioncontrol.py +index 48465ec8df..3500d1690a 100644 +--- a/src/pip/_internal/vcs/versioncontrol.py ++++ b/src/pip/_internal/vcs/versioncontrol.py +@@ -39,7 +39,6 @@ + List, + Mapping, + Optional, +- Text, + Tuple, + Type, + Union, +@@ -58,7 +57,7 @@ + + + def is_url(name): +- # type: (Union[str, Text]) -> bool ++ # type: (str) -> bool + """ + Return true if the name looks like a URL. + """ +@@ -92,7 +91,7 @@ def call_subprocess( + extra_ok_returncodes=None, # type: Optional[Iterable[int]] + log_failed_cmd=True # type: Optional[bool] + ): +- # type: (...) -> Text ++ # type: (...) -> str + """ + Args: + extra_ok_returncodes: an iterable of integer return codes that are +@@ -764,7 +763,7 @@ def run_command( + extra_ok_returncodes=None, # type: Optional[Iterable[int]] + log_failed_cmd=True # type: bool + ): +- # type: (...) -> Text ++ # type: (...) -> str + """ + Run a VCS subcommand + This is simply a wrapper around call_subprocess that adds the VCS +diff --git a/tests/lib/certs.py b/tests/lib/certs.py +index 7d86ee4c04..1f51f2174c 100644 +--- a/tests/lib/certs.py ++++ b/tests/lib/certs.py +@@ -9,11 +9,11 @@ + from pip._internal.utils.typing import MYPY_CHECK_RUNNING + + if MYPY_CHECK_RUNNING: +- from typing import Text, Tuple ++ from typing import Tuple + + + def make_tls_cert(hostname): +- # type: (Text) -> Tuple[x509.Certificate, rsa.RSAPrivateKey] ++ # type: (str) -> Tuple[x509.Certificate, rsa.RSAPrivateKey] + key = rsa.generate_private_key( + public_exponent=65537, + key_size=2048, +diff --git a/tests/lib/server.py b/tests/lib/server.py +index bc8ffb7eb5..add3fd5621 100644 +--- a/tests/lib/server.py ++++ b/tests/lib/server.py +@@ -14,18 +14,7 @@ + + if MYPY_CHECK_RUNNING: + from types import TracebackType +- from typing import ( +- Any, +- Callable, +- Dict, +- Iterable, +- List, +- Optional, +- Text, +- Tuple, +- Type, +- Union, +- ) ++ from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Type + + from werkzeug.serving import BaseWSGIServer + +@@ -166,7 +155,7 @@ def server_running(server): + + + def text_html_response(text): +- # type: (Text) -> Responder ++ # type: (str) -> Responder + def responder(environ, start_response): + # type: (Environ, StartResponse) -> Body + start_response("200 OK", [ +@@ -178,7 +167,7 @@ def responder(environ, start_response): + + + def html5_page(text): +- # type: (Union[Text, str]) -> Text ++ # type: (str) -> str + return dedent(u""" + + diff --git a/python-pip.spec b/python-pip.spec index 3d035b59a33f24b5c58f6925acf4d9cb6a79f840..f7de2ab03cd60d02d22326049f16f2619e8f5f7e 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,7 @@ 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: 1e558d7c1dac02f148499e79d932fefbe636b4e6.patch Source10: pip-allow-older-versions.patch %description %{_description} @@ -112,6 +113,9 @@ install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir} %{python_wheeldir}/%{python_wheelname} %changelog +* 20201225185849754344 patch-tracking 20.2.2-4 +- append patch file of upstream repository from <1e558d7c1dac02f148499e79d932fefbe636b4e6> to <1e558d7c1dac02f148499e79d932fefbe636b4e6> + * Wed Nov 4 2020 wangjie -20.2.2-3 - Type:NA - ID:NA @@ -161,4 +165,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