Skip to content

Add py.typed marker for PEP 561 compliance#697

Open
mac-agent wants to merge 1 commit intotrentm:masterfrom
mac-agent:add-py-typed-marker
Open

Add py.typed marker for PEP 561 compliance#697
mac-agent wants to merge 1 commit intotrentm:masterfrom
mac-agent:add-py-typed-marker

Conversation

@mac-agent
Copy link
Copy Markdown

Closes #696

Problem

Type checkers (mypy, pyright) report that the module is missing stubs/py.typed marker, even though typing support was added in PR #581.

mypy: Skipping analyzing "markdown2": module is installed, but missing library stubs or py.typed marker
pyright: Stub file not found for "markdown2"

Solution

Add a PEP 561 marker file to signal to type checkers that the package ships inline type information.

Changes

  • **Added ** — empty marker file per PEP 561
  • **Updated ** — includes in source distributions

Testing

After installing the package with this change, both mypy and pyright will recognize as a typed package without requiring separate stubs.

Closes trentm#696

This allows type checkers (mypy, pyright) to recognize the
markdown2 package as typed, eliminating 'missing stubs/py.typed'
warnings.

Changes:
- Added empty  marker file (PEP 561)
- Updated MANIFEST.in to include the marker in sdist
@nicholasserra
Copy link
Copy Markdown
Collaborator

Thanks! Looks sane. Does the file need to be in the lib dir, or can it live in root folder? Would be nice to keep lib dir clean.

@nicholasserra
Copy link
Copy Markdown
Collaborator

Also does this need to be available after a pip install? If so I think we need extra wiring besides just the manifest include?

@nicholasserra
Copy link
Copy Markdown
Collaborator

Also can you toss me some steps to reproduce? I set up a new venv and installed markdown2 and mypy and am not getting this warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add py.typed marker

2 participants