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

Filter unnecessary deps from User-Agent string #871

Merged
merged 5 commits into from Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
4 changes: 2 additions & 2 deletions setup.cfg
Expand Up @@ -37,12 +37,12 @@ packages =
python_requires = >=3.6
install_requires=
pkginfo >= 1.8.1
readme_renderer >= 21.0
readme-renderer >= 21.0
requests >= 2.20
requests-toolbelt >= 0.8.0, != 0.9.0
urllib3 >= 1.26.0
tqdm >= 4.14
importlib_metadata >= 3.6
importlib-metadata >= 3.6
keyring >= 15.1
rfc3986 >= 1.4.0
rich
Expand Down
2 changes: 1 addition & 1 deletion tests/test_repository.py
Expand Up @@ -94,7 +94,7 @@ def test_make_user_agent_string(default_repo):
"requests/",
"requests-toolbelt/",
"pkginfo/",
"importlib_metadata/",
"importlib-metadata/",
)
assert all(p in user_agent for p in packages)

Expand Down
10 changes: 7 additions & 3 deletions twine/cli.py
Expand Up @@ -20,7 +20,6 @@
import rich.highlighter
import rich.logging
import rich.theme
from packaging import requirements

import twine

Expand Down Expand Up @@ -71,8 +70,13 @@ def configure_output() -> None:


def list_dependencies_and_versions() -> List[Tuple[str, str]]:
requires = importlib_metadata.requires("twine") # type: ignore[no-untyped-call] # python/importlib_metadata#288 # noqa: E501
deps = [requirements.Requirement(r).name for r in requires]
deps = (
"importlib-metadata",
"pkginfo",
"requests",
"requests-toolbelt",
"tqdm",
bhrutledge marked this conversation as resolved.
Show resolved Hide resolved
)
return [(dep, importlib_metadata.version(dep)) for dep in deps] # type: ignore[no-untyped-call] # python/importlib_metadata#288 # noqa: E501


Expand Down