-
Notifications
You must be signed in to change notification settings - Fork 438
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
Run Pyright & begin adding type annotations #1020
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Puts __getattr_ behind `if not TYPE_CHECKING` * Add mypy.ini and py.typed
richardm-stripe
force-pushed
the
richard-wip
branch
3 times, most recently
from
August 21, 2023 19:02
dfdad3f
to
56dab4c
Compare
richardm-stripe
force-pushed
the
richard-wip
branch
from
August 21, 2023 23:10
50acdf3
to
81c8141
Compare
richardm-stripe
force-pushed
the
richard-wip
branch
from
August 22, 2023 20:53
c43b1b7
to
5e8a9fd
Compare
richardm-stripe
force-pushed
the
richard-wip
branch
from
August 23, 2023 00:36
90f0d0d
to
6f8f917
Compare
pakrym-stripe
requested changes
Aug 23, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Some comments.
richardm-stripe
force-pushed
the
richard-wip
branch
from
August 23, 2023 18:02
e6658f5
to
ab5f1e9
Compare
pakrym-stripe
approved these changes
Aug 23, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! 🥳 🎆 🍾
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR begins to add type annotations to the library. The goal is a minimal amount of changes to to get
pyright
running and typechecking the library in CI with zero errors.We add a
py.typed
to the repo but NOT to thepackage_data
property of setup.py. This should ensure that the type annotations in the library don't get picked up by user typecheckers yet (we're not ready yet! we'll get there) but allows us to test our own library for consistency in CI.We do, however, add
typing_extensions
as a dependency to the library. We don't take adding dependencies lightly, butthis dependency is inescapable as we still target python 3.6, and are planning on using fairly recent type system features (
Unpack
for typed **kwargs). This dependency is lightweight and seems very common.For now, the library is still compatible with
typing_extensions > 3.7.2
but this will narrow as we make use of newer type features.Please let us know here on Github if you experience any problems as a result of this new dependency.