diff --git a/src/pip/_vendor/pkg_resources/__init__.py b/src/pip/_vendor/pkg_resources/__init__.py index 89f49570f4a..8801afab168 100644 --- a/src/pip/_vendor/pkg_resources/__init__.py +++ b/src/pip/_vendor/pkg_resources/__init__.py @@ -101,12 +101,10 @@ _namespace_packages = None -warnings.warn( - "pkg_resources is deprecated as an API. " - "See https://setuptools.pypa.io/en/latest/pkg_resources.html", - DeprecationWarning, - stacklevel=2, -) +# Patch: Remove deprecation warning from vendored pkg_resources. +# Setting PYTHONWARNINGS=error to verify builds produce no warnings +# causes immediate exceptions. +# See https://github.com/pypa/pip/issues/12243 _PEP440_FALLBACK = re.compile(r"^v?(?P(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*)", re.I)