From 99b287d7516479bbf90b4b6a548ca18f0b7018cc Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 2 Jul 2025 12:17:50 +0000 Subject: [PATCH 01/11] tests: update default runtime used for tests --- .kokoro/presubmit/integration-multiplexed-sessions-enabled.cfg | 2 +- .kokoro/presubmit/presubmit.cfg | 2 +- .kokoro/presubmit/{system-3.8.cfg => system-3.12.cfg} | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename .kokoro/presubmit/{system-3.8.cfg => system-3.12.cfg} (82%) diff --git a/.kokoro/presubmit/integration-multiplexed-sessions-enabled.cfg b/.kokoro/presubmit/integration-multiplexed-sessions-enabled.cfg index 77ed7f9bab..c569d27a45 100644 --- a/.kokoro/presubmit/integration-multiplexed-sessions-enabled.cfg +++ b/.kokoro/presubmit/integration-multiplexed-sessions-enabled.cfg @@ -3,7 +3,7 @@ # Only run a subset of all nox sessions env_vars: { key: "NOX_SESSION" - value: "unit-3.8 unit-3.12 system-3.8" + value: "unit-3.9 unit-3.12 system-3.12" } env_vars: { diff --git a/.kokoro/presubmit/presubmit.cfg b/.kokoro/presubmit/presubmit.cfg index 14db9152d9..109c14c49a 100644 --- a/.kokoro/presubmit/presubmit.cfg +++ b/.kokoro/presubmit/presubmit.cfg @@ -3,5 +3,5 @@ # Only run a subset of all nox sessions env_vars: { key: "NOX_SESSION" - value: "unit-3.8 unit-3.12 cover docs docfx" + value: "unit-3.9 unit-3.12 cover docs docfx" } diff --git a/.kokoro/presubmit/system-3.8.cfg b/.kokoro/presubmit/system-3.12.cfg similarity index 82% rename from .kokoro/presubmit/system-3.8.cfg rename to .kokoro/presubmit/system-3.12.cfg index f4bcee3db0..78cdc5e851 100644 --- a/.kokoro/presubmit/system-3.8.cfg +++ b/.kokoro/presubmit/system-3.12.cfg @@ -3,5 +3,5 @@ # Only run this nox session. env_vars: { key: "NOX_SESSION" - value: "system-3.8" + value: "system-3.12" } \ No newline at end of file From 5736069c2cced7c73815b1bec4eb9f3a69ecc834 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 2 Jul 2025 12:27:52 +0000 Subject: [PATCH 02/11] set default python runtime used for tests to 3.12 --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index be3a05c455..3490ac9e56 100644 --- a/noxfile.py +++ b/noxfile.py @@ -32,7 +32,7 @@ ISORT_VERSION = "isort==5.11.0" LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] -DEFAULT_PYTHON_VERSION = "3.8" +DEFAULT_PYTHON_VERSION = "3.12" DEFAULT_MOCK_SERVER_TESTS_PYTHON_VERSION = "3.12" UNIT_TEST_PYTHON_VERSIONS: List[str] = [ From 4f3cb4f30a79898ef963ce0ca0583747398d5eff Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 2 Jul 2025 12:29:25 +0000 Subject: [PATCH 03/11] Use python 3.10 for blacken nox session, which is the latest version available in the python post processor --- noxfile.py | 4 +++- owlbot.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 3490ac9e56..5c72ad651b 100644 --- a/noxfile.py +++ b/noxfile.py @@ -108,7 +108,9 @@ def lint(session): session.run("flake8", "google", "tests") -@nox.session(python=DEFAULT_PYTHON_VERSION) +# Use a python runtime which is available in the owlbot post processor here +# https://github.com/googleapis/synthtool/blob/master/docker/owlbot/python/Dockerfile +@nox.session(python=["3.10", DEFAULT_PYTHON_VERSION]) def blacken(session): """Run black. Format code to uniform standard.""" session.install(BLACK_VERSION) diff --git a/owlbot.py b/owlbot.py index 3f72a35599..8c88849046 100644 --- a/owlbot.py +++ b/owlbot.py @@ -258,4 +258,6 @@ def get_staging_dirs( python.py_samples() -s.shell.run(["nox", "-s", "blacken"], hide_output=False) +# Use a python runtime which is available in the owlbot post processor here +# https://github.com/googleapis/synthtool/blob/master/docker/owlbot/python/Dockerfile +s.shell.run(["nox", "-s", "blacken-3.10"], hide_output=False) From 9875a75aeed296214cda7b1627f67d2efe4618fb Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 2 Jul 2025 12:32:43 +0000 Subject: [PATCH 04/11] update sync-repo-settings.yaml --- .github/sync-repo-settings.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 5ee2bca9f9..5b2a506d17 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -8,7 +8,7 @@ branchProtectionRules: requiresStrictStatusChecks: true requiredStatusCheckContexts: - 'Kokoro' - - 'Kokoro system-3.8' + - 'Kokoro system-3.12' - 'cla/google' - 'Samples - Lint' - 'Samples - Python 3.8' From f8050c8897dc4719429eb7d6966812e6a254796a Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 2 Jul 2025 12:33:37 +0000 Subject: [PATCH 05/11] install setuptools for lint_setup_py --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 5c72ad651b..fa4d42e092 100644 --- a/noxfile.py +++ b/noxfile.py @@ -143,7 +143,7 @@ def format(session): @nox.session(python=DEFAULT_PYTHON_VERSION) def lint_setup_py(session): """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") + session.install("docutils", "pygments", "setuptools>=79.0.1") session.run("python", "setup.py", "check", "--restructuredtext", "--strict") From 3680c758f20c5e7a8ddb4113280adbb23798d9ff Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 2 Jul 2025 12:35:38 +0000 Subject: [PATCH 06/11] remove unit 3.7/3.8 in default nox session --- noxfile.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index fa4d42e092..4f10437c75 100644 --- a/noxfile.py +++ b/noxfile.py @@ -77,7 +77,13 @@ CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() nox.options.sessions = [ - "unit", + # TODO(https://github.com/googleapis/python-spanner/issues/1392): + # 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", "system", "cover", "lint", From cea40daffe4fb47956326cb0e717e5477a09089f Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 2 Jul 2025 12:36:38 +0000 Subject: [PATCH 07/11] update python runtime in system tests to 3.12 --- noxfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 4f10437c75..812be02039 100644 --- a/noxfile.py +++ b/noxfile.py @@ -35,6 +35,8 @@ DEFAULT_PYTHON_VERSION = "3.12" DEFAULT_MOCK_SERVER_TESTS_PYTHON_VERSION = "3.12" +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.12"] + UNIT_TEST_PYTHON_VERSIONS: List[str] = [ "3.7", "3.8", @@ -60,7 +62,6 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8"] SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [ "mock", "pytest", From 3e72ac4b723f2162ae91450ccb00d9f6467eef32 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 2 Jul 2025 12:39:30 +0000 Subject: [PATCH 08/11] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-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 --- .kokoro/presubmit/system-3.8.cfg | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .kokoro/presubmit/system-3.8.cfg diff --git a/.kokoro/presubmit/system-3.8.cfg b/.kokoro/presubmit/system-3.8.cfg new file mode 100644 index 0000000000..f4bcee3db0 --- /dev/null +++ b/.kokoro/presubmit/system-3.8.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Only run this nox session. +env_vars: { + key: "NOX_SESSION" + value: "system-3.8" +} \ No newline at end of file From 3f77d73fe814bc79b1296a75e3dca6353b7b7570 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 3 Jul 2025 00:47:56 +0000 Subject: [PATCH 09/11] remove obsolete config --- .kokoro/presubmit/system-3.8.cfg | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 .kokoro/presubmit/system-3.8.cfg diff --git a/.kokoro/presubmit/system-3.8.cfg b/.kokoro/presubmit/system-3.8.cfg deleted file mode 100644 index f4bcee3db0..0000000000 --- a/.kokoro/presubmit/system-3.8.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Only run this nox session. -env_vars: { - key: "NOX_SESSION" - value: "system-3.8" -} \ No newline at end of file From 75be9c93009c33a6a51a071277de328cd7826039 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 3 Jul 2025 00:48:22 +0000 Subject: [PATCH 10/11] set python 3.12 as runtime for system test --- owlbot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/owlbot.py b/owlbot.py index 8c88849046..ce4b00af28 100644 --- a/owlbot.py +++ b/owlbot.py @@ -225,6 +225,7 @@ def get_staging_dirs( cov_level=98, split_system_tests=True, system_test_extras=["tracing"], + system_test_python_versions=["3.12"] ) s.move( templated_files, From 5d89725190c0167433bb2a9b23fb6267d844aa0b Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 3 Jul 2025 00:49:56 +0000 Subject: [PATCH 11/11] exclude cpp for python 3.11+ --- noxfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/noxfile.py b/noxfile.py index 812be02039..107437249e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -330,6 +330,9 @@ def system(session, protobuf_implementation, database_dialect): "Only run system tests on real Spanner with one protobuf implementation to speed up the build" ) + if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"): + session.skip("cpp implementation is not supported in python 3.11+") + # Install pyopenssl for mTLS testing. if os.environ.get("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true": session.install("pyopenssl")