Cannot exclude encoder.py from type checking
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 20.6k
- Forks
- 3.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Bug Report
To Reproduce
Run command
mypy --strict openapi_server tests
All files in models/, typing_util.py and util.py are excluded but not encoder.py
Directory structure is
openapi_server/
models/
...
encoder.py
util.py
typing_util.py
tests/
...
mypy.ini
mypy.ini
[mypy]
exclude = (?x)( # Exclude takes a regular expression
^openapi_server\/models\/*$
| ^openapi_server\/encoder\.py$
| ^openapi_server\/util\.py$
| ^openapi_server\/typing_utils\.py$
)
[mypy-openapi_server.models.*]
follow_imports = skip
[mypy-connexion.*]
ignore_missing_imports = True
Expected Behavior
All files in models/, typing_util.py, util.py and encoder.py are excluded
Actual Behavior
All files in models/, typing_util.py and util.py are excluded but not encoder.py
If I change the name of the file from encoder.py to encode.py or hello.py and update the regex, the file is successfully excluded.
Your Environment
- Mypy version used:
mypy --version->mypy 1.0.0 (compiled: yes) - Mypy command-line flags:
--strict - Mypy configuration options from
mypy.ini(and other config files):
mypy.ini
[mypy]
exclude = (?x)( # Exclude takes a regular expression
^openapi_server\/models\/*$
| ^openapi_server\/encoder\.py$
| ^openapi_server\/util\.py$
| ^openapi_server\/typing_utils\.py$
)
[mypy-openapi_server.models.*]
follow_imports = skip
[mypy-connexion.*]
ignore_missing_imports = True
- Python version used: Python 3.9.16
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das Problem mit mypy --strict openapi_server tests zu reproduzieren, und untersuche den exclude-Ausdruck in mypy.ini, wobei du die Behandlung von encoder.py mit util.py, typing_util.py und models/ vergleichst. Als abgeschlossen gilt die Aufgabe, wenn der konfigurierte Ausschluss openapi_server/encoder.py konsistent auslässt und die bestehenden Ausschlüsse beibehält.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100