-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Re-enable mypy and sync mypy.ini from skeleton #4604
base: main
Are you sure you want to change the base?
Conversation
@@ -51,6 +51,6 @@ ignore_missing_imports = True | |||
|
|||
# Even when excluding a module, import issues can show up due to following import | |||
# https://github.com/python/mypy/issues/11936#issuecomment-1466764006 | |||
[mypy-setuptools.config._validate_pyproject.*,setuptools._distutils.*] | |||
[mypy-setuptools.config._validate_pyproject.*,setuptools._vendor.*,setuptools._distutils.*] |
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.
Do we know why the exclusions had to change? Presumably the mypy tests were passing before it was disabled.
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.
Whilst the CI setup makes it pass, locally on Windows:
setuptools\_vendor\packaging\_manylinux.py:187: error: Cannot find implementation or library stub for module named "_manylinux" [import-not-found]
setuptools\_vendor\packaging\_manylinux.py:187: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
The "Fix ConfigHandler generic" commit is related to python/mypy#17631 (comment) (same symptoms). Not sure why it wasn't failing before, didn't fail locally (granted I'm running from Windows on 3.9, so it could be environment-specific, despite version/platform flags), and only failed on the CI on (MacOS and/or 3.12)1. But it still revealed an underlying misuse of the Footnotes
|
I still see some test failures.
What's the plan for those? Also, thanks for reconciling the differences between setuptools' and skeleton's mypy.ini. |
I rebase and fix them 😃 |
if spec.loader is None: | ||
raise AttributeError(f"spec {spec} is missing a loader") |
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.
or this if you think it should really never happen and want to remove the check in optimized mode
if spec.loader is None: | |
raise AttributeError(f"spec {spec} is missing a loader") | |
assert spec.loader is not None |
if namespaces: | ||
from setuptools.discovery import PEP420PackageFinder as PackageFinder | ||
if not namespaces: | ||
from setuptools.discovery import PackageFinder | ||
else: | ||
from setuptools.discovery import PackageFinder # type: ignore | ||
from setuptools.discovery import PEP420PackageFinder as PackageFinder |
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.
Avoids python/mypy#6232
# TODO: Explain why passing None is fine here when ConfigParser.default_section expects to be str | ||
parser = ConfigParser(default_section=None, delimiters=("=",)) # type: ignore[call-overload] |
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.
Could this be ?
# TODO: Explain why passing None is fine here when ConfigParser.default_section expects to be str | |
parser = ConfigParser(default_section=None, delimiters=("=",)) # type: ignore[call-overload] | |
parser = ConfigParser(default_section="", delimiters=("=",)) |
170c2c0
to
377cd71
Compare
@@ -1418,7 +1418,7 @@ def VCRuntimeRedist(self) -> str | None: | |||
os.path.join(prefix, arch_subdir, crt_dir, vcruntime) | |||
for (prefix, crt_dir) in itertools.product(prefixes, crt_dirs) | |||
) | |||
return next(filter(os.path.isfile, candidate_paths), None) | |||
return next(filter(os.path.isfile, candidate_paths), None) # type: ignore[arg-type] #python/mypy#12682 |
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.
377cd71
to
fb95489
Compare
fb95489
to
3f05bb9
Compare
Summary of changes
Ref jaraco/skeleton#143
Pull Request Checklist
newsfragments/
.(See documentation for details)