From a93e4a3bd76cd0f694163893d046a56afaa3c883 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Sun, 7 Aug 2022 18:09:17 -0400 Subject: [PATCH] Vendoring in pip 22.2.2 --- pipenv/patched/patched.txt | 2 +- pipenv/patched/pip/__init__.py | 2 +- pipenv/patched/pip/__pip-runner__.py | 1 - pipenv/patched/pip/_internal/index/collector.py | 1 + pipenv/patched/pip/_internal/locations/__init__.py | 14 ++++++-------- .../patched/pip/_internal/locations/_distutils.py | 2 +- pipenv/patched/pip/_internal/utils/deprecation.py | 2 +- 7 files changed, 11 insertions(+), 13 deletions(-) diff --git a/pipenv/patched/patched.txt b/pipenv/patched/patched.txt index 1163d1ee..2afe82f8 100644 --- a/pipenv/patched/patched.txt +++ b/pipenv/patched/patched.txt @@ -1,3 +1,3 @@ -pip==22.2.1 +pip==22.2.2 pipfile==0.0.2 safety==1.10.3 diff --git a/pipenv/patched/pip/__init__.py b/pipenv/patched/pip/__init__.py index 87bff02d..1a7e43e1 100644 --- a/pipenv/patched/pip/__init__.py +++ b/pipenv/patched/pip/__init__.py @@ -1,6 +1,6 @@ from typing import List, Optional -__version__ = "22.2.1" +__version__ = "22.2.2" def main(args: Optional[List[str]] = None) -> int: diff --git a/pipenv/patched/pip/__pip-runner__.py b/pipenv/patched/pip/__pip-runner__.py index 280e99f2..14026c0d 100644 --- a/pipenv/patched/pip/__pip-runner__.py +++ b/pipenv/patched/pip/__pip-runner__.py @@ -30,7 +30,6 @@ class PipImportRedirectingFinder: return spec -# TODO https://github.com/pypa/pip/issues/11294 sys.meta_path.insert(0, PipImportRedirectingFinder()) assert __name__ == "__main__", "Cannot run __pip-runner__.py as a non-main module" diff --git a/pipenv/patched/pip/_internal/index/collector.py b/pipenv/patched/pip/_internal/index/collector.py index 280edc34..596a9d69 100644 --- a/pipenv/patched/pip/_internal/index/collector.py +++ b/pipenv/patched/pip/_internal/index/collector.py @@ -345,6 +345,7 @@ def parse_links(page: "IndexContent") -> Iterable[Link]: yanked_reason=yanked_reason, hashes=file.get("hashes", {}), ) + return parser = HTMLLinkParser(page.url) encoding = page.encoding or "utf-8" diff --git a/pipenv/patched/pip/_internal/locations/__init__.py b/pipenv/patched/pip/_internal/locations/__init__.py index c37d55f7..23eaea64 100644 --- a/pipenv/patched/pip/_internal/locations/__init__.py +++ b/pipenv/patched/pip/_internal/locations/__init__.py @@ -60,6 +60,12 @@ def _should_use_sysconfig() -> bool: _USE_SYSCONFIG = _should_use_sysconfig() +if not _USE_SYSCONFIG: + # Import distutils lazily to avoid deprecation warnings, + # but import it soon enough that it is in memory and available during + # a pip reinstall. + from . import _distutils + # Be noisy about incompatibilities if this platforms "should" be using # sysconfig, but is explicitly opting out and using distutils instead. if _USE_SYSCONFIG_DEFAULT and not _USE_SYSCONFIG: @@ -241,8 +247,6 @@ def get_scheme( if _USE_SYSCONFIG: return new - from . import _distutils - old = _distutils.get_scheme( dist_name, user=user, @@ -407,8 +411,6 @@ def get_bin_prefix() -> str: if _USE_SYSCONFIG: return new - from . import _distutils - old = _distutils.get_bin_prefix() if _warn_if_mismatch(pathlib.Path(old), pathlib.Path(new), key="bin_prefix"): _log_context() @@ -442,8 +444,6 @@ def get_purelib() -> str: if _USE_SYSCONFIG: return new - from . import _distutils - old = _distutils.get_purelib() if _looks_like_deb_system_dist_packages(old): return old @@ -488,8 +488,6 @@ def get_prefixed_libs(prefix: str) -> List[str]: if _USE_SYSCONFIG: return _deduplicated(new_pure, new_plat) - from . import _distutils - old_pure, old_plat = _distutils.get_prefixed_libs(prefix) old_lib_paths = _deduplicated(old_pure, old_plat) diff --git a/pipenv/patched/pip/_internal/locations/_distutils.py b/pipenv/patched/pip/_internal/locations/_distutils.py index b2d5da00..a708e145 100644 --- a/pipenv/patched/pip/_internal/locations/_distutils.py +++ b/pipenv/patched/pip/_internal/locations/_distutils.py @@ -11,7 +11,7 @@ # rationale for why this is done within pip. try: __import__("_distutils_hack").remove_shim() -except ImportError: +except (ImportError, AttributeError): pass import logging diff --git a/pipenv/patched/pip/_internal/utils/deprecation.py b/pipenv/patched/pip/_internal/utils/deprecation.py index a70d4910..fc442411 100644 --- a/pipenv/patched/pip/_internal/utils/deprecation.py +++ b/pipenv/patched/pip/_internal/utils/deprecation.py @@ -13,7 +13,7 @@ from pipenv.patched.pip import __version__ as current_version # NOTE: tests pat DEPRECATION_MSG_PREFIX = "DEPRECATION: " -class PipDeprecationWarning(DeprecationWarning): +class PipDeprecationWarning(Warning): pass