-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 in accordance with PEP-561 #2738
Conversation
@Ovsyanka83 thanks kindly! But.. the library isn't fully typed at this time. Want to help out by contributing type hints? |
Would love to. I think, the PEP allows us to specify that the typing is partial |
Amazing, didn't know about the partial bit. Any idea how typeshed handles that? Those types are incorrect - but if they won't absorb (even after the 6 month cycle) it's... perhaps less valuable. WDYT? |
Codecov ReportPatch coverage has no change and project coverage change:
❗ 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 #2738 +/- ##
==========================================
- Coverage 90.66% 90.64% -0.02%
==========================================
Files 126 126
Lines 32229 32229
==========================================
- Hits 29221 29215 -6
- Misses 3008 3014 +6
☔ View full report in Codecov by Sentry. |
I will try to leave my full reply and research into that next week or, in the worst case, by the end of the month. |
@chayim We added types to Babel in the last release, see python-babel/babel#975 and python/typeshed#9832 for relevant discussion. |
Thanks @akx any idea how partially typed works? typeshed is wrong in all sorts of places for redis-py... The library is only partially typed.. hence the Q |
@chayim I'd assume that anything not explicitly typed will remain any-typed, just as if it hadn't been typed at all. But you'd probably not want to mix and match typeshed types with the native ones. |
I have the same assumption.. hence my worry. Maybe we should get this into 5 instead - along with more typings. |
@chayim If you have concrete examples of this, please let the typeshed project know and we'll try to fix it. Great to see redis-py adding py.typed though! |
(not a typeshed maintainer, just a contributor), FWIW, #2730 has been blocking me from fixing a handful of redis typing issues. And furthermore enabling more tools and checks in typeshed that ensures proper typing. Concerning incomplete typing in both the base library (here) and typeshed, refer to my comment there: python/typeshed#10592 (comment) I fully support type definitions moving fully into Redis itself. But if it can't be done quickly or completely, Typeshed should be able to provide explicitly partial stubs and gradually remove modules as they are type-completed in Redis. |
Pull Request check-list
$ tox
pass with this change (including linting)?Description of change
Add py.typed in accordance with PEP-561. Otherwise type checkers might ignore type hints from this package (particularly old versions of pyright)