diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2021-11-15 17:51:21 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2021-11-15 17:51:21 -0500 |
commit | aeb641a57f19ed223d8249ae273408eda0a94762 (patch) | |
tree | 76167ecfc55259fbc531a4ee81813e6d63fa0ce1 | |
parent | e841867c98ff19811aaa85c3b131152958ccc129 (diff) | |
download | python-setuptools-git-aeb641a57f19ed223d8249ae273408eda0a94762.tar.gz |
Update config.ConfigMetadataHandler._parse_version not to rely on LegacyVersion.
-rw-r--r-- | setuptools/config.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/setuptools/config.py b/setuptools/config.py index e3e44c25..b4e968e5 100644 --- a/setuptools/config.py +++ b/setuptools/config.py @@ -13,7 +13,7 @@ from glob import iglob import contextlib from distutils.errors import DistutilsOptionError, DistutilsFileError -from setuptools.extern.packaging.version import LegacyVersion, parse +from setuptools.extern.packaging.version import Version, InvalidVersion from setuptools.extern.packaging.specifiers import SpecifierSet @@ -585,7 +585,9 @@ class ConfigMetadataHandler(ConfigHandler): version = version.strip() # Be strict about versions loaded from file because it's easy to # accidentally include newlines and other unintended content - if isinstance(parse(version), LegacyVersion): + try: + Version(version) + except InvalidVersion: tmpl = ( 'Version loaded from {value} does not ' 'comply with PEP 440: {version}' |