-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Mypy doesn't find type hints in imported module #9944
Comments
I experience potentially related issue with the newly release 0.800, the directives such as: [mypy-pytest]
ignore_missing_imports = True are no longer picked up from Could it be a regression in Edit: thanks @hauntsaninja! I don't know how I missed the other issue. |
That seems related to #9940. I think you can add a dummy |
As for the original issue, do you have a py.typed? https://mypy.readthedocs.io/en/stable/installed_packages.html |
No, I don't. I tried searching if I needed to include anything for shipping a typed package before raising this. I didn't find this link, so I assumed it works automagically. But after reading this, I'm still quite confused:
So do I need the |
That's in the section for using, see the section for making https://mypy.readthedocs.io/en/stable/installed_packages.html#making-pep-561-compatible-packages |
Oh, I see now, thanks. Not sure if this should be under configuring mypy though. Could you please make the error message a bit more helpful then? Something like "found installed package but not marked with
|
For me, using |
I totally agree with @mvolfik , the error messages are highly uninformative and misleading. |
Also re-order docs and make them more greppable Helps with e.g. complaints in #9944 Co-authored-by: hauntsaninja <>
Also re-order docs and make them more greppable Helps with e.g. complaints in #9944 Co-authored-by: hauntsaninja <>
Bug Report
Mypy doesn't find type hints in my library.
To Reproduce
Pipfile
:program.py
:Steps:
pipenv --python 3.8 pipenv update pipenv run mypy .
The library itself is checked correctly with
mypy
configured to be strict and usepydantic
plugin, see the fullmypy.ini
. If i copy this config into the directory with the bug setup as above, nothing changes (just an idea - there maybe should be a way for libraries to define what mypy plugins they recommend/require to typecheck correctly).Expected Behavior
Everything typechecks correctly
Actual Behavior
Your Environment
mypy.ini
(and other config files): none or strict + pydanticThe text was updated successfully, but these errors were encountered: