|
42 | 42 | SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.14"] |
43 | 43 |
|
44 | 44 | UNIT_TEST_PYTHON_VERSIONS: List[str] = [ |
| 45 | + "3.8", |
45 | 46 | "3.9", |
46 | 47 | "3.10", |
47 | 48 | "3.11", |
48 | 49 | "3.12", |
49 | 50 | "3.13", |
50 | 51 | "3.14", |
51 | 52 | ] |
| 53 | + |
| 54 | +ALL_PYTHON = list(UNIT_TEST_PYTHON_VERSIONS) |
| 55 | +ALL_PYTHON.extend(["3.7"]) |
52 | 56 | UNIT_TEST_STANDARD_DEPENDENCIES = [ |
53 | 57 | "mock", |
54 | 58 | "asyncmock", |
|
96 | 100 | "docs", |
97 | 101 | "docfx", |
98 | 102 | "format", |
| 103 | + "prerelease_deps", |
| 104 | + "core_deps_from_source", |
| 105 | + "mypy", |
99 | 106 | ] |
100 | 107 |
|
101 | 108 | # Error if a python version is missing |
@@ -194,7 +201,7 @@ def install_unittest_dependencies(session, *constraints): |
194 | 201 | session.run("pip", "list") |
195 | 202 |
|
196 | 203 |
|
197 | | -@nox.session(python=UNIT_TEST_PYTHON_VERSIONS) |
| 204 | +@nox.session(python=ALL_PYTHON) |
198 | 205 | @nox.parametrize( |
199 | 206 | "protobuf_implementation", |
200 | 207 | ["python", "upb", "cpp"], |
@@ -559,6 +566,14 @@ def prerelease_deps(session, protobuf_implementation, database_dialect): |
559 | 566 | ): |
560 | 567 | session.skip("cpp implementation is not supported in python 3.11+") |
561 | 568 |
|
| 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 | + |
562 | 577 | # Install all dependencies |
563 | 578 | session.install("-e", ".[all, tests, tracing]") |
564 | 579 | unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES |
@@ -673,9 +688,18 @@ def prerelease_deps(session, protobuf_implementation, database_dialect): |
673 | 688 | }, |
674 | 689 | ) |
675 | 690 |
|
| 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") |
676 | 697 |
|
677 | 698 | @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") |
0 commit comments