From 73aa77524bf7f51aae5e38d413b847444e596886 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 3 Jul 2025 15:56:26 +0000 Subject: [PATCH 1/7] tests: update default runtime used for tests --- noxfile.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/noxfile.py b/noxfile.py index b0f7f2d5a00..1a45517f58b 100644 --- a/noxfile.py +++ b/noxfile.py @@ -31,6 +31,8 @@ "setup.py", ] +DEFAULT_PYTHON_VERSION = "3.12" + test_dependencies = [ "django>=2.0.0", "google-auth", @@ -45,8 +47,23 @@ "coverage", ] +nox.options.sessions = [ + # TODO(https://github.com/googleapis/google-api-python-client/issues/2622): + # Remove or restore testing for Python 3.7/3.8 + "unit-3.9", + "unit-3.10", + "unit-3.11", + "unit-3.12", + "unit-3.13", + "lint", + "format", + "scripts", +] + +# Error if a python version is missing +nox.options.error_on_missing_interpreters = True -@nox.session(python=["3.7"]) +@nox.session(python=DEFAULT_PYTHON_VERSION) def lint(session): session.install("flake8") session.run( @@ -60,7 +77,7 @@ def lint(session): ) -@nox.session(python="3.8") +@nox.session(python=DEFAULT_PYTHON_VERSION) def format(session): """ Run isort to sort imports. Then run black @@ -128,7 +145,7 @@ def unit(session, oauth2client): ) -@nox.session(python=["3.9"]) +@nox.session(python=DEFAULT_PYTHON_VERSION) def scripts(session): session.install(*test_dependencies) session.install("-e", ".") From 48ed9a2a93fef1f00629b4fc2165592e7be58502 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 3 Jul 2025 16:19:06 +0000 Subject: [PATCH 2/7] fix presubmit --- noxfile.py | 3 ++- owlbot.py | 10 +++------- samples/compute/noxfile.py | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/noxfile.py b/noxfile.py index b468d9c908d..d27a77bd7e6 100644 --- a/noxfile.py +++ b/noxfile.py @@ -63,6 +63,7 @@ # Error if a python version is missing nox.options.error_on_missing_interpreters = True + @nox.session(python=DEFAULT_PYTHON_VERSION) def lint(session): session.install("flake8") @@ -77,7 +78,7 @@ def lint(session): ) -@nox.session(python=DEFAULT_PYTHON_VERSION) +@nox.session(python=["3.10", DEFAULT_PYTHON_VERSION]) def format(session): """ Run isort to sort imports. Then run black diff --git a/owlbot.py b/owlbot.py index 4613f1d67d9..38185a14cb7 100644 --- a/owlbot.py +++ b/owlbot.py @@ -46,11 +46,7 @@ # Copy configuration file for renovate s.move(templated_files / "renovate.json") -# ---------------------------------------------------------------------------- -# Samples templates -# ---------------------------------------------------------------------------- - -python.py_samples(skip_readmes=True) - +# Use a python runtime which is available in the owlbot post processor here +# https://github.com/googleapis/synthtool/blob/master/docker/owlbot/python/Dockerfile for noxfile in Path(".").glob("**/noxfile.py"): - s.shell.run(["nox", "-s", "format"], cwd=noxfile.parent, hide_output=False) + s.shell.run(["nox", "-s", "format-3.10"], cwd=noxfile.parent, hide_output=False) diff --git a/samples/compute/noxfile.py b/samples/compute/noxfile.py index 494639d2fa5..3d3fff9717b 100644 --- a/samples/compute/noxfile.py +++ b/samples/compute/noxfile.py @@ -160,7 +160,7 @@ def blacken(session: nox.sessions.Session) -> None: # -@nox.session +@nox.session(python=["3.10"]) def format(session: nox.sessions.Session) -> None: """ Run isort to sort imports. Then run black From 9d5142aa1dec928db2717f41f8433a5e56695a48 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 3 Jul 2025 16:23:54 +0000 Subject: [PATCH 3/7] update default version to 3.10 --- noxfile.py | 2 +- samples/compute/noxfile.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index d27a77bd7e6..106deb02d9b 100644 --- a/noxfile.py +++ b/noxfile.py @@ -31,7 +31,7 @@ "setup.py", ] -DEFAULT_PYTHON_VERSION = "3.12" +DEFAULT_PYTHON_VERSION = "3.10" test_dependencies = [ "django>=2.0.0", diff --git a/samples/compute/noxfile.py b/samples/compute/noxfile.py index 3d3fff9717b..52fe34cfb59 100644 --- a/samples/compute/noxfile.py +++ b/samples/compute/noxfile.py @@ -160,7 +160,7 @@ def blacken(session: nox.sessions.Session) -> None: # -@nox.session(python=["3.10"]) +@nox.session(python=["3.10", "3.12"]) def format(session: nox.sessions.Session) -> None: """ Run isort to sort imports. Then run black From a71459ae0bc8a2f931da333c16d9733d419cf245 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 3 Jul 2025 16:24:51 +0000 Subject: [PATCH 4/7] update format session --- noxfile.py | 2 +- samples/compute/noxfile.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 106deb02d9b..218a31bfa0c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -78,7 +78,7 @@ def lint(session): ) -@nox.session(python=["3.10", DEFAULT_PYTHON_VERSION]) +@nox.session(python=DEFAULT_PYTHON_VERSION) def format(session): """ Run isort to sort imports. Then run black diff --git a/samples/compute/noxfile.py b/samples/compute/noxfile.py index 52fe34cfb59..3d3fff9717b 100644 --- a/samples/compute/noxfile.py +++ b/samples/compute/noxfile.py @@ -160,7 +160,7 @@ def blacken(session: nox.sessions.Session) -> None: # -@nox.session(python=["3.10", "3.12"]) +@nox.session(python=["3.10"]) def format(session: nox.sessions.Session) -> None: """ Run isort to sort imports. Then run black From 3aa934e107b1a25b3c19fc4c997096d2953e88f0 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 3 Jul 2025 12:25:43 -0400 Subject: [PATCH 5/7] revert --- owlbot.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/owlbot.py b/owlbot.py index 38185a14cb7..4613f1d67d9 100644 --- a/owlbot.py +++ b/owlbot.py @@ -46,7 +46,11 @@ # Copy configuration file for renovate s.move(templated_files / "renovate.json") -# Use a python runtime which is available in the owlbot post processor here -# https://github.com/googleapis/synthtool/blob/master/docker/owlbot/python/Dockerfile +# ---------------------------------------------------------------------------- +# Samples templates +# ---------------------------------------------------------------------------- + +python.py_samples(skip_readmes=True) + for noxfile in Path(".").glob("**/noxfile.py"): - s.shell.run(["nox", "-s", "format-3.10"], cwd=noxfile.parent, hide_output=False) + s.shell.run(["nox", "-s", "format"], cwd=noxfile.parent, hide_output=False) From ef0ddbeff6ff0652f29557aa16dcf01cbbf47bd8 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 3 Jul 2025 12:26:20 -0400 Subject: [PATCH 6/7] revert --- samples/compute/noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/compute/noxfile.py b/samples/compute/noxfile.py index 3d3fff9717b..494639d2fa5 100644 --- a/samples/compute/noxfile.py +++ b/samples/compute/noxfile.py @@ -160,7 +160,7 @@ def blacken(session: nox.sessions.Session) -> None: # -@nox.session(python=["3.10"]) +@nox.session def format(session: nox.sessions.Session) -> None: """ Run isort to sort imports. Then run black From df7ad1cbcf06004d9632215b0b1b1fc1ce69fd89 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 3 Jul 2025 16:29:56 +0000 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- samples/compute/noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/compute/noxfile.py b/samples/compute/noxfile.py index 3d3fff9717b..494639d2fa5 100644 --- a/samples/compute/noxfile.py +++ b/samples/compute/noxfile.py @@ -160,7 +160,7 @@ def blacken(session: nox.sessions.Session) -> None: # -@nox.session(python=["3.10"]) +@nox.session def format(session: nox.sessions.Session) -> None: """ Run isort to sort imports. Then run black