-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
exclude should imply a per-module follow import skip for matching modules #10377
Comments
This is a pretty reasonable confusion / ask. Here's some background:
That's all to say adding something like the following (in addition to
I don't really expect users to understand all of that / seems reasonable to me that |
@hauntsaninja That explains why just |
I found this ticket after being driven crazy by the same issue. But I can't make your suggested solution work with mypy 0.812. I am trying to check ts_salobj which has an auto-generated version.py (not present in the git repo) that is built before mypy runs and is not compatible with mypy. I have tried every variant of your suggested fix and none of them work, including even disabling follow_imports globally (which is not how I want to run):
For the record, the line in version.py that makes mypy unhappy is:
Any other suggestions for working around this issue? We can eventually fix the generated |
The solution I ended up with was two-fold:
The [tool:pytest] section is sufficient to make pytest happy, but the exclude in the [mypy] section is useful when running mypy directly from the command line. |
Bug Report
I recently converted this project (linked to at the most recent commit) from a plain script to a Python package. This included adding an un-annotated
_version.py
file generated by versioneer to the package. mypy (when run asmypy src
) now reports errors due to_version.py
lacking any type annotations, and I cannot get it to ignore that file.What I've tried:
exclude = _version.py
to the[mypy]
section insetup.cfg
exclude = src/tinuous/_version.py
to the[mypy]
sectionexclude = src/tinuous/_(version|_init__).py
to the[mypy]
sectionmypy src/tinuous/__main__.py
mypy --exclude _version.py src
In all of these cases, mypy spits out errors relating to
_version.py
even though I thought I told it to ignore that file.Your Environment
--exclude
or nothingmypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: