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
from google.auth import default
from google.auth.credentials import Credentials
def get_credentials() -> Credentials:
return default()
Repro steps
$ uv pip install google-auth==2.32.0 mypy==1.11.1
$ mypy --strict x.py
x.py:6: error: Returning Any from function declared to return "Credentials" [no-any-return]
x.py:6: error: Call to untyped function "default" in typed context [no-untyped-call]
Downgrading google-auth to 2.29.0 fixes this (in a way), since that version doesn't ship py.typed.
$ uv pip install 'google-auth<2.30.0'
- google-auth==2.32.0
+ google-auth==2.29.0
$ mypy --strict x.py
x.py:1: error: Skipping analyzing "google.auth": module is installed, but missing library stubs or py.typed marker [import-untyped]
x.py:2: error: Skipping analyzing "google.auth.credentials": module is installed, but missing library stubs or py.typed marker [import-untyped]
x.py:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
The "missing library stubs" errors can be ignored (by ignoring google.auth related typing things altogether using the instructions Mypy links there), but the no-any-return and no-untyped-call errors are harder to ignore.
In short, if the package ships py.typed, it should indeed be well typed.
The text was updated successfully, but these errors were encountered:
Environment details
uv
insteadgoogle-auth
version: google-auth==2.32.0Reproduction
x.py
Repro steps
Downgrading
google-auth
to 2.29.0 fixes this (in a way), since that version doesn't shippy.typed
.The "missing library stubs" errors can be ignored (by ignoring
google.auth
related typing things altogether using the instructions Mypy links there), but theno-any-return
andno-untyped-call
errors are harder to ignore.In short, if the package ships
py.typed
, it should indeed be well typed.The text was updated successfully, but these errors were encountered: