diff --git a/changelog.d/2497.change.rst b/changelog.d/2497.change.rst new file mode 100644 index 00000000000..91d840f7a77 --- /dev/null +++ b/changelog.d/2497.change.rst @@ -0,0 +1 @@ +Officially deprecated PEP 440 non-compliant versions. diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index c84f1dd9e89..3aafe6525c3 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -113,6 +113,11 @@ def parse_version(v): try: return packaging.version.Version(v) except packaging.version.InvalidVersion: + warnings.warn( + f"{v} is an invalid version and will not be supported in " + "a future release", + PkgResourcesDeprecationWarning, + ) return packaging.version.LegacyVersion(v) diff --git a/pytest.ini b/pytest.ini index bdcab1bffb8..2678afd8466 100644 --- a/pytest.ini +++ b/pytest.ini @@ -31,3 +31,6 @@ filterwarnings= # https://github.com/pypa/setuptools/issues/917 ignore:setup.py install is deprecated. ignore:easy_install command is deprecated. + + # https://github.com/pypa/setuptools/issues/2497 + ignore:.* is an invalid version and will not be supported::pkg_resources