diff --git a/no-version-warning.patch b/no-version-warning.patch new file mode 100644 index 0000000..6d7268f --- /dev/null +++ b/no-version-warning.patch @@ -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 diff --git a/python-pip.spec b/python-pip.spec index 4f48bbe..66e9315 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -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.