Error when running on code inside venv containing `typing-extensions`
まだ誰も着手していません。
評価
調査の方向性
リンクされている mypy-typing-extensions-issue リポジトリの最小限の例から始め、仮想環境にインストールしたパッケージに対してコマンドを再現してください。報告された shadowing エラーについて、mypy のモジュール解決のエントリーポイントを追跡し、その後、対象の hello.py がエラーなしで想定どおりチェックされることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Bug Report
When running mypy on code installed in a virtualenv environment, mypy will fail outright if the environment contains typing-extensions.
To Reproduce
See repo containing a minimal example. The steps below describe the general idea:
- Create a fresh virtual environment.
- Create a minimal library with a
setup.pythat liststyping-extensionsininstall_requires. - Install the library to the virtual environment.
- Run
mypyon a file inside the environment that is part of the library (mypy venv/lib/python3.Y/site-packages/my_project/hello.py).
Expected Behavior
mypy would report errors in hello.py, if any, or exit with 0 if none.
Actual Behavior
mypy doesn't check hello.py, complaining that it found a typing_extensions.py in the environment:
mypy: "project-venv/lib/python3.6/site-packages/typing_extensions.py" shadows library module "typing_extensions"
note: A user-defined top-level module with name "typing_extensions" is not supported
Your Environment
- Mypy version used: 0.910.
- Mypy command-line flags: none
- Mypy configuration options from
mypy.ini(and other config files): none - Python version used: multiple (3.6.8, 3.8.8).
- Operating system and version: CentOS 7
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- 平均マージ
- 1日 18時間
- マージ済み PR(30日)
- 54
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/mypy のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug topic-configuration topic-error-reporting
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
bancolombia/sentinel#23 ·
-
test md オープンCI
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
langchain-ai/deepagents#6450 ·
-
bug client
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100