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

types-openssl-python does not contain stubs? #5593

Closed
tpazderka opened this issue Jun 8, 2021 · 6 comments
Closed

types-openssl-python does not contain stubs? #5593

tpazderka opened this issue Jun 8, 2021 · 6 comments
Labels
project: infrastructure typeshed build, test, documentation, or distribution related

Comments

@tpazderka
Copy link

Running mypy --install-types on a project containing import OpenSSL.crypto suggests installing types-openssl-python but installing this package does not resolve the issue.

Ona repeated run, I still get the following error and hint.

error: Library stubs not installed for "OpenSSL.crypto" (or incompatible with Python 3.8)
note: Hint: "python3 -m pip install types-openssl-python"
note: (or run "mypy --install-types" to install all missing stub packages)
@JelleZijlstra
Copy link
Member

The stubs for that library appear to be Python 2-only (https://github.com/python/typeshed/blob/master/stubs/openssl-python/METADATA.toml). Are you running on Python 3?

If that's the issue, mypy shouldn't suggest installing them on Python 3.

@tpazderka
Copy link
Author

Yes, I have tried py 3.8 and 3.9.

@JelleZijlstra
Copy link
Member

This also affects types-fb303.

@JelleZijlstra
Copy link
Member

There's arguably two bugs here, one in mypy and one in typeshed:

  • mypy should not suggest installing a stub package that doesn't work for the Python version you're running
  • typeshed shouldn't upload a wheel that claims to be Python 3 compatible if the stubs are Python 2-only

@JukkaL
Copy link
Contributor

JukkaL commented Jun 9, 2021

I believe that the wheel needs to be Python 3 compatible so that type checkers written in Python 3 (such as mypy) can use it easily, without needing a Python 2 virtual environment. We ship a metadata toml file along with the wheel that indicates whether the stubs are compatible with Python 2/3.

I agree that mypy should understand which stubs are only Python 2/3 compatible.

@AlexWaygood AlexWaygood added the project: infrastructure typeshed build, test, documentation, or distribution related label Jun 12, 2022
@AlexWaygood
Copy link
Member

It doesn't sound like there's anything actionable for typeshed here (and if there were, it sounds to me like it would need to be addressed over at the https://github.com/typeshed-internal/stub_uploader repo).

@AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project: infrastructure typeshed build, test, documentation, or distribution related
Projects
None yet
Development

No branches or pull requests

4 participants