microsoftgraph / microsoftgraph/msgraph-sdk-python-core

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

Open
#896 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type:investigation
Dominant language
Python
Stars
288
Forks
52
Avg merge
8h 10m
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the repository's py.typed.txt with the files included in the pip package on PyPI, then inspect the package metadata and build configuration that control inclusion. Reproduce the mypy import error with an installed msgraph-core version, and consider the issue done when the published package contains the correct marker and mypy recognizes its type information.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.