Cannot exclude encoder.py from type checking
オープン
まだ誰も着手していません。
bug
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- PR マージ指標
- PR 指標を取得中
説明
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず mypy --strict openapi_server tests で問題を再現し、mypy.ini の exclude 式を調べて、encoder.py の扱いを util.py、typing_util.py、models/ と比較します。設定された除外が openapi_server/encoder.py を一貫して除外し、既存の除外を維持できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100