microsoftgraph / microsoftgraph/msgraph-sdk-python-core

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

Đang mở
#896 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

type:investigation
Ngôn ngữ chính
Python
Star
288
Fork
52
Merge trung bình
8 giờ 10 phút
Pull request đã merge (30 ngày)
1

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách so sánh py.typed.txt của repository với các tệp được bao gồm trong gói pip trên PyPI, sau đó kiểm tra metadata của gói và cấu hình build kiểm soát việc bao gồm. Tái hiện lỗi import của mypy với một phiên bản msgraph-core đã được cài đặt, và coi issue là hoàn tất khi gói đã phát hành chứa marker chính xác và mypy nhận diện được thông tin kiểu của nó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
build-system
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.