The Mypy Blog: Mypy 0.900 Released

submited by
Style Pass
2021-06-09 00:30:07

We’ve just uploaded mypy 0.900 to the Python Package Index (PyPI). Mypy is a static type checker for Python. This release includes many new features and bug fixes. You can install it as follows: python3 -m pip install -U mypy

You can read the full documentation for this release on Read the Docs. Third-party Library Stubs in Stub Packages (Breaking Change)

Mypy now only ships with type stubs for stdlib modules (plus typing_extensions and mypy_extensions). If you use third-party libraries that don’t include stubs or inline type annotations, you can explicitly install stub packages, usually called types-<name>.

If mypy can’t find stubs, it will suggest the name of the stub package to install: t.py:1: error: Library stubs not installed for "requests" (or incompatible with Python 3.8) t.py:1: note: Hint: "python3 -m pip install types-requests" t.py:1: note: (or run "mypy --install-types" to install all missing stub packages) t.py:1: note: See https://mypy.readthedocs.io/en/...

You can also now run mypy --install-types to install all missing stub packages in the mypy run (or the previous run, if you don’t pass any files to check): $ mypy --install-types Installing missing stub packages: /Users/jukka/venv/mypy/bin/python3 -m pip install types-requests Install? [yN] y Collecting types-requests Using cached types_requests-0.1.8-py2.py3-none-any.whl (22 kB) Installing collected packages: types-requests Successfully installed types-requests-0.1.8

Leave a Comment