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 PEP-561 Support by adding a py.typed file #6780

Closed
lewis6991 opened this issue Oct 30, 2019 · 1 comment
Closed

Add PEP-561 Support by adding a py.typed file #6780

lewis6991 opened this issue Oct 30, 2019 · 1 comment
Labels
good first issue type:enhancement enhance or introduce a new feature
Milestone

Comments

@lewis6991
Copy link
Contributor

lewis6991 commented Oct 30, 2019

I'm trying to run the latest mypy on a sphinx extension I am writing and mypy is giving the error:

error: Cannot find module named 'sphinx'

However looking at the source code for a lot of sphinx, it appears much of the code includes type annotations. The mypy docs state that if source code includes annotations in the source then a package can be made PEP-561 compatible by adding a py.typed file.

I tried this myself by adding a py.typed file to the sphinx directory in my site-packages and now mypy is happy.

This may be related to #4824

@lewis6991 lewis6991 added the type:enhancement enhance or introduce a new feature label Oct 30, 2019
@tk0miya
Copy link
Member

tk0miya commented Oct 30, 2019

Could you send a pull request please? Then I'll ship it in next release.

Note: 2.0 branch is good for this.

@tk0miya tk0miya added this to the 2.3.0 milestone Oct 30, 2019
@tk0miya tk0miya closed this as completed Oct 31, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue type:enhancement enhance or introduce a new feature
Projects
None yet
Development

No branches or pull requests

2 participants