From 47f3a42bd8802d30c147a875ddb2346e33bed102 Mon Sep 17 00:00:00 2001 From: Heba Alazzeh Date: Thu, 21 May 2026 23:39:59 +0000 Subject: [PATCH 01/14] test --- SUPPORT.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SUPPORT.md b/SUPPORT.md index 13c64a683c75..29cbc9bc2392 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -57,3 +57,4 @@ Consider using [Google Cloud Customer Care](https://cloud.google.com/support/?hl 1. Search for issues already opened (in this repository, those would be in ). If you find your problem already filed, just add any more context or details that seem appropriate. 2. If your problem has not been previously filed, file an issue. If you're filing in this repository, choose either the [bug report](https://github.com/googleapis/google-cloud-python/issues/new?template=bug_report.yaml) or [feature request](https://github.com/googleapis/google-cloud-python/issues/new?template=feature_request.yaml) template, fill in the details, and submit the issue with an informative title! + From f1680c2d1ae44f0f6d577e8c5b13e3a45b4627dd Mon Sep 17 00:00:00 2001 From: Heba Alazzeh Date: Wed, 27 May 2026 01:10:43 +0000 Subject: [PATCH 02/14] chore: add core_deps and prerelease_deps nox sessions --- packages/google-auth/noxfile.py | 184 +++++++++++++++++++++++++++++--- 1 file changed, 172 insertions(+), 12 deletions(-) diff --git a/packages/google-auth/noxfile.py b/packages/google-auth/noxfile.py index 70c113a98014..333d73b5571c 100644 --- a/packages/google-auth/noxfile.py +++ b/packages/google-auth/noxfile.py @@ -14,6 +14,7 @@ import os import pathlib +import re import shutil import nox @@ -33,6 +34,12 @@ ] DEFAULT_PYTHON_VERSION = "3.14" + +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450): +# Switch this to Python 3.15 alpha1 +# https://peps.python.org/pep-0790/ +PREVIEW_PYTHON_VERSION = "3.14" + UNIT_TEST_PYTHON_VERSIONS = [ "3.10", "3.11", @@ -42,6 +49,24 @@ ] ALL_PYTHON = UNIT_TEST_PYTHON_VERSIONS.copy() +UNIT_TEST_STANDARD_DEPENDENCIES = [ + "mock", + "asyncmock", + "pytest", + "pytest-cov", + "pytest-asyncio", +] +UNIT_TEST_EXTERNAL_DEPENDENCIES: list[str] = [] + +SYSTEM_TEST_STANDARD_DEPENDENCIES = [ + "mock", + "pytest", + "google-cloud-testutils", +] +SYSTEM_TEST_EXTERNAL_DEPENDENCIES: list[str] = [] +SYSTEM_TEST_EXTRAS: list[str] = [] +SYSTEM_TEST_EXTRAS_BY_PYTHON: dict[str, list[str]] = {} + # Error if a python version is missing nox.options.error_on_missing_interpreters = True @@ -111,7 +136,7 @@ def format(session): "--select", "I", "--fix", - f"--target-version=py{ALL_PYTHON[0].replace('.', '')}", + f"--target-version=py{UNIT_TEST_PYTHON_VERSIONS[0].replace('.', '')}", "--line-length=88", *BLACK_PATHS, ) @@ -143,7 +168,7 @@ def mypy(session): session.run("mypy", "-p", "google", "-p", "tests", "-p", "tests_async") -@nox.session(python=ALL_PYTHON) +@nox.session(python=UNIT_TEST_PYTHON_VERSIONS) @nox.parametrize(["install_deprecated_extras"], (True, False)) def unit(session, install_deprecated_extras): # Install all test dependencies, then install this package in-place. @@ -220,23 +245,158 @@ def docfx(session): session.skip("This package does not have documentation in cloud.google.com") -@nox.session(python=DEFAULT_PYTHON_VERSION) -def prerelease_deps(session): - """Run all tests with pre-release versions of dependencies installed + +@nox.session(python=PREVIEW_PYTHON_VERSION) +@nox.parametrize( + "protobuf_implementation", + ["python", "upb"], +) +def prerelease_deps(session, protobuf_implementation): + """ + Run all tests with pre-release versions of dependencies installed rather than the standard non pre-release versions. Pre-release versions can be installed using `pip install --pre `. """ - # TODO(https://github.com/googleapis/google-cloud-python/issues/16013): - # Add prerelease tests - session.skip("Prerelease tests are not yet supported") + + # Install all dependencies + session.install("-e", ".[testing,rsa]") + session.install("oauth2client") + + # Install dependencies for the unit test environment + unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES + session.install(*unit_deps_all) + + # Because we test minimum dependency versions on the minimum Python + # version, the first version we test with in the unit tests sessions has a + # constraints file containing all dependencies and extras. + with open( + CURRENT_DIRECTORY / "testing" / f"constraints-{ALL_PYTHON[0]}.txt", + encoding="utf-8", + ) as constraints_file: + constraints_text = constraints_file.read() + + # Ignore leading whitespace and comment lines. + constraints_deps = [ + match.group(1) + for match in re.finditer( + r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE + ) + ] + + # Install dependencies specified in `testing/constraints-X.txt`. + session.install(*constraints_deps) + + # Note: If a dependency is added to the `prerel_deps` list, + # the `core_dependencies_from_source` list in the `core_deps_from_source` + # nox session should also be updated. + prerel_deps = [ + "googleapis-common-protos", + "google-api-core", + "google-auth", + "grpc-google-iam-v1", + "grpcio>=1.75.1" if session.python >= "3.12" else "grpcio<=1.62.2", + "grpcio-status", + "protobuf", + "proto-plus", + ] + + for dep in prerel_deps: + session.install("--pre", "--no-deps", "--ignore-installed", dep) + # TODO(https://github.com/grpc/grpc/issues/38965): Add `grpcio-status`` + # to the dictionary below once this bug is fixed. + # TODO(https://github.com/googleapis/google-cloud-python/issues/13643): Add + # `googleapis-common-protos` and `grpc-google-iam-v1` to the dictionary below + # once this bug is fixed. + package_namespaces = { + "google-api-core": "google.api_core", + "google-auth": "google.auth", + "grpcio": "grpc", + "protobuf": "google.protobuf", + "proto-plus": "proto", + } + + version_namespace = package_namespaces.get(dep) + + print(f"Installed {dep}") + if version_namespace: + session.run( + "python", + "-c", + f"import {version_namespace}; print({version_namespace}.__version__)", + ) + + session.run( + "py.test", + "tests", + "tests_async", + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) @nox.session(python=DEFAULT_PYTHON_VERSION) -def core_deps_from_source(session): +@nox.parametrize( + "protobuf_implementation", + ["python", "upb"], +) +def core_deps_from_source(session, protobuf_implementation): """Run all tests with core dependencies installed from source rather than pulling the dependencies from PyPI. """ - # TODO(https://github.com/googleapis/google-cloud-python/issues/16013): - # Add prerelease tests - session.skip("Prerelease tests are not yet supported") + + # Install all dependencies + session.install("-e", ".[testing,rsa]") + session.install("oauth2client") + + # Install dependencies for the unit test environment + unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES + session.install(*unit_deps_all) + + # Because we test minimum dependency versions on the minimum Python + # version, the first version we test with in the unit tests sessions has a + # constraints file containing all dependencies and extras. + with open( + CURRENT_DIRECTORY / "testing" / f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt", + encoding="utf-8", + ) as constraints_file: + constraints_text = constraints_file.read() + + # Ignore leading whitespace and comment lines. + constraints_deps = [ + match.group(1) + for match in re.finditer( + r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE + ) + ] + + # Install dependencies specified in `testing/constraints-X.txt`. + session.install(*constraints_deps) + + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2358): `grpcio` and + # `grpcio-status` should be added to the list below so that they are installed from source, + # rather than PyPI. + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2357): `protobuf` should be + # added to the list below so that it is installed from source, rather than PyPI + # Note: If a dependency is added to the `core_dependencies_from_source` list, + # the `prerel_deps` list in the `prerelease_deps` nox session should also be updated. + core_dependencies_from_source = [ + "googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos", + "google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core", + "grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1", + "proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus", + ] + + for dep in core_dependencies_from_source: + session.install(dep, "--no-deps", "--ignore-installed") + print(f"Installed {dep}") + + session.run( + "py.test", + "tests", + "tests_async", + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) From 91b1724d1250521e8bc0c523fc80d988a897cd4d Mon Sep 17 00:00:00 2001 From: Heba Alazzeh Date: Wed, 27 May 2026 01:21:36 +0000 Subject: [PATCH 03/14] fix lint issues --- packages/google-auth/noxfile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google-auth/noxfile.py b/packages/google-auth/noxfile.py index 333d73b5571c..dd9bf1395b8b 100644 --- a/packages/google-auth/noxfile.py +++ b/packages/google-auth/noxfile.py @@ -245,7 +245,6 @@ def docfx(session): session.skip("This package does not have documentation in cloud.google.com") - @nox.session(python=PREVIEW_PYTHON_VERSION) @nox.parametrize( "protobuf_implementation", @@ -358,7 +357,9 @@ def core_deps_from_source(session, protobuf_implementation): # version, the first version we test with in the unit tests sessions has a # constraints file containing all dependencies and extras. with open( - CURRENT_DIRECTORY / "testing" / f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt", + CURRENT_DIRECTORY + / "testing" + / f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt", encoding="utf-8", ) as constraints_file: constraints_text = constraints_file.read() From c12f687987fa85dbad219eea1443b98eefd3471d Mon Sep 17 00:00:00 2001 From: Heba Alazzeh Date: Thu, 28 May 2026 23:24:31 +0000 Subject: [PATCH 04/14] Update SUPPORT.md --- SUPPORT.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/SUPPORT.md b/SUPPORT.md index 29cbc9bc2392..3cedbc31c82f 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -56,5 +56,3 @@ Consider using [Google Cloud Customer Care](https://cloud.google.com/support/?hl - Go to the correct repository, as identified above 1. Search for issues already opened (in this repository, those would be in ). If you find your problem already filed, just add any more context or details that seem appropriate. 2. If your problem has not been previously filed, file an issue. If you're filing in this repository, choose either the [bug report](https://github.com/googleapis/google-cloud-python/issues/new?template=bug_report.yaml) or [feature request](https://github.com/googleapis/google-cloud-python/issues/new?template=feature_request.yaml) template, fill in the details, and submit the issue with an informative title! - - From 67cdc11dda71957d1ca9f0e61d5d12f4b79266f2 Mon Sep 17 00:00:00 2001 From: Heba Alazzeh Date: Fri, 29 May 2026 17:00:12 +0000 Subject: [PATCH 05/14] wip --- packages/google-auth/noxfile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/google-auth/noxfile.py b/packages/google-auth/noxfile.py index dd9bf1395b8b..4982b7499550 100644 --- a/packages/google-auth/noxfile.py +++ b/packages/google-auth/noxfile.py @@ -317,6 +317,11 @@ def prerelease_deps(session, protobuf_implementation): version_namespace = package_namespaces.get(dep) +<<<<<<< HEAD +======= + # Reuse the parsed names for logging and version verification + for dep, pkg_name in prerel_deps: +>>>>>>> bbb07c3289e (wip) print(f"Installed {dep}") if version_namespace: session.run( From 913d73b1cc97f8e35e63f6155f7fc892888e8960 Mon Sep 17 00:00:00 2001 From: Heba Alazzeh Date: Fri, 29 May 2026 17:30:36 +0000 Subject: [PATCH 06/14] wip --- packages/google-auth/noxfile.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/google-auth/noxfile.py b/packages/google-auth/noxfile.py index 4982b7499550..6b621c0f8514 100644 --- a/packages/google-auth/noxfile.py +++ b/packages/google-auth/noxfile.py @@ -317,11 +317,8 @@ def prerelease_deps(session, protobuf_implementation): version_namespace = package_namespaces.get(dep) -<<<<<<< HEAD -======= # Reuse the parsed names for logging and version verification for dep, pkg_name in prerel_deps: ->>>>>>> bbb07c3289e (wip) print(f"Installed {dep}") if version_namespace: session.run( From c67c197d7de661c33d7a2b15cd50d190e51a339e Mon Sep 17 00:00:00 2001 From: Heba Alazzeh Date: Fri, 29 May 2026 18:02:09 +0000 Subject: [PATCH 07/14] revert SUPPORT.md --- SUPPORT.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SUPPORT.md b/SUPPORT.md index 3cedbc31c82f..13c64a683c75 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -56,3 +56,4 @@ Consider using [Google Cloud Customer Care](https://cloud.google.com/support/?hl - Go to the correct repository, as identified above 1. Search for issues already opened (in this repository, those would be in ). If you find your problem already filed, just add any more context or details that seem appropriate. 2. If your problem has not been previously filed, file an issue. If you're filing in this repository, choose either the [bug report](https://github.com/googleapis/google-cloud-python/issues/new?template=bug_report.yaml) or [feature request](https://github.com/googleapis/google-cloud-python/issues/new?template=feature_request.yaml) template, fill in the details, and submit the issue with an informative title! + From eaf606de58dd2d88ee754d90fe18e94d86c28a11 Mon Sep 17 00:00:00 2001 From: Heba Alazzeh Date: Fri, 29 May 2026 18:14:58 +0000 Subject: [PATCH 08/14] update prerelease_deps session dependencies --- packages/google-auth/noxfile.py | 109 +++----------------------------- 1 file changed, 9 insertions(+), 100 deletions(-) diff --git a/packages/google-auth/noxfile.py b/packages/google-auth/noxfile.py index 6b621c0f8514..81d4a8dd7540 100644 --- a/packages/google-auth/noxfile.py +++ b/packages/google-auth/noxfile.py @@ -244,7 +244,6 @@ def docfx(session): """Build the docfx yaml files for this library.""" session.skip("This package does not have documentation in cloud.google.com") - @nox.session(python=PREVIEW_PYTHON_VERSION) @nox.parametrize( "protobuf_implementation", @@ -290,109 +289,19 @@ def prerelease_deps(session, protobuf_implementation): # the `core_dependencies_from_source` list in the `core_deps_from_source` # nox session should also be updated. prerel_deps = [ - "googleapis-common-protos", - "google-api-core", - "google-auth", - "grpc-google-iam-v1", + "cryptography>=38.0.3", + "pyasn1-modules>=0.2.1", + "requests>=2.20.0,<3.0.0", + "aiohttp>=3.8.0,<3.10.0", + "urllib3", + "pyjwt>=2.0", + "pyopenssl<24.3.0", + "rsa>=3.1.4,<5", "grpcio>=1.75.1" if session.python >= "3.12" else "grpcio<=1.62.2", - "grpcio-status", - "protobuf", - "proto-plus", ] for dep in prerel_deps: session.install("--pre", "--no-deps", "--ignore-installed", dep) - # TODO(https://github.com/grpc/grpc/issues/38965): Add `grpcio-status`` - # to the dictionary below once this bug is fixed. - # TODO(https://github.com/googleapis/google-cloud-python/issues/13643): Add - # `googleapis-common-protos` and `grpc-google-iam-v1` to the dictionary below - # once this bug is fixed. - package_namespaces = { - "google-api-core": "google.api_core", - "google-auth": "google.auth", - "grpcio": "grpc", - "protobuf": "google.protobuf", - "proto-plus": "proto", - } - - version_namespace = package_namespaces.get(dep) - - # Reuse the parsed names for logging and version verification - for dep, pkg_name in prerel_deps: - print(f"Installed {dep}") - if version_namespace: - session.run( - "python", - "-c", - f"import {version_namespace}; print({version_namespace}.__version__)", - ) - - session.run( - "py.test", - "tests", - "tests_async", - env={ - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, - }, - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -@nox.parametrize( - "protobuf_implementation", - ["python", "upb"], -) -def core_deps_from_source(session, protobuf_implementation): - """Run all tests with core dependencies installed from source - rather than pulling the dependencies from PyPI. - """ - - # Install all dependencies - session.install("-e", ".[testing,rsa]") - session.install("oauth2client") - - # Install dependencies for the unit test environment - unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES - session.install(*unit_deps_all) - - # Because we test minimum dependency versions on the minimum Python - # version, the first version we test with in the unit tests sessions has a - # constraints file containing all dependencies and extras. - with open( - CURRENT_DIRECTORY - / "testing" - / f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt", - encoding="utf-8", - ) as constraints_file: - constraints_text = constraints_file.read() - - # Ignore leading whitespace and comment lines. - constraints_deps = [ - match.group(1) - for match in re.finditer( - r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE - ) - ] - - # Install dependencies specified in `testing/constraints-X.txt`. - session.install(*constraints_deps) - - # TODO(https://github.com/googleapis/gapic-generator-python/issues/2358): `grpcio` and - # `grpcio-status` should be added to the list below so that they are installed from source, - # rather than PyPI. - # TODO(https://github.com/googleapis/gapic-generator-python/issues/2357): `protobuf` should be - # added to the list below so that it is installed from source, rather than PyPI - # Note: If a dependency is added to the `core_dependencies_from_source` list, - # the `prerel_deps` list in the `prerelease_deps` nox session should also be updated. - core_dependencies_from_source = [ - "googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos", - "google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core", - "grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1", - "proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus", - ] - - for dep in core_dependencies_from_source: - session.install(dep, "--no-deps", "--ignore-installed") print(f"Installed {dep}") session.run( @@ -402,4 +311,4 @@ def core_deps_from_source(session, protobuf_implementation): env={ "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, }, - ) + ) \ No newline at end of file From 604fc4f6e304d0a9d017c9de3afb691af13dc74d Mon Sep 17 00:00:00 2001 From: Heba Alazzeh Date: Fri, 29 May 2026 18:28:50 +0000 Subject: [PATCH 09/14] removed unused system_test variables & fixed prerelease_deps --- packages/google-auth/noxfile.py | 79 ++++++++++++++++++++++++++++----- 1 file changed, 69 insertions(+), 10 deletions(-) diff --git a/packages/google-auth/noxfile.py b/packages/google-auth/noxfile.py index 81d4a8dd7540..6f7b2fbc0603 100644 --- a/packages/google-auth/noxfile.py +++ b/packages/google-auth/noxfile.py @@ -58,15 +58,6 @@ ] UNIT_TEST_EXTERNAL_DEPENDENCIES: list[str] = [] -SYSTEM_TEST_STANDARD_DEPENDENCIES = [ - "mock", - "pytest", - "google-cloud-testutils", -] -SYSTEM_TEST_EXTERNAL_DEPENDENCIES: list[str] = [] -SYSTEM_TEST_EXTRAS: list[str] = [] -SYSTEM_TEST_EXTRAS_BY_PYTHON: dict[str, list[str]] = {} - # Error if a python version is missing nox.options.error_on_missing_interpreters = True @@ -311,4 +302,72 @@ def prerelease_deps(session, protobuf_implementation): env={ "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, }, - ) \ No newline at end of file + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +@nox.parametrize( + "protobuf_implementation", + ["python", "upb"], +) +def core_deps_from_source(session, protobuf_implementation): + """Run all tests with core dependencies installed from source + rather than pulling the dependencies from PyPI. + """ + + # Install all dependencies + session.install("-e", ".[testing,rsa]") + session.install("oauth2client") + + # Install dependencies for the unit test environment + unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES + session.install(*unit_deps_all) + + # Because we test minimum dependency versions on the minimum Python + # version, the first version we test with in the unit tests sessions has a + # constraints file containing all dependencies and extras. + with open( + CURRENT_DIRECTORY + / "testing" + / f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt", + encoding="utf-8", + ) as constraints_file: + constraints_text = constraints_file.read() + + # Ignore leading whitespace and comment lines. + constraints_deps = [ + match.group(1) + for match in re.finditer( + r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE + ) + ] + + # Install dependencies specified in `testing/constraints-X.txt`. + session.install(*constraints_deps) + + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2358): `grpcio` and + # `grpcio-status` should be added to the list below so that they are installed from source, + # rather than PyPI. + # TODO(https://github.com/googleapis/gapic-generator-python/issues/2357): `protobuf` should be + # added to the list below so that it is installed from source, rather than PyPI + # Note: If a dependency is added to the `core_dependencies_from_source` list, + # the `prerel_deps` list in the `prerelease_deps` nox session should also be updated. + core_dependencies_from_source = [ + "googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos", + "google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core", + "grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1", + "proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus", + ] + + for dep in core_dependencies_from_source: + session.install(dep, "--no-deps", "--ignore-installed") + print(f"Installed {dep}") + + session.run( + "py.test", + "tests", + "tests_async", + env={ + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, + }, + ) From 222ff1ec78ebb2c851eda72bc08096f7640ea185 Mon Sep 17 00:00:00 2001 From: Heba Alazzeh Date: Fri, 29 May 2026 18:31:50 +0000 Subject: [PATCH 10/14] update core_deps_from_source --- packages/google-auth/noxfile.py | 65 +-------------------------------- 1 file changed, 2 insertions(+), 63 deletions(-) diff --git a/packages/google-auth/noxfile.py b/packages/google-auth/noxfile.py index 6f7b2fbc0603..b25bd0c3528d 100644 --- a/packages/google-auth/noxfile.py +++ b/packages/google-auth/noxfile.py @@ -304,70 +304,9 @@ def prerelease_deps(session, protobuf_implementation): }, ) - @nox.session(python=DEFAULT_PYTHON_VERSION) -@nox.parametrize( - "protobuf_implementation", - ["python", "upb"], -) -def core_deps_from_source(session, protobuf_implementation): +def core_deps_from_source(session): """Run all tests with core dependencies installed from source rather than pulling the dependencies from PyPI. """ - - # Install all dependencies - session.install("-e", ".[testing,rsa]") - session.install("oauth2client") - - # Install dependencies for the unit test environment - unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES - session.install(*unit_deps_all) - - # Because we test minimum dependency versions on the minimum Python - # version, the first version we test with in the unit tests sessions has a - # constraints file containing all dependencies and extras. - with open( - CURRENT_DIRECTORY - / "testing" - / f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt", - encoding="utf-8", - ) as constraints_file: - constraints_text = constraints_file.read() - - # Ignore leading whitespace and comment lines. - constraints_deps = [ - match.group(1) - for match in re.finditer( - r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE - ) - ] - - # Install dependencies specified in `testing/constraints-X.txt`. - session.install(*constraints_deps) - - # TODO(https://github.com/googleapis/gapic-generator-python/issues/2358): `grpcio` and - # `grpcio-status` should be added to the list below so that they are installed from source, - # rather than PyPI. - # TODO(https://github.com/googleapis/gapic-generator-python/issues/2357): `protobuf` should be - # added to the list below so that it is installed from source, rather than PyPI - # Note: If a dependency is added to the `core_dependencies_from_source` list, - # the `prerel_deps` list in the `prerelease_deps` nox session should also be updated. - core_dependencies_from_source = [ - "googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos", - "google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core", - "grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1", - "proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus", - ] - - for dep in core_dependencies_from_source: - session.install(dep, "--no-deps", "--ignore-installed") - print(f"Installed {dep}") - - session.run( - "py.test", - "tests", - "tests_async", - env={ - "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation, - }, - ) + session.skip("Skipping: Not applicable for google-auth.") From 4f1f6c85a01bb3d84b651ebc5d9b08c66525c48a Mon Sep 17 00:00:00 2001 From: Heba Alazzeh Date: Fri, 29 May 2026 18:46:06 +0000 Subject: [PATCH 11/14] consistent all_python usage --- packages/google-auth/noxfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-auth/noxfile.py b/packages/google-auth/noxfile.py index b25bd0c3528d..c7f23f011598 100644 --- a/packages/google-auth/noxfile.py +++ b/packages/google-auth/noxfile.py @@ -127,7 +127,7 @@ def format(session): "--select", "I", "--fix", - f"--target-version=py{UNIT_TEST_PYTHON_VERSIONS[0].replace('.', '')}", + f"--target-version=py{ALL_PYTHON[0].replace('.', '')}", "--line-length=88", *BLACK_PATHS, ) @@ -159,7 +159,7 @@ def mypy(session): session.run("mypy", "-p", "google", "-p", "tests", "-p", "tests_async") -@nox.session(python=UNIT_TEST_PYTHON_VERSIONS) +@nox.session(python=ALL_PYTHON) @nox.parametrize(["install_deprecated_extras"], (True, False)) def unit(session, install_deprecated_extras): # Install all test dependencies, then install this package in-place. @@ -309,4 +309,4 @@ def core_deps_from_source(session): """Run all tests with core dependencies installed from source rather than pulling the dependencies from PyPI. """ - session.skip("Skipping: Not applicable for google-auth.") + session.skip("Skipping: Not applicable for google-auth.") \ No newline at end of file From 316e68dc06de4490ba167f1bedc78c9b811118f8 Mon Sep 17 00:00:00 2001 From: Heba Alazzeh Date: Fri, 29 May 2026 19:42:11 +0000 Subject: [PATCH 12/14] address pr feedback --- packages/google-auth/noxfile.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/google-auth/noxfile.py b/packages/google-auth/noxfile.py index c7f23f011598..626ce27af614 100644 --- a/packages/google-auth/noxfile.py +++ b/packages/google-auth/noxfile.py @@ -280,15 +280,15 @@ def prerelease_deps(session, protobuf_implementation): # the `core_dependencies_from_source` list in the `core_deps_from_source` # nox session should also be updated. prerel_deps = [ - "cryptography>=38.0.3", - "pyasn1-modules>=0.2.1", - "requests>=2.20.0,<3.0.0", - "aiohttp>=3.8.0,<3.10.0", + "cryptography", + "pyasn1-modules", + "requests", + "aiohttp", "urllib3", - "pyjwt>=2.0", - "pyopenssl<24.3.0", - "rsa>=3.1.4,<5", - "grpcio>=1.75.1" if session.python >= "3.12" else "grpcio<=1.62.2", + "pyjwt", + "pyopenssl", + "rsa", + "grpcio", ] for dep in prerel_deps: From 8c53449c6e5a1821a9a84b0cd9e61124e4e091a2 Mon Sep 17 00:00:00 2001 From: Heba Alazzeh Date: Fri, 29 May 2026 19:44:30 +0000 Subject: [PATCH 13/14] fix lint --- packages/google-auth/noxfile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/google-auth/noxfile.py b/packages/google-auth/noxfile.py index 626ce27af614..39e8d5400ff0 100644 --- a/packages/google-auth/noxfile.py +++ b/packages/google-auth/noxfile.py @@ -235,6 +235,7 @@ def docfx(session): """Build the docfx yaml files for this library.""" session.skip("This package does not have documentation in cloud.google.com") + @nox.session(python=PREVIEW_PYTHON_VERSION) @nox.parametrize( "protobuf_implementation", @@ -283,7 +284,7 @@ def prerelease_deps(session, protobuf_implementation): "cryptography", "pyasn1-modules", "requests", - "aiohttp", + "aiohttp", "urllib3", "pyjwt", "pyopenssl", @@ -304,9 +305,10 @@ def prerelease_deps(session, protobuf_implementation): }, ) + @nox.session(python=DEFAULT_PYTHON_VERSION) def core_deps_from_source(session): """Run all tests with core dependencies installed from source rather than pulling the dependencies from PyPI. """ - session.skip("Skipping: Not applicable for google-auth.") \ No newline at end of file + session.skip("Skipping: Not applicable for google-auth.") From 7cdc0a81ff299479ca27e6b25347a9bfe9c7f77e Mon Sep 17 00:00:00 2001 From: Heba Alazzeh Date: Fri, 29 May 2026 23:23:09 +0000 Subject: [PATCH 14/14] update prerel_deps --- packages/google-auth/noxfile.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/google-auth/noxfile.py b/packages/google-auth/noxfile.py index 39e8d5400ff0..5962f96bf094 100644 --- a/packages/google-auth/noxfile.py +++ b/packages/google-auth/noxfile.py @@ -281,15 +281,19 @@ def prerelease_deps(session, protobuf_implementation): # the `core_dependencies_from_source` list in the `core_deps_from_source` # nox session should also be updated. prerel_deps = [ + # Note: We use --no-deps below to prevent prerelease updates. + # However, aiohttp 3.10+ introduced aiohappyeyeballs as a strict requirement. + # We must manually inject it here so the aiohttp pre-release doesn't crash on import. + "aiohappyeyeballs", + "aiohttp", "cryptography", + "grpcio", "pyasn1-modules", - "requests", - "aiohttp", - "urllib3", "pyjwt", "pyopenssl", + "requests", "rsa", - "grpcio", + "urllib3", ] for dep in prerel_deps: