Description
In my current setup, I use tox (version 3.24.5) to run mypy for type checking my codebase. I specified a few files to be excluded from the checks in the setup.cfg
file. Previously (mypy version 0.930) it works fine, but after updating mypy to version 0.931, it does not seem to properly exclude the files when called via tox.
The error
Below is the error message by running tox -e mypy
, where it raises error due to files that I've excluded: src/NLEval/valsplit/
, src/NLEval/model/
and /src/NLEval/graph/
.
mypy recreate: /mnt/ufs18/home-026/liurenmi/repo/NetworkLearningEval/.tox/mypy
mypy installdeps: mypy==0.931
mypy installed: mypy==0.931,mypy-extensions==0.4.3,tomli==2.0.0,typing_extensions==4.0.1
mypy run-test-pre: PYTHONHASHSEED='3030470107'
mypy run-test: commands[0] | mypy src/NLEval
src/NLEval/valsplit/Holdout.py:37: error: Name "train_ratio" already defined on line 29
src/NLEval/valsplit/Holdout.py:37: error: "Callable[[TrainValTest], Any]" has no attribute "setter"
src/NLEval/valsplit/Holdout.py:46: error: Name "test_ratio" already defined on line 33
src/NLEval/valsplit/Holdout.py:46: error: "Callable[[TrainValTest], Any]" has no attribute "setter"
src/NLEval/model_trainer/base.py:78: error: "BaseGraph" has no attribute "mat"
src/NLEval/model/label_propagation.py:76: error: "BaseGraph" has no attribute "propagate"
src/NLEval/model/label_propagation.py:80: error: "BaseGraph" has no attribute "propagate"
src/NLEval/graph/sparse.py:32: error: Name "weighted" already defined on line 22
src/NLEval/graph/sparse.py:32: error: "Callable[[SparseGraph], Any]" has no attribute "setter"
src/NLEval/graph/sparse.py:37: error: Name "directed" already defined on line 27
src/NLEval/graph/sparse.py:37: error: "Callable[[SparseGraph], Any]" has no attribute "setter"
src/NLEval/graph/dense.py:174: error: overloaded function has no attribute "setter"
Found 12 errors in 5 files (checked 39 source files)
ERROR: InvocationError for command /mnt/ufs18/home-026/liurenmi/repo/NetworkLearningEval/.tox/mypy/bin/mypy src/NLEval (exited with code 1)
______________________________________________________________________________________ summary _______________________________________________________________________________________
ERROR: mypy: commands failed
Previous version (0.930) works fine
If I set the mypy version to 0.930 (the previous version), it runs fine:
mypy recreate: /mnt/ufs18/home-026/liurenmi/repo/NetworkLearningEval/.tox/mypy
mypy installdeps: mypy==0.930
mypy installed: mypy==0.930,mypy-extensions==0.4.3,tomli==2.0.0,typing_extensions==4.0.1
mypy run-test-pre: PYTHONHASHSEED='2815542976'
mypy run-test: commands[0] | mypy src/NLEval
Success: no issues found in 30 source files
______________________________________________________________________________________ summary _______________________________________________________________________________________
mypy: commands succeeded
congratulations :)
Command-line interface works fine
However, if I run using the command line interface, it properly excludes the files.
Configuration
Here's the relevant lines in my setup.cfg
for setting up mypy configuration:
[mypy]
ignore_missing_imports = true
follow_imports = skip
exclude =
src/NLEval/graph/
src/NLEval/valsplit/
src/NLEval/metrics.py