diff --git a/twine/package.py b/twine/package.py index 6e00b884..70a9eea4 100644 --- a/twine/package.py +++ b/twine/package.py @@ -27,6 +27,18 @@ from twine import sdist from twine import wheel +# Monkeypatch Metadata 2.0 support +metadata._VALID_METADATA_VERSIONS = [ + "1.0", + "1.1", + "1.2", + "2.0", + "2.1", + "2.2", + "2.3", + "2.4", +] + DIST_TYPES = { "bdist_wheel": wheel.Wheel, "sdist": sdist.SDist, diff --git a/twine/wheel.py b/twine/wheel.py index a5d2102d..82823159 100644 --- a/twine/wheel.py +++ b/twine/wheel.py @@ -16,15 +16,9 @@ import zipfile from typing import List -import packaging.metadata - from twine import distribution from twine import exceptions -# Monkeypatch Metadata 2.0 support -packaging.metadata._VALID_METADATA_VERSIONS = ["1.0", "1.1", "1.2", "2.0", "2.1", "2.2", "2.3", "2.4"] - - wheel_file_re = re.compile( r"""^(?P(?P.+?)(-(?P\d.+?))?) ((-(?P\d.*?))?-(?P.+?)-(?P.+?)-(?P.+?)