Skip to content

Support loading stubs/ from typeshed #12241

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

Closed
not-my-profile opened this issue Feb 22, 2022 · 1 comment · Fixed by #13505
Closed

Support loading stubs/ from typeshed #12241

not-my-profile opened this issue Feb 22, 2022 · 1 comment · Fixed by #13505
Labels

Comments

@not-my-profile
Copy link

not-my-profile commented Feb 22, 2022

When I create a file foo.py with import toml and execute mypy foo.py --custom-typeshed-dir my-typeshed/ I get:

foo.py:1: error: Library stubs not installed for "toml" (or incompatible with Python 3.9)
foo.py:1: note: Hint: "python3 -m pip install types-toml"
foo.py:1: note: (or run "mypy --install-types" to install all missing stub packages)
foo.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)

Although my-typeshed/stubs/ contains toml/.

I find this really inconvenient because I'd like to test my third-party stub typeshed contributions with mypy.

It's worth noting that pyright handles this, pyright foo.py --typeshed-path my-typeshed/ works as expected.

@Akuli
Copy link
Contributor

Akuli commented Feb 25, 2022

This works, but is probably not documented anywhere and we should at least document it: MYPYPATH=stubs/toml/ foo.py

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

Successfully merging a pull request may close this issue.

2 participants