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

Silence mypy errors related to importlib_metadata #988

Merged
merged 1 commit into from
Apr 27, 2023

Conversation

bhrutledge
Copy link
Contributor

I haven't dug into this, but I'm guessing recent versions of mypy and/or importlib_metadata caused these new errors:

twine/package.py:127: error: Unused "type: ignore" comment
twine/cli.py:81: error: Unused "type: ignore" comment
twine/cli.py:121: error: Call to untyped function "load" in typed context  [no-untyped-call]

@bhrutledge bhrutledge requested a review from jaraco April 27, 2023 10:30
@bhrutledge bhrutledge enabled auto-merge (squash) April 27, 2023 10:30
@bhrutledge bhrutledge merged commit 7c8d616 into pypa:main Apr 27, 2023
19 checks passed
@@ -118,6 +118,6 @@ def dispatch(argv: List[str]) -> Any:

configure_output()

main = registered_commands[args.command].load()
main = registered_commands[args.command].load() # type: ignore[no-untyped-call] # python/importlib_metadata#288 # noqa: E501
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI - importlib_metadata isn't tracking this issue any longer. Moreover, I'm not sure if importlib metadata were to supply a return type here that it would be compatible with the assumption that it's a callable. Probably a cast(Callable, ...) should be employed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants