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 type marker for PEP 561 #70

Merged
merged 1 commit into from Jun 10, 2019
Merged

Add type marker for PEP 561 #70

merged 1 commit into from Jun 10, 2019

Conversation

trickeydan
Copy link
Contributor

This indicates to type checker tools that typesystem has inline type hints.

Mypy is unable to tell otherwise, and errors, e.g:

inv/asset.py:3: error: Cannot find module named 'typesystem'
inv/asset.py:3: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
inv/asset.py:6: error: Class cannot subclass 'Schema' (has type 'Any')
inv/asset.py:6: error: Base type Schema becomes "Any" due to an unfollowed import
inv/asset.py:14: error: Expression has type "Any"
inv/asset.py:15: error: Expression has type "Any"
inv/asset.py:16: error: Expression has type "Any"
make: *** [Makefile:12: type] Error 1

More information on this can be found at https://www.python.org/dev/peps/pep-0561/#id18

@shamrin
Copy link
Contributor

shamrin commented May 21, 2019

I think you also need to add zip_safe=False to setup.py.

See encode/databases#100 and encode/starlette#455.

@@ -0,0 +1 @@
# Marker file for PEP 561. Typesystem uses inline type hints. See PEP 484 for more information.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would probably prefer just a blank py.typed, in-line with encode/databases#100 and encode/starlette#455.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

This indicates to type checker tools that typesystem has inline
type hints.

More information on this can be found at https://www.python.org/dev/peps/pep-0561/#id18
@trickeydan
Copy link
Contributor Author

I think you also need to add zip_safe=False to setup.py.

See encode/databases#100 and encode/starlette#455.

Fixed

@tomchristie tomchristie merged commit d99a262 into encode:master Jun 10, 2019
@tomchristie
Copy link
Member

Thanks!

@trickeydan trickeydan deleted the pep-561 branch June 10, 2019 12:37
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.

3 participants