authlib
authlib copied to clipboard
PEP-484 Type Hints
Is your feature request related to a problem? Please describe.
We use python with strict typing at our organization which means we have to add a bunch of "type: ignore" comments wherever this library is used. Adding types would make working with this library much easier and require much less context switching between the docs and the editor thanks to autocomplete.
Describe the solution you'd like
I understand a bunch of functionality in this library is very hard to type (dynamic clients, etc.), so maybe this effort could start with the JOSE module.
Describe alternatives you've considered
Alternatively, type stubs for this library could be added to the typeshed project but that is not ideal as it would be very easy for those to get out of sync.
Funding
- You can sponsor this specific effort via a Polar.sh pledge below
- We receive the pledge once the issue is completed & verified
Is there any interest in this from maintainers? Would a PR be welcome, or is there some discussion that should take place prior to that?
We are in the same situation in my organization as @relsunkaev. Is there any movement in this direction?
I just noticed this issue has been labeled which I'm gonna take as an endorsement and take a stab at a PR.
@relsunkaev If you haven't got time to work on this, I can make a draft PR regarding this issue. If you've already made some progress, I'd be happy to help
@relsunkaev If you haven't got time to work on this, I can make a draft PR regarding this issue. If you've already made some progress, I'd be happy to help
I have indeed made some progress, I will share the repository soon.
I've created a separated jose
module with type hints: https://github.com/authlib/joserfc
I've created a separated
jose
module with type hints: https://github.com/authlib/joserfc
Thanks for making this happen, we have done very smooth transition.