Skip to content

Commit c02544d

Browse files
chalmerloweparthea
authored andcommitted
chore: apply monorepo cleanup to google-cloud-spanner
1 parent bb136ce commit c02544d

4 files changed

Lines changed: 33 additions & 7 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../CHANGELOG.md

packages/google-cloud-spanner/docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ For a list of all ``google-cloud-spanner`` releases:
5555
.. toctree::
5656
:maxdepth: 2
5757

58-
changelog
58+
CHANGELOG
5959

6060
.. toctree::
6161
:hidden:

packages/google-cloud-spanner/noxfile.py

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,17 @@
4242
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.14"]
4343

4444
UNIT_TEST_PYTHON_VERSIONS: List[str] = [
45+
"3.8",
4546
"3.9",
4647
"3.10",
4748
"3.11",
4849
"3.12",
4950
"3.13",
5051
"3.14",
5152
]
53+
54+
ALL_PYTHON = list(UNIT_TEST_PYTHON_VERSIONS)
55+
ALL_PYTHON.extend(["3.7"])
5256
UNIT_TEST_STANDARD_DEPENDENCIES = [
5357
"mock",
5458
"asyncmock",
@@ -96,6 +100,9 @@
96100
"docs",
97101
"docfx",
98102
"format",
103+
"prerelease_deps",
104+
"core_deps_from_source",
105+
"mypy",
99106
]
100107

101108
# Error if a python version is missing
@@ -194,7 +201,7 @@ def install_unittest_dependencies(session, *constraints):
194201
session.run("pip", "list")
195202

196203

197-
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
204+
@nox.session(python=ALL_PYTHON)
198205
@nox.parametrize(
199206
"protobuf_implementation",
200207
["python", "upb", "cpp"],
@@ -559,6 +566,14 @@ def prerelease_deps(session, protobuf_implementation, database_dialect):
559566
):
560567
session.skip("cpp implementation is not supported in python 3.11+")
561568

569+
# Sanity check: Only run tests if credentials or emulator are set.
570+
if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", "") and not os.environ.get(
571+
"SPANNER_EMULATOR_HOST", ""
572+
):
573+
session.skip(
574+
"Credentials or emulator host must be set via environment variable"
575+
)
576+
562577
# Install all dependencies
563578
session.install("-e", ".[all, tests, tracing]")
564579
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
@@ -673,9 +688,18 @@ def prerelease_deps(session, protobuf_implementation, database_dialect):
673688
},
674689
)
675690

691+
@nox.session(python=DEFAULT_PYTHON_VERSION)
692+
def mypy(session):
693+
"""Run the type checker."""
694+
# TODO(https://github.com/googleapis/google-cloud-python/issues/16014):
695+
# Add mypy tests
696+
session.skip("mypy tests are not yet supported")
676697

677698
@nox.session(python=DEFAULT_PYTHON_VERSION)
678-
def generate(session):
679-
"""Regenerate synchronous code from asynchronous code."""
680-
session.install("black", "autoflake")
681-
session.run("python", ".cross_sync/generate.py", "google/cloud/spanner_v1")
699+
def core_deps_from_source(session):
700+
"""Run all tests with core dependencies installed from source
701+
rather than pulling the dependencies from PyPI.
702+
"""
703+
# TODO(https://github.com/googleapis/google-cloud-python/issues/16014):
704+
# Add core deps from source tests
705+
session.skip("Core deps from source tests are not yet supported")

packages/google-cloud-spanner/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
"License :: OSI Approved :: Apache Software License",
8888
"Programming Language :: Python",
8989
"Programming Language :: Python :: 3",
90+
"Programming Language :: Python :: 3.8",
9091
"Programming Language :: Python :: 3.9",
9192
"Programming Language :: Python :: 3.10",
9293
"Programming Language :: Python :: 3.11",
@@ -99,7 +100,7 @@
99100
packages=packages,
100101
install_requires=dependencies,
101102
extras_require=extras,
102-
python_requires=">=3.9",
103+
python_requires=">=3.8",
103104
include_package_data=True,
104105
zip_safe=False,
105106
)

0 commit comments

Comments
 (0)