Open davibicudo opened 10 months ago
What happens is that the path test_module/sample.py
is mapped to the module sample
instead of test_module.sample
:
mypy test_module --verbose 2>&1 | grep source
LOG: Found source: BuildSource(path='test_module/sample.py', module='sample', ...)
Found 1 error in 1 file (checked 1 source file)
To fix it you can do any of the following:
test_module/__init__.py
file--explicit-package-bases
explicit_package_bases=true
in the [tool.mypy]
section of pyproject.toml.More details here.
When running mypy with a pyproject.toml configuration that uses the [[tool.mypy.overrides]] section to exclude specific modules, the specified modules are still being type-checked, contrary to expectations.
Steps to Reproduce:
Set up a pyproject.toml with mypy configurations using the [[tool.mypy.overrides]] section to exclude a specific module:
Have a sample module with evident type errors:
Run mypy with the provided configuration:
mypy test_module/ --config-file pyproject.toml
Expected Behavior: The module test_module.sample should be excluded from type-checking and no errors should be reported.
Actual Behavior: mypy reports type errors from the module test_module.sample, indicating that it is not being excluded as specified in the configuration.
Mypy Version: 1.6.1