-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Switch to modular typeshed #9971
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
Labels
Comments
After removing the typeshed submodule, we'll use the script |
JukkaL
added a commit
that referenced
this issue
Jan 26, 2021
Support the new structure of typeshed (python/typeshed#2491) and only bundle stdlib stubs with mypy. Most stubs for third-party packages now need to be installed using pip (for example, `pip install types-requests`). Add stubs for `typing_extensions` and `mypy_extensions` as mypy dependencies, since these are needed for basic operation. Suggest a pip command to run if we encounter known missing stubs. Add `--install-types` option that installs all missing stub packages. This can be used as `mypy --install-types` to install missing stub packages from the previous mypy run (no need to provide a full mypy command line). This also replaces the typeshed git submodule with a partial copy of the typeshed that only includes stdlib stubs. Add a script to sync stubs from typeshed (`misc/sync-typeshed.py`). This is still incomplete since typeshed hasn't actually migrated to the new structure yet. Work towards #9971.
This has been working for some time now (though not publicly released yet). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The structure of typeshed is changing, and tools are no longer expected to bundle the entire typeshed. Instead, users will install relevant PEP 561 stub distributions for the packages that they need.
Typeshed will continue to host third-party package stubs, and updates to third-party stubs will automatically uploaded to PyPI.
This will affect mypy in several ways:
pip install types-requests
for stubs forrequests
.This has some major benefits:
We can make the transition relatively smooth by suggesting how to install the relevant stubs when the stubs are missing. We can also support automatically installing the necessary stubs (
mypy --install-stubs
).Discussion about the typeshed change, including motivation: python/typeshed#2491
The text was updated successfully, but these errors were encountered: