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' 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 diff --git a/noxfile.py b/noxfile.py index be3a05c455..107437249e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -32,9 +32,11 @@ 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" +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", @@ -77,7 +78,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", @@ -108,7 +115,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) @@ -141,7 +150,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") @@ -321,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") diff --git a/owlbot.py b/owlbot.py index 3f72a35599..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, @@ -258,4 +259,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)