Skip to content
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

Update mypy.ini from setuptools #136

Merged
merged 5 commits into from
Aug 12, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
[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
)
Copy link
Owner

@jaraco jaraco Aug 8, 2024

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?

Copy link
Contributor Author

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.

Copy link
Owner

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.


# - most jaraco packages aren't marked as typed
# - wheel is not marked as typed
[mypy-jaraco.*,wheel.*]
ignore_missing_imports = True
jaraco marked this conversation as resolved.
Show resolved Hide resolved

Loading