python / python/mypy

Manage `ignore_missing_imports = true` sections configs automatically

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

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

feature
主要言語
Python
スター
20.6k
フォーク
3.3k
PR マージ指標
PR 指標を取得中

説明

Feature

When I'm adding typing to an existing project, I encounter many libraries that don't have type hints. The easy solution to suppressing these errors is setting ignore_missing_imports = true, but this is not great. The recommended solution, assuming you don't want to write your own stubs, is to create separate sections for each such library. This can be cumbersome to create and manage.

I wrote myself a small tool that generates such configs: https://github.com/indigoviolet/mypy-missing-imports . I think it would be nice for mypy to include something like it, to make the "recommended" path easier to follow.

Pitch

I'm imagining something like

mypy --generate-missing-import-configs <optionally, /path/to/mypy.ini>

which would print out sections for each library identified as a [import] error like

[mypy-foo.*]
ignore_missing_imports = true

If passed a configuration file, it would update the corresponding sections in that file.

I'd be happy to try and add this to mypy if it is useful.

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

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

はじめの一歩

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

調査の方向性

mypy のコマンドライン処理と設定処理から始め、提案されているコマンド mypy --generate-missing-import-configs と、任意の入力 mypy.ini をエントリーポイントとして使用します。意図された動作を確認するため、参照されているツール mypy-missing-imports を確認してください。完了の条件は、ignore_missing_imports = true を含む [mypy-foo.*] のようなライブラリごとのセクションを生成または更新することです。

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

評価

技術スタック
python
領域
tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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