google-auth-stubs provides type stubs for the `google-auth` library, enabling static type checking (e.g., with MyPy) for Google authentication code. It helps catch type-related errors at development time without affecting runtime behavior. The current version is 0.3.0, with releases occurring as needed to support new `google-auth` versions or add type elaborations.
pip install google-auth-stubsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates a basic `google-auth` flow. The `google-auth-stubs` library provides type hints for all components used here, enhancing static analysis when this code is run through a type checker like MyPy.
Ensure `google-auth` is included in your project's runtime dependencies (`pip install google-auth`).
Try to keep `google-auth-stubs` and `google-auth` versions as close as possible. Check the `google-auth-stubs` changelog for specific `google-auth` versions it targets.
Ensure your development environment uses a compatible Python version (e.g., Python 3.8, 3.9, 3.10, 3.11).
Ensure `google-auth-stubs` is installed in the same environment as `google-auth` using `pip install google-auth-stubs`. Also, verify your MyPy configuration includes the environment where `google-auth-stubs` is installed.
Install the type stubs using `pip install google-auth-stubs`. If already installed, ensure your MyPy configuration (`mypy.ini` or command-line arguments) correctly points to your project's environment where stubs are installed, or run `mypy --install-types` to automatically install missing stubs from `typeshed`.
Ensure `google-auth` and related libraries like `google-auth-oauthlib` or `google-auth-httplib2` are up to date (`pip install --upgrade google-auth google-auth-oauthlib google-auth-httplib2`). Verify that the `Credentials` object is properly initialized and, if needed, wrapped with a transport (`google.auth.transport.requests.AuthorizedSession`) before making requests. Consult the `google-auth` documentation for the correct way to use specific `Credentials` types and their associated transport methods. While stubs can highlight type issues, this specific error often points to a runtime logic problem.
No dependency data recorded yet.