microsoftgraph / microsoftgraph/msgraph-sdk-python-core

typed.py file not included in package (so mypy thinks there is no type info available)

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

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

type:investigation
主要言語
Python
スター
288
フォーク
52
平均マージ
8時間 10分
マージ済み PR(30日)
1

説明

Describe the bug

When I run mypy against my project that uses the msgraph_core library, I get an error indicating that the library has no type information:

my/code.py:1: error: Skipping analyzing "msgraph_core": module is installed, but missing library stubs or py.typed marker  [import-untyped]
my/code.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

I see that there is a file called py.typed.txt in the repo (why not just py.typed?) but it doesn't appear in the package that I get via pip (i.e., the one I'd download from https://pypi.org/project/msgraph-core/#files).

Expected behavior

The py.typed file is in the package; mypy (or other type checking tools) have a correct set of types for the package.

How to reproduce

I'm not sure of an exactly minimal repro case, but unless there is something specifically odd with my environment that's contributing, I would guess:

  • create a new Python file that imports something from the msgraph_core package
  • pip install msgraph-core
  • Run mypy against the file
SDK Version

At least 1.3.3, 1.2.1, and 1.1.6

Latest version known to work for scenario above?

I didn't see the py.typed file in 1.1.0, so it must be at least that old

Known Workarounds

Disable type checking for the msgraph-core package.

Debug output

No response

Configuration
  • macOS Sequoia , ARM
  • I don't think it's specific to this configuration
Other information

No response

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

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

はじめの一歩

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

調査の方向性

まず、リポジトリの py.typed.txt と PyPI の pip パッケージに含まれているファイルを比較し、その後、包含を制御しているパッケージメタデータとビルド設定を調べます。インストール済みの msgraph-core バージョンで mypy のインポートエラーを再現し、公開されたパッケージに正しいマーカーが含まれ、mypy がその型情報を認識すれば、Issue は完了したものとみなします。

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

評価

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

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

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