Remove DeprecationWarning about LegacyVersion

This commit is contained in:
Petr Viktorin 2020-12-16 21:36:25 +01:00
parent 05d68e041f
commit cae1e54349
2 changed files with 20 additions and 0 deletions

15
no-version-warning.patch Normal file
View File

@ -0,0 +1,15 @@
diff -rU3 pip-20.3-orig/src/pip/_vendor/packaging/version.py pip-20.3/src/pip/_vendor/packaging/version.py
--- pip-20.3-orig/src/pip/_vendor/packaging/version.py 2020-11-30 12:58:32.000000000 +0100
+++ pip-20.3/src/pip/_vendor/packaging/version.py 2020-12-16 21:25:15.818221608 +0100
@@ -124,11 +124,6 @@
self._version = str(version)
self._key = _legacy_cmpkey(self._version)
- warnings.warn(
- "Creating a LegacyVersion has been deprecated and will be "
- "removed in the next major release",
- DeprecationWarning,
- )
def __str__(self):
# type: () -> str

View File

@ -88,6 +88,11 @@ Patch4: dummy-certifi.patch
# this warning is juts moot. Also, the warning breaks CPython test suite.
Patch5: nowarn-pip._internal.main.patch
# Don't warn the user about packaging's LegacyVersion being deprecated.
# (This also breaks Python's test suite when warnings are treated as errors.)
# Upstream issue: https://github.com/pypa/packaging/issues/368
Patch6: no-version-warning.patch
# Downstream only patch
# Users might have local installations of pip from using
# `pip install --user --upgrade pip` on older/newer versions.