diff --git a/twine/__init__.py b/twine/__init__.py index 6af4d39..339c1f8 100644 --- a/twine/__init__.py +++ b/twine/__init__.py @@ -29,9 +29,9 @@ __all__ = ( __copyright__ = "Copyright 2019 Donald Stufft and individual contributors" -import importlib_metadata +import importlib.metadata -metadata = importlib_metadata.metadata("twine") +metadata = importlib.metadata.metadata("twine") __title__ = metadata["name"] diff --git a/twine/cli.py b/twine/cli.py index 48f1450..f5092d0 100644 --- a/twine/cli.py +++ b/twine/cli.py @@ -15,7 +15,7 @@ import argparse import logging.config from typing import Any, List, Tuple -import importlib_metadata +import importlib.metadata import rich import rich.highlighter import rich.logging @@ -78,7 +78,7 @@ def list_dependencies_and_versions() -> List[Tuple[str, str]]: "requests-toolbelt", "urllib3", ) - return [(dep, importlib_metadata.version(dep)) for dep in deps] # type: ignore[no-untyped-call] # python/importlib_metadata#288 # noqa: E501 + return [(dep, importlib.metadata.version(dep)) for dep in deps] # type: ignore[no-untyped-call] # python/importlib.metadata#288 # noqa: E501 def dep_versions() -> str: @@ -88,7 +88,7 @@ def dep_versions() -> str: def dispatch(argv: List[str]) -> Any: - registered_commands = importlib_metadata.entry_points( + registered_commands = importlib.metadata.entry_points( group="twine.registered_commands" ) diff --git a/twine/package.py b/twine/package.py index 3ca074f..f7d429f 100644 --- a/twine/package.py +++ b/twine/package.py @@ -19,7 +19,7 @@ import re import subprocess from typing import Dict, NamedTuple, Optional, Sequence, Tuple, Union -import importlib_metadata +import importlib.metadata import pkginfo from rich import print @@ -124,7 +124,7 @@ class PackageFile: py_version: Optional[str] if dtype == "bdist_egg": - (dist,) = importlib_metadata.Distribution.discover( # type: ignore[no-untyped-call] # python/importlib_metadata#288 # noqa: E501 + (dist,) = importlib.metadata.Distribution.discover( # type: ignore[no-untyped-call] # python/importlib.metadata#288 # noqa: E501 path=[filename] ) py_version = dist.metadata["Version"]