If I run mypy locally it will only type check certain files because the pyproject.toml
file has the following inclusion:
[tool.mypy]
files = [
"python/project/file1.py",
"python/project/file2.py"
]
strict = true
This is in a project with the following structure:
- root
- pyproject.toml
- python
- project
- file1.py
- file2.py
- other_files.py
My workflow looks roughly like this:
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev] -v
- name: Test with pytest and display Coverage
run: |
coverage run -m --source=project pytest
coverage report -m
- name: MyPy type checking
run: |
mypy --config-file pyproject.toml
But when it runs it doesn’t just type check the specific files it also types all other files in the project and returns 1,000s of errors. Why?