-
Notifications
You must be signed in to change notification settings - Fork 171
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 stubs for async #678
base: master
Are you sure you want to change the base?
Add stubs for async #678
Conversation
@kishore7snehil Could I get a review and a merge please? |
Hey @David-Gilman, I'm reviewing your PR now and will be adding comments soon. However, the merge won't be possible since |
Hey @David-Gilman, I’ve reviewed your PR. Instead of creating multiple I already have a script ready for this, and I can share the feature branch with you. You can check out the script in the scripts folder here and try running it using: poetry run python scripts/generate_stubs.py This will generate all the required Let me know if this approach works for you—if it does, we can close this PR and proceed with the scripted solution. Also, I’m not in favor of adding cc: @kpark-hrp |
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.
I already have a script ready for this. You can check out the script in the scripts folder here and try running it using:
poetry run python scripts/generate_stubs.py
This will generate all the required .pyi
files for the auth0/management folder.
I’m not in favor of adding .pyi
files directly in the repo as it looks odd and can be confusing. Otherwise, we would have just added duplicate functions for async directly in each .py
file.
That requires anyone use type checkers to maintain their own fork with the .pyi files. Adding .pyi files is a common practice and would be relatively low maintenance, as well as a good middle ground between no type hints and having to maintain entire duplicate functions. You could add your script to the CI check so that any changes get updated automatically in the PR. If you feel strongly about this though and no other maintainers disagree with you, I can open a typeshed PR instead. |
@kishore7snehil Thoughts? |
@David-Gilman I would suggest to go with |
Changes
Currently type checkers such as pyre, mypy, and those included in IDEs can't handle async functions. This adds partial support by adding
.pyi
files for the management API functions ending in_async
.References
Resolves: #615
Testing
Tested with IDE and type checkers.
Checklist