| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 229b492 commit 87d6b31
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,5 +13,5 @@ | |||
| 13 | 13 | # limitations under the License. | |
| 14 | 14 | docker: | |
| 15 | 15 | image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest | |
| 16 | - digest: sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 | ||
| 17 | - # created: 2022-05-05T22:08:23.383410683Z | ||
| 16 | + digest: sha256:65e656411895bff71cffcae97246966460160028f253c2e45b7a25d805a5b142 | ||
| 17 | + # created: 2022-06-12T13:11:45.905884945Z | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,7 @@ | |||
| 1 | + # Format: //devtools/kokoro/config/proto/build.proto | ||
| 2 | + | ||
| 3 | + # Only run this nox session. | ||
| 4 | + env_vars: { | ||
| 5 | + key: "NOX_SESSION" | ||
| 6 | + value: "prerelease_deps" | ||
| 7 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,7 @@ | |||
| 1 | + # Format: //devtools/kokoro/config/proto/build.proto | ||
| 2 | + | ||
| 3 | + # Only run this nox session. | ||
| 4 | + env_vars: { | ||
| 5 | + key: "NOX_SESSION" | ||
| 6 | + value: "prerelease_deps" | ||
| 7 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -363,3 +363,67 @@ def docfx(session): | |||
| 363 | 363 | os.path.join("docs", ""), | |
| 364 | 364 | os.path.join("docs", "_build", "html", ""), | |
| 365 | 365 | ) | |
| 366 | + | ||
| 367 | + | ||
| 368 | + @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) | ||
| 369 | + def prerelease_deps(session): | ||
| 370 | + """Run all tests with prerelease versions of dependencies installed.""" | ||
| 371 | + | ||
| 372 | + prerel_deps = [ | ||
| 373 | + "protobuf", | ||
| 374 | + "googleapis-common-protos", | ||
| 375 | + "google-auth", | ||
| 376 | + "grpcio", | ||
| 377 | + "grpcio-status", | ||
| 378 | + "google-api-core", | ||
| 379 | + "proto-plus", | ||
| 380 | + # dependencies of google-auth | ||
| 381 | + "cryptography", | ||
| 382 | + "pyasn1", | ||
| 383 | + ] | ||
| 384 | + | ||
| 385 | + for dep in prerel_deps: | ||
| 386 | + session.install("--pre", "--no-deps", "--upgrade", dep) | ||
| 387 | + | ||
| 388 | + # Remaining dependencies | ||
| 389 | + other_deps = ["requests"] | ||
| 390 | + session.install(*other_deps) | ||
| 391 | + | ||
| 392 | + session.install(*UNIT_TEST_STANDARD_DEPENDENCIES) | ||
| 393 | + session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES) | ||
| 394 | + | ||
| 395 | + # Because we test minimum dependency versions on the minimum Python | ||
| 396 | + # version, the first version we test with in the unit tests sessions has a | ||
| 397 | + # constraints file containing all dependencies and extras. | ||
| 398 | + with open( | ||
| 399 | + CURRENT_DIRECTORY | ||
| 400 | + / "testing" | ||
| 401 | + / f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt", | ||
| 402 | + encoding="utf-8", | ||
| 403 | + ) as constraints_file: | ||
| 404 | + constraints_text = constraints_file.read() | ||
| 405 | + | ||
| 406 | + # Ignore leading whitespace and comment lines. | ||
| 407 | + deps = [ | ||
| 408 | + match.group(1) | ||
| 409 | + for match in re.finditer( | ||
| 410 | + r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE | ||
| 411 | + ) | ||
| 412 | + ] | ||
| 413 | + | ||
| 414 | + # Don't overwrite prerelease packages. | ||
| 415 | + deps = [dep for dep in deps if dep not in prerel_deps] | ||
| 416 | + # We use --no-deps to ensure that pre-release versions aren't overwritten | ||
| 417 | + # by the version ranges in setup.py. | ||
| 418 | + session.install(*deps) | ||
| 419 | + session.install("--no-deps", "-e", ".[all]") | ||
| 420 | + | ||
| 421 | + # Print out prerelease package versions | ||
| 422 | + session.run( | ||
| 423 | + "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" | ||
| 424 | + ) | ||
| 425 | + session.run("python", "-c", "import grpc; print(grpc.__version__)") | ||
| 426 | + | ||
| 427 | + session.run("py.test", "tests/unit") | ||
| 428 | + session.run("py.test", "tests/system") | ||
| 429 | + session.run("py.test", "samples/snippets") | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments