Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,19 @@ executors:
- image: python:3.12.13
resource_class: small

python313:
docker:
- image: python:3.13.12
resource_class: small

python314:
docker:
- image: python:3.14.3
resource_class: small

python-integration:
docker:
- image: python:3.12.13
- image: python:3.14.3
environment:
GOOGLE_APPLICATION_CREDENTIALS: /key.json
resource_class: small
Expand Down Expand Up @@ -54,7 +64,7 @@ commands:

jobs:
build-rest:
executor: python312
executor: python314
steps:
- poetry/install:
# renovate: datasource=pypi depName=poetry
Expand All @@ -67,7 +77,7 @@ jobs:
# gcloud-rest builds in a matrix (eg. without having `cwd` be a complicated
# path which breaks the tag filter).
poetry-publish-workspace:
executor: python312
executor: python314
parameters:
basedir:
enum: [/rest, /root/project]
Expand Down Expand Up @@ -95,7 +105,7 @@ jobs:
working_directory: <<parameters.basedir>>/<<parameters.cwd>>

docs:
executor: python312
executor: python314
steps:
- run: pip install sphinx sphinx-autoapi
- checkout
Expand Down Expand Up @@ -184,7 +194,7 @@ workflows:
alias: test-unit-aio
parameters:
cwd: [auth, bigquery, datastore, kms, pubsub, storage, taskqueue]
executor: [python310, python311, python312]
executor: [python310, python311, python312, python313, python314]
filters:
tags:
only: /.*/
Expand Down Expand Up @@ -223,7 +233,7 @@ workflows:
alias: test-unit-rest
parameters:
cwd: [/rest/auth, /rest/bigquery, /rest/datastore, /rest/kms, /rest/pubsub, /rest/storage, /rest/taskqueue]
executor: [python310, python311, python312]
executor: [python310, python311, python312, python313, python314]
filters:
tags:
only: /.*/
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ repos:
# `types-$lib` or `$lib-stubs`.
additional_dependencies:
- aiohttp==3.13.3
- backoff==2.2.1
- cryptography==46.0.6
- pyjwt==2.12.1
- tenacity==9.1.2
- types-requests==2.32.4.20260324
args:
- --show-error-codes
Expand Down
12 changes: 10 additions & 2 deletions auth/gcloud/aio/auth/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
from urllib.parse import urlencode
from urllib.parse import urlparse

import backoff
import cryptography # pylint: disable=unused-import
import jwt
from tenacity import retry
from tenacity import retry_if_exception_type
from tenacity import stop_after_attempt
from tenacity import wait_random_exponential

from .build_constants import BUILD_GCLOUD_REST
from .session import AioSession
Expand Down Expand Up @@ -276,7 +279,12 @@ async def ensure_token(self) -> None:
async def refresh(self, *, timeout: int) -> TokenResponse:
pass

@backoff.on_exception(backoff.expo, Exception, max_tries=5)
@retry(
retry=retry_if_exception_type(Exception),
stop=stop_after_attempt(5),
wait=wait_random_exponential(multiplier=1, max=60),
reraise=True,
)
async def acquire_access_token(self, timeout: int = 10) -> None:
resp = await self.refresh(timeout=timeout)

Expand Down
38 changes: 21 additions & 17 deletions auth/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading