Add py.typed marker for PEP 561 compliance#697
Open
mac-agent wants to merge 1 commit intotrentm:masterfrom
Open
Add py.typed marker for PEP 561 compliance#697mac-agent wants to merge 1 commit intotrentm:masterfrom
mac-agent wants to merge 1 commit intotrentm:masterfrom
Conversation
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
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. |
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? |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Solution
Add a PEP 561 marker file to signal to type checkers that the package ships inline type information.
Changes
Testing
After installing the package with this change, both mypy and pyright will recognize as a typed package without requiring separate stubs.