python / python/mypy

some tests with approved stubs have the wrong error

オープン
#12,504 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug
主要言語
Python
スター
20.6k
フォーク
3.3k
平均マージ
1日 18時間
マージ済み PR(30日)
54

説明

for example, the testLimitLegacyStubErrorVolume test:
https://github.com/python/mypy/blob/bd530392cdbe444c63cc21820ad7b9748ea9c816/test-data/unit/check-modules.test#L3015-L3018

since certifi is an approved stub, it should instead suggest installing them, like it does here:

>mypy -c "import certifi"
<string>:1: error: Library stubs not installed for "certifi" (or incompatible with Python 3.10)  [import]
<string>:1: note: Hint: "python3 -m pip install types-certifi"
<string>:1: note: (or run "mypy --install-types" to install all missing stub packages)
<string>:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)

but for some reason, these tests (and also the playground) don't do that

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

test-data/unit/check-modules.test の testLimitLegacyStubErrorVolume 周辺から始め、そこで期待されるエラーを issue の certifi の例と比較します。mypy/stubinfo.py の approved-stub エントリを読み、提供された mypy コマンドで動作を再現します。影響を受けるテストで approved stubs が一貫してそれぞれの types package のインストールを示唆し、playground の動作もそのとおりになることが完了の条件です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。