diff --git a/7b3682c9236713b5aec7b8ee52b181e2734084c6.patch b/7b3682c9236713b5aec7b8ee52b181e2734084c6.patch new file mode 100644 index 0000000000000000000000000000000000000000..7eb9a534cf490f38e37a9a1ff2762f5b6c845d4b --- /dev/null +++ b/7b3682c9236713b5aec7b8ee52b181e2734084c6.patch @@ -0,0 +1,120 @@ +diff --git a/setup.cfg b/setup.cfg +index 84a959a32d..c28a167bd5 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -42,6 +42,7 @@ follow_imports = silent + ignore_missing_imports = True + disallow_untyped_defs = True + disallow_any_generics = True ++warn_unused_ignores = True + + [mypy-pip/_vendor/*] + follow_imports = skip +diff --git a/src/pip/_internal/cli/main_parser.py b/src/pip/_internal/cli/main_parser.py +index ba3cf68aaf..6d69e82f0c 100644 +--- a/src/pip/_internal/cli/main_parser.py ++++ b/src/pip/_internal/cli/main_parser.py +@@ -68,7 +68,7 @@ def parse_command(args): + + # --version + if general_options.version: +- sys.stdout.write(parser.version) # type: ignore ++ sys.stdout.write(parser.version) + sys.stdout.write(os.linesep) + sys.exit() + +diff --git a/src/pip/_internal/commands/debug.py b/src/pip/_internal/commands/debug.py +index 1b65c43065..9b9808e62f 100644 +--- a/src/pip/_internal/commands/debug.py ++++ b/src/pip/_internal/commands/debug.py +@@ -36,12 +36,7 @@ def show_value(name, value): + def show_sys_implementation(): + # type: () -> None + logger.info('sys.implementation:') +- if hasattr(sys, 'implementation'): +- implementation = sys.implementation # type: ignore +- implementation_name = implementation.name +- else: +- implementation_name = '' +- ++ implementation_name = sys.implementation.name + with indent_log(): + show_value('name', implementation_name) + +@@ -88,13 +83,7 @@ def get_vendor_version_from_module(module_name): + + if not version: + # Try to find version in debundled module info +- # The type for module.__file__ is Optional[str] in +- # Python 2, and str in Python 3. The type: ignore is +- # added to account for Python 2, instead of a cast +- # and should be removed once we drop Python 2 support +- pkg_set = pkg_resources.WorkingSet( +- [os.path.dirname(module.__file__)] # type: ignore +- ) ++ pkg_set = pkg_resources.WorkingSet([os.path.dirname(module.__file__)]) + package = pkg_set.find(pkg_resources.Requirement.parse(module_name)) + version = getattr(package, 'version', None) + +diff --git a/src/pip/_internal/operations/install/wheel.py b/src/pip/_internal/operations/install/wheel.py +index 7b7d48661c..a439dffa9f 100644 +--- a/src/pip/_internal/operations/install/wheel.py ++++ b/src/pip/_internal/operations/install/wheel.py +@@ -92,8 +92,7 @@ def rehash(path, blocksize=1 << 20): + digest = 'sha256=' + urlsafe_b64encode( + h.digest() + ).decode('latin1').rstrip('=') +- # unicode/str python2 issues +- return (digest, str(length)) # type: ignore ++ return (digest, str(length)) + + + def csv_io_kwargs(mode): +diff --git a/src/pip/_internal/req/req_file.py b/src/pip/_internal/req/req_file.py +index ae891ce7aa..4b86eac801 100644 +--- a/src/pip/_internal/req/req_file.py ++++ b/src/pip/_internal/req/req_file.py +@@ -409,9 +409,7 @@ def parse_line(line): + + args_str, options_str = break_args_options(line) + +- # https://github.com/python/mypy/issues/1174 +- opts, _ = parser.parse_args( +- shlex.split(options_str), defaults) # type: ignore ++ opts, _ = parser.parse_args(shlex.split(options_str), defaults) + + return args_str, opts + +@@ -433,7 +431,7 @@ def break_args_options(line): + else: + args.append(token) + options.pop(0) +- return ' '.join(args), ' '.join(options) # type: ignore ++ return ' '.join(args), ' '.join(options) + + + class OptionParsingError(Exception): +diff --git a/src/pip/_internal/utils/unpacking.py b/src/pip/_internal/utils/unpacking.py +index 620f31ebb7..b1c2bc3a47 100644 +--- a/src/pip/_internal/utils/unpacking.py ++++ b/src/pip/_internal/utils/unpacking.py +@@ -192,8 +192,7 @@ def untar_file(filename, location): + for member in tar.getmembers(): + fn = member.name + if leading: +- # https://github.com/python/mypy/issues/1174 +- fn = split_leading_dir(fn)[1] # type: ignore ++ fn = split_leading_dir(fn)[1] + path = os.path.join(location, fn) + if not is_within_directory(location, path): + message = ( +@@ -234,8 +233,7 @@ def untar_file(filename, location): + shutil.copyfileobj(fp, destfp) + fp.close() + # Update the timestamp (useful for cython compiled files) +- # https://github.com/python/typeshed/issues/2673 +- tar.utime(member, path) # type: ignore ++ tar.utime(member, path) + # member have any execute permissions for user/group/world? + if member.mode & 0o111: + set_extracted_file_to_default_mode_plus_executable(path) diff --git a/python-pip.spec b/python-pip.spec index 3d035b59a33f24b5c58f6925acf4d9cb6a79f840..9a571b78c9cd243457e7c633d49ed2d1f81d2c63 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: 7b3682c9236713b5aec7b8ee52b181e2734084c6.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 +* 20201224165849756204 patch-tracking 20.2.2-4 +- append patch file of upstream repository from <7b3682c9236713b5aec7b8ee52b181e2734084c6> to <7b3682c9236713b5aec7b8ee52b181e2734084c6> + * 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