-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
mypy.ini is missing #2852
Comments
This seems like a good idea to me. What do the other maintainers think? |
Unfortunately I couldn't create an operational fix for |
A pytype.cfg isn't needed, since the typeshed test uses |
As requested by #1526. This addition takes mypy configuration from each distribution metadata file and constructs a single mypy.ini to run with. It assumes there is no mypy.ini but in case we ever need one, it would be simple to add these on top of an existing configuration file. Might be relevant for #2852 As the issue did not really specify how the configuration would look, I added the following: - You may add a mypy-tests section to the metadata file. It looks like this: [mypy-tests] [mypy-tests.yaml] module_name = "yaml" [mypy-tests.yaml.values] disallow_incomplete_defs = true disallow_untyped_defs = true - module_name can be of the form "a.*" like in mypy.ini. - You can add several module sections for complex distributions with several modules. - I added the '--warn-incomplete-stub' option since it is made specifically for typeshed runs. See docs.
|
I think this is no longer needed for people to get our tests that use mypy to pass locally: command-line flags always override config files for mypy, and all of our scripts that invoke mypy ( I'm guessing the experience when editing typeshed locally in an IDE could still be improved. But I feel like adding a So, in summary: I don't think we should do this :/ |
I have
.mypy.ini
file that I use for my projects, in my home directory, and it's pretty strict.It took me some time to find out that all the
typeshed
test failures I see are due to the fact thatmypy
finds that config file and uses it to run tests.Besides this confusion, that can lead to a more serious problem when someone has a relaxed
.mypy.ini
in one's home, and that could cause the tests to pass while in fact they should not.Suggestion: having a correct
mypy.ini
inside thetypeshed
and configuring all the test scripts to use it explicitly.Probably something similar should be done for
pytype.cfg
and.flake8
.The text was updated successfully, but these errors were encountered: