-
-
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
0.800: Unable to configure subdirectories #10045
Comments
I marked this as a bug, as it's kind of a regression from 0.790, in that files checked by default cannot be configured. |
I reported something similar in #9974. |
You can (as previously) use the module name mypy associates with the file, so e.g. |
I think if --namespace-packages is made default as mentioned in that issue, that would resolve the "regression". This would still be useful to support though as it makes it easier to include tests and examples in the checks (which normally need less strict options configured). Currently this requires adding a bunch of |
Is this likely to get implemented in an upcoming release? Or is the recommendation to litter the codebase with |
|
I'm not sure this quite resolves the situation. It seems that I can still only configure directories if there is a I'm figuring out how to configure https://github.com/aio-libs/aiohttp-demos/ |
It seems to me like module discovery for imports and configuration paths are intertwined. So, I'm struggling to get mypy to check the files for individual demos and recognise the |
If anybody has any ideas how to make this work currently, that would be great. My initial attempt is at: https://github.com/aio-libs/aiohttp-demos/pull/210/files I'd like mypy to type check all the demos, while being able to configure the settings for each demo individually. This just seems to be impossible currently. |
Can someone point me out what I need to look code wise to fix this? |
In Mypy 0.800, it now checks files in subdirectories without
__init__.py
files.The problem is that the config still only works on modules containing
__init__.py
, meaning there is no way to change the config for these subdirectories.e.g.
untyped-def errors have started appearing in test/foo/bar.py
Adding this to config has no effect:
This only works if
tests/__init__.py
andtests/foo/__init__.py
are created.Expected behaviour is that the above config will ignore the errors, or an alternative syntax is available to do so (e.g.
[mypy-tests/*]
.The text was updated successfully, but these errors were encountered: