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

Wrong recommendation to install types-backports #14841

Closed
JelleZijlstra opened this issue Mar 6, 2023 · 0 comments · Fixed by #14842
Closed

Wrong recommendation to install types-backports #14841

JelleZijlstra opened this issue Mar 6, 2023 · 0 comments · Fixed by #14842
Labels
bug mypy got something wrong

Comments

@JelleZijlstra
Copy link
Member

JelleZijlstra commented Mar 6, 2023

When I import backports.zoneinfo, I get

src/test_checks.py:29:1: error: Library stubs not installed for "backports.zoneinfo"  [import]
src/test_checks.py:29:1: note: Hint: "python3 -m pip install types-backports"
src/test_checks.py:29:1: note: (or run "mypy --install-types" to install all missing stub packages)
src/test_checks.py:29:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

However, the types-backports package is obsolete since python/typeshed#5997; it was replaced with types-backports.ssl_match_hostname. It never provided stubs for backports.zoneinfo (which is a py.typed package and doesn't need stubs), only for ssl_match_hostname.

backports.ssl_match_hostname provides a 3.7+ feature (https://pypi.org/project/backports.ssl_match_hostname/), so it isn't relevant on any supported version of Python and I don't think mypy needs to recommend installing it. I will submit a PR to remove it from the list of recommended packages.

@JelleZijlstra JelleZijlstra added the bug mypy got something wrong label Mar 6, 2023
hauntsaninja pushed a commit that referenced this issue Mar 6, 2023
Fixes #14841.

`types-backports` is obsolete and leads to incorrect suggestions; see
the issue.

`types-backports_abc` was removed from typeshed in python/typeshed#7533.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant