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 support for PEP 561 and static type checkers #74

Closed
wants to merge 2 commits into from

Conversation

unode
Copy link
Contributor

@unode unode commented Jun 9, 2023

Using parsy on a project that uses mypy currently leads to:

error: Skipping analyzing "parsy": module is installed, but missing library stubs or py.typed marker  [import]

This PR introduces a py.typed file that specifies that parsy supports type checking. See PEP 561 for additional context.

@codecov-commenter
Copy link

codecov-commenter commented Jun 9, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (5be0cd3) 94.44% compared to head (f2f9b51) 94.44%.

❗ Current head f2f9b51 differs from pull request most recent head 079ea74. Consider uploading reports for the commit 079ea74 to get more accurate results

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #74   +/-   ##
=======================================
  Coverage   94.44%   94.44%           
=======================================
  Files           8        8           
  Lines        1026     1026           
=======================================
  Hits          969      969           
  Misses         57       57           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@spookylukey
Copy link
Member

Thanks for your PR!

The issue is, that parsy doesn't really support type checking. The type hints added are basically intended for lightweight documentation and interactive developer help (e.g. autocomplete and tooltips in an IDE), and not for type checking. The only kind of type checking that would be supported would be probably worse than nothing - i.e. by adding a py.typed file we'd be giving a false sense of confidence, which is worse than nothing. See my (long) blog post about this: https://lukeplant.me.uk/blog/posts/python-type-hints-parsy-case-study/

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.

None yet

3 participants