-
Notifications
You must be signed in to change notification settings - Fork 37
Update mypy.ini from setuptools #136
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
Changes from 2 commits
54af37d
6e5a7dc
2ad3661
c518c58
ae9fdc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,35 @@ | ||||||||||||||
| [mypy] | ||||||||||||||
| ignore_missing_imports = True | ||||||||||||||
| # required to support namespace packages | ||||||||||||||
| # https://github.com/python/mypy/issues/14057 | ||||||||||||||
| # Is the project well-typed? | ||||||||||||||
| strict = False | ||||||||||||||
|
|
||||||||||||||
| # Early opt-in even when strict = False | ||||||||||||||
| warn_unused_ignores = True | ||||||||||||||
| warn_redundant_casts = True | ||||||||||||||
| enable_error_code = ignore-without-code | ||||||||||||||
|
|
||||||||||||||
| # Support namespace packages per https://github.com/python/mypy/issues/14057 | ||||||||||||||
| explicit_package_bases = True | ||||||||||||||
|
|
||||||||||||||
| # Disable overload-overlap due to many false-positives | ||||||||||||||
| disable_error_code = overload-overlap | ||||||||||||||
|
|
||||||||||||||
| exclude = (?x)( | ||||||||||||||
| # upstream | ||||||||||||||
| ^build/ | ||||||||||||||
| | ^.tox/ | ||||||||||||||
|
|
||||||||||||||
| # local | ||||||||||||||
| ) | ||||||||||||||
|
|
||||||||||||||
| # - distutils._modified has different errors on Python 3.8 [import-untyped], on Python 3.9+ [import-not-found] | ||||||||||||||
Avasam marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||
| # - All jaraco modules are still untyped | ||||||||||||||
|
||||||||||||||
| # - wheel appears to be untyped | ||||||||||||||
|
||||||||||||||
| [mypy-distutils._modified,jaraco.*,wheel.*] | ||||||||||||||
| ignore_missing_imports = True | ||||||||||||||
Avasam marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||
|
|
||||||||||||||
| # Even when excluding a module, import issues can show up due to following import | ||||||||||||||
| # https://github.com/python/mypy/issues/11936#issuecomment-1466764006 | ||||||||||||||
| # Add your excluded modules that still produce import errors here | ||||||||||||||
| # [mypy-a_module.*] | ||||||||||||||
| # follow_imports = silent | ||||||||||||||
| # silent => ignore errors when following imports | ||||||||||||||
|
||||||||||||||
| # Even when excluding a module, import issues can show up due to following import | |
| # https://github.com/python/mypy/issues/11936#issuecomment-1466764006 | |
| # Add your excluded modules that still produce import errors here | |
| # [mypy-a_module.*] | |
| # follow_imports = silent | |
| # silent => ignore errors when following imports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought maybe there was already a relevant section, but I don't see one. I think it should go under Packaging Conventions after Running Tests, something like Type Checking
Packaging Conventions
Running Tests
...
Type Checking
...
Continuous Integration
...
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really feel like this should be unnecessary. I've never had problems with it. What problem does it address? Can we eliminate it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to give you concrete examples when I have time.
But off the top of my head, it can lead to issues with mypy picking up python files copied or created in these folders.
For example mypy might think there's a duplicate module and not able to differentiate it. Or give errors for python modules not part of the source code. Even when it doesn't error it'll speed up the run by not scanning useless files.
I don't remember if you can tell mypy to follow a
.gitignore, but that's irrelevant given you prefer not using one.I know the skeleton uses tox. I don't remember if it has anything that should generate a "build" folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've decided to remove this for now. Until there's a good justification for it, I'd rather it not be here.