Skip to content

Commit

Permalink
Filter out unnecessary dependencies from User-Agent string
Browse files Browse the repository at this point in the history
See: #870
  • Loading branch information
stefanor committed Feb 9, 2022
1 parent d405a06 commit 01c15aa
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion twine/repository.py
Expand Up @@ -89,8 +89,16 @@ def _make_adapter_with_retries() -> adapters.HTTPAdapter:
@staticmethod
def _make_user_agent_string() -> str:
from twine import cli
ignored_dependencies = {
'SecretStorage', 'bleach', 'colorama', 'keyring', 'readme-renderer',
'rich', 'tqdm',
}

dependencies = cli.list_dependencies_and_versions()
dependencies = [
(dep, version)
for (dep, version) in cli.list_dependencies_and_versions()
if dep not in ignored_dependencies
]
user_agent_string = (
user_agent.UserAgentBuilder("twine", twine.__version__)
.include_extras(dependencies)
Expand Down

0 comments on commit 01c15aa

Please sign in to comment.