Skip to content
2 changes: 1 addition & 1 deletion .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/presubmit/presubmit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "system-3.8"
value: "system-3.12"
}
22 changes: 17 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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")


Expand Down Expand Up @@ -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")
Expand Down
5 changes: 4 additions & 1 deletion owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)