Closed B3QL closed 5 months ago
google-auth
google.oauth2.id_token
Hi folks, it looks like google.oauth2.id_token has an import time dependency of google.auth.transport.requests https://github.com/googleapis/google-auth-library-python/blob/main/google/oauth2/id_token.py#L65
google.auth.transport.requests
which requires a requests package https://github.com/googleapis/google-auth-library-python/blob/main/google/auth/transport/requests.py#L25
requests
that's not defined as a google-auth dependency. https://github.com/googleapis/google-auth-library-python/blob/main/setup.py#L22
The call to google.auth.transport.requests is only made once in https://github.com/googleapis/google-auth-library-python/blob/main/google/oauth2/id_token.py#L285 so the possible solution will be to move the import to runtime.
Thank you for pointing this out. Yes the code is not following the existing pattern of a runtime import if a request object is not passed in.
Environment details
google-auth
version: 2.26.2Steps to reproduce
google-auth
google.oauth2.id_token
moduleHi folks, it looks like
google.oauth2.id_token
has an import time dependency ofgoogle.auth.transport.requests
https://github.com/googleapis/google-auth-library-python/blob/main/google/oauth2/id_token.py#L65which requires a
requests
package https://github.com/googleapis/google-auth-library-python/blob/main/google/auth/transport/requests.py#L25that's not defined as a
google-auth
dependency. https://github.com/googleapis/google-auth-library-python/blob/main/setup.py#L22The call to
google.auth.transport.requests
is only made once in https://github.com/googleapis/google-auth-library-python/blob/main/google/oauth2/id_token.py#L285 so the possible solution will be to move the import to runtime.