Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer importlib_metadata for entrypoint parsing. #728

Merged
merged 4 commits into from Feb 21, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions twine/cli.py
Expand Up @@ -14,7 +14,6 @@
import argparse
from typing import Any, Dict, List, Tuple

import pkg_resources
import pkginfo
import requests
import requests_toolbelt
Expand All @@ -23,15 +22,15 @@

import twine
from twine import _installed
from twine import importlib_metadata

args = argparse.Namespace()


def _registered_commands(
group: str = "twine.registered_commands",
) -> Dict[str, pkg_resources.EntryPoint]:
registered_commands = pkg_resources.iter_entry_points(group=group)
return {c.name: c for c in registered_commands}
) -> Dict[str, importlib_metadata.EntryPoint]:
return dict(importlib_metadata.entry_points()[group])
jaraco marked this conversation as resolved.
Show resolved Hide resolved


def list_dependencies_and_versions() -> List[Tuple[str, str]]:
Expand Down