|
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", |
|
95 | 99 | "docs", |
96 | 100 | "docfx", |
97 | 101 | "format", |
| 102 | + "prerelease_deps", |
| 103 | + "core_deps_from_source", |
| 104 | + "mypy", |
98 | 105 | ] |
99 | 106 |
|
100 | 107 | # Error if a python version is missing |
@@ -193,7 +200,7 @@ def install_unittest_dependencies(session, *constraints): |
193 | 200 | session.run("pip", "list") |
194 | 201 |
|
195 | 202 |
|
196 | | -@nox.session(python=UNIT_TEST_PYTHON_VERSIONS) |
| 203 | +@nox.session(python=ALL_PYTHON) |
197 | 204 | @nox.parametrize( |
198 | 205 | "protobuf_implementation", |
199 | 206 | ["python", "upb", "cpp"], |
@@ -512,6 +519,14 @@ def prerelease_deps(session, protobuf_implementation, database_dialect): |
512 | 519 | ): |
513 | 520 | session.skip("cpp implementation is not supported in python 3.11+") |
514 | 521 |
|
| 522 | + # Sanity check: Only run tests if credentials or emulator are set. |
| 523 | + if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", "") and not os.environ.get( |
| 524 | + "SPANNER_EMULATOR_HOST", "" |
| 525 | + ): |
| 526 | + session.skip( |
| 527 | + "Credentials or emulator host must be set via environment variable" |
| 528 | + ) |
| 529 | + |
515 | 530 | # Install all dependencies |
516 | 531 | session.install("-e", ".[all, tests, tracing]") |
517 | 532 | unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES |
@@ -621,3 +636,19 @@ def prerelease_deps(session, protobuf_implementation, database_dialect): |
621 | 636 | "SKIP_BACKUP_TESTS": "true", |
622 | 637 | }, |
623 | 638 | ) |
| 639 | + |
| 640 | +@nox.session(python=DEFAULT_PYTHON_VERSION) |
| 641 | +def mypy(session): |
| 642 | + """Run the type checker.""" |
| 643 | + # TODO(https://github.com/googleapis/google-cloud-python/issues/16014): |
| 644 | + # Add mypy tests |
| 645 | + session.skip("mypy tests are not yet supported") |
| 646 | + |
| 647 | +@nox.session(python=DEFAULT_PYTHON_VERSION) |
| 648 | +def core_deps_from_source(session): |
| 649 | + """Run all tests with core dependencies installed from source |
| 650 | + rather than pulling the dependencies from PyPI. |
| 651 | + """ |
| 652 | + # TODO(https://github.com/googleapis/google-cloud-python/issues/16014): |
| 653 | + # Add core deps from source tests |
| 654 | + session.skip("Core deps from source tests are not yet supported") |
0 commit comments