Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add py.typed for type checkers following PEP 561 #41

Merged
merged 2 commits into from
Jul 15, 2023

Conversation

Zocker1999NET
Copy link
Contributor

While the py.typed file is missing, type checkers like mypy will treat the library as untyped when included into other projects. This behavior is defined in PEP 561 Adding this file to the package (and ensure it gets packaged) does make the library accessible for type checkers.

To add it, I followed this short guide.
To test it, I force-installed your package into a venv, wrote test code which uses this library, and verified that mypy now can type check everything (aka. following error is now missing: Skipping analyzing "rss_parser": module is installed, but missing library stubs or py.typed marker [import])

@dhvcc
Copy link
Owner

dhvcc commented Jun 26, 2023

Hi, thanks for the PR, looks good to me

@dhvcc
Copy link
Owner

dhvcc commented Jun 26, 2023

May be we can add a test with mypy to somehow test this behavior?

@dhvcc dhvcc merged commit d15017d into dhvcc:master Jul 15, 2023
12 checks passed
@Zocker1999NET
Copy link
Contributor Author

May be we can add a test with mypy to somehow test this behavior?

I‘ve checked but did not find a way to test it with a simple command line parameter. Maybe they would implement one if asked? Otherwise, one could setup a test project importing this one and check if mypy raises an issue that it cannot find type hintings for the imported project.

However, sadly currently I have no time to look into this myself.

Thanks for merging ❤️

@dhvcc
Copy link
Owner

dhvcc commented Jul 20, 2023

Creating a code with import is how I tested it, we could do that, but with no changes to this in near future I don't see a need
Thanks for the PR

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.

2 participants