gh-129707: Check Tools/build/compute-changes.py with mypy#129708
gh-129707: Check Tools/build/compute-changes.py with mypy#129708AA-Turner merged 4 commits intopython:mainfrom
Tools/build/compute-changes.py with mypy#129708Conversation
AA-Turner
left a comment
There was a problem hiding this comment.
Please use Set rather than the concrete class.
A
|
When you're done making the requested changes, leave the comment: |
Tools/build/mypy.ini
Outdated
| @@ -1,5 +1,5 @@ | |||
| [mypy] | |||
| files = Tools/build/generate_sbom.py | |||
| files = Tools/build/generate_sbom.py, Tools/build/compute-changes.py | |||
There was a problem hiding this comment.
Can we make this a multi-line list? Ideally we could use a TOML file, does MyPy support mypy.toml or .mypy.toml?
There was a problem hiding this comment.
It supports pyproject.toml, but it can affect stuff. + Our CI expects all folders to have mypy.ini. Current version of mypy does not support multiline strings here. But, I will fix that upstream. So, we can expect this in 1.16.0 somewhere.
There was a problem hiding this comment.
Seems to work like this?
| files = Tools/build/generate_sbom.py, Tools/build/compute-changes.py | |
| files = | |
| Tools/build/compute-changes.py, | |
| Tools/build/generate_sbom.py |
(Unfortunately can't add a trailing comma to the last entry.)
There was a problem hiding this comment.
I've created a MyPy issue to request support for mypy.toml or similar: python/mypy#18617
There was a problem hiding this comment.
I will fix it shortly, sorry for the , bug 😢
I've fixed it several times already, but it is very persistent for some reason.
|
I don't quite agree about the |
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
True! My rationale is that it might make sense in some future change to use |
…i` (#18621) Now ```ini files = a.py, b.py ``` and ```ini files = a.py, b.py, ``` will be the same thing. Previously, adding a traling comma would add `''` to `paths`, which resulted in a strange error like: ``` a.py: error: Duplicate module named "a" (also at "a.py") (diff) a.py: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules for more info (diff) a.py: note: Common resolutions include: a) using `--exclude` to avoid checking one of them, b) adding `__init__.py` somewhere, c) using `--explicit-package-bases` or adjusting MYPYPATH (diff) ``` Refs #14240 Refs python/cpython#129708
…ython#129708) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…ython#129708) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…i` (python#18621) Now ```ini files = a.py, b.py ``` and ```ini files = a.py, b.py, ``` will be the same thing. Previously, adding a traling comma would add `''` to `paths`, which resulted in a strange error like: ``` a.py: error: Duplicate module named "a" (also at "a.py") (diff) a.py: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules for more info (diff) a.py: note: Common resolutions include: a) using `--exclude` to avoid checking one of them, b) adding `__init__.py` somewhere, c) using `--explicit-package-bases` or adjusting MYPYPATH (diff) ``` Refs python#14240 Refs python/cpython#129708
There was one error locally:
compute-changes.pyshould be checked with mypy #129707