You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Worse developer experience since introducing async support - IntelliSense doesn't work for endpoint classes #483
Some background first:
I used this SDK in a previous company with a very positive experience, fast forward a few years I find myself working with auth0 in python again only to find that the DX is much worse :(
Describe the problem
It looks like since the introduction of asyncio support that the attributes are dynamically added:
I'm currently working on adding types to this sdk (on my free time). Once #472 gets merged, I'll continue working on the management module, and I'll be able to fix this.
I'm currently working on adding types to this sdk (on my free time). Once #472 gets merged, I'll continue working on the management module, and I'll be able to fix this.
Nice work on getting that started, but I also think its important for the core team to embrace type hints for it to be successful. If there is no type checking in the CI then the type hints could quickly become out of date, wrong type hints are worse than none.
I've added a mypy configuration file in the linked PR, taking into account the fact that maintainers can't fully keep return types (e.g. with TypedDict) up to date. CI will probably be updated once I'll finish working on typing
The _async methods are added at runtime so not available for static analysis, other than that we have not made any other changes to the SDK that should make it worse in terms of DX.
Hi @adamjmcgrath thanks for taking the time to reply.
The _async methods are added at runtime so not available for static analysis, other than that we have not made any other changes to the SDK that should make it worse in terms of DX.
This is actually not true, if we ignore the async methods for now and concentrate solely on the sync client then you will see that the DX has definitely decreased. From v3.22.0 and below the endpoint classes were set statically within the constructor of the Auth0 class:
Activity
marcusmotill commentedon Mar 20, 2023
Agreed, also making pylint go wild:

mardav10 commentedon Mar 20, 2023
+1
Viicos commentedon Mar 23, 2023
Hi,
I'm currently working on adding types to this sdk (on my free time). Once #472 gets merged, I'll continue working on the
managementmodule, and I'll be able to fix this.michaeloliverx commentedon Mar 23, 2023
Nice work on getting that started, but I also think its important for the core team to embrace type hints for it to be successful. If there is no type checking in the CI then the type hints could quickly become out of date, wrong type hints are worse than none.
For the core team it might be worth investigating some sort of codegen solutions if the maintenance of the types is too much e.g. https://github.com/Azure/autorest / https://github.com/Azure/autorest.python
Viicos commentedon Mar 23, 2023
I've added a
mypyconfiguration file in the linked PR, taking into account the fact that maintainers can't fully keep return types (e.g. withTypedDict) up to date. CI will probably be updated once I'll finish working on typingadamjmcgrath commentedon Mar 27, 2023
Hi @michaeloliverx - thanks for raising this
The
_asyncmethods are added at runtime so not available for static analysis, other than that we have not made any other changes to the SDK that should make it worse in terms of DX.We are investigating codegen solutions for a next major, but for the time being the async methods will remain as they are.
michaeloliverx commentedon Mar 27, 2023
Hi @adamjmcgrath thanks for taking the time to reply.
This is actually not true, if we ignore the async methods for now and concentrate solely on the sync client then you will see that the DX has definitely decreased. From v3.22.0 and below the endpoint classes were set statically within the constructor of the
Auth0class:auth0-python/auth0/v3/management/auth0.py
Lines 45 to 73 in d07f87b
From any version afterwards they are set dynamically:
auth0-python/auth0/management/auth0.py
Lines 81 to 87 in 947a768
I think it would be a definite win for users if these could be set statically again.
Viicos commentedon Mar 27, 2023
@michaeloliverx I'm currently working on a second PR to add types, and I'm taking care of the issue you're mentioning 😊
Edit: This is how I've done it. Regarding the async client, it's a bit more difficult, as classes are created dynamically.
adamjmcgrath commentedon Mar 27, 2023
Ah, ok - thanks for clarifying @michaeloliverx
And thanks for providing a fix @Viicos - I was away last week and am catching up with a few things, but will take a look at your PR as soon as I can
marcusmotill commentedon Mar 29, 2023
can we reopen this? the issue is not resolved.
adamjmcgrath commentedon Apr 3, 2023
Sure - have raised #486 to fix