GeezerVison is showing github.com — chore(python): exclude grpcio==1.49.0rc1 in tests (#1618) · mjoshs/python-aiplatform@484e416
File treeExpand file treeCollapse file tree Open diff view settings scripts/readme-gen/templates
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/.OwlBot.lock.yaml +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 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:ce3c1686bc81145c81dd269bd12c4025c6b275b22d14641358827334fddb1d72 | | 17 | +# created: 2022-08-29T17:28:30.441852797Z |
Collapse file Copy file name to clipboardExpand all lines: .kokoro/publish-docs.sh +1-3Lines changed: 1 addition & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -21,14 +21,12 @@ export PYTHONUNBUFFERED=1 | 21 | 21 | export PATH="${HOME}/.local/bin:${PATH}" | 22 | 22 |
| 23 | 23 | # Install nox | 24 | | -python3 -m pip install --user --upgrade --quiet nox | | 24 | +python3 -m pip install --require-hashes -r .kokoro/requirements.txt | 25 | 25 | python3 -m nox --version | 26 | 26 |
| 27 | 27 | # build docs | 28 | 28 | nox -s docs | 29 | 29 |
| 30 | | -python3 -m pip install --user gcp-docuploader | 31 | | - | 32 | 30 | # create metadata | 33 | 31 | python3 -m docuploader create-metadata \ | 34 | 32 | --name=$(jq --raw-output '.name // empty' .repo-metadata.json) \ | |
Collapse file Copy file name to clipboardExpand all lines: .kokoro/release.sh +1-4Lines changed: 1 addition & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 16 | 16 | set -eo pipefail | 17 | 17 |
| 18 | 18 | # Start the releasetool reporter | 19 | | -python3 -m pip install gcp-releasetool | | 19 | +python3 -m pip install --require-hashes -r .kokoro/requirements.txt | 20 | 20 | python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script | 21 | 21 |
| 22 | | -# Ensure that we have the latest versions of Twine, Wheel, and Setuptools. | 23 | | -python3 -m pip install --upgrade twine wheel setuptools | 24 | | - | 25 | 22 | # Disable buffering, so that the logs stream through. | 26 | 23 | export PYTHONUNBUFFERED=1 | 27 | 24 |
| |
Collapse file Copy file name to clipboard +8Lines changed: 8 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +gcp-docuploader | | 2 | +gcp-releasetool | | 3 | +importlib-metadata | | 4 | +typing-extensions | | 5 | +twine | | 6 | +wheel | | 7 | +setuptools | | 8 | +nox |
Collapse file Copy file name to clipboardExpand all lines: .kokoro/requirements.txt +464Lines changed: 464 additions & 0 deletions Large diffs are not rendered by default. Collapse file Copy file name to clipboardExpand all lines: noxfile.py +95-1Lines changed: 95 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 19 | 19 | from __future__ import absolute_import | 20 | 20 | import os | 21 | 21 | import pathlib | | 22 | +import re | 22 | 23 | import shutil | 23 | 24 | import warnings | 24 | 25 |
| @@ -190,7 +191,9 @@ def unit(session): | 190 | 191 | def install_systemtest_dependencies(session, *constraints): | 191 | 192 |
| 192 | 193 | # Use pre-release gRPC for system tests. | 193 | | - session.install("--pre", "grpcio") | | 194 | + # Exclude version 1.49.0rc1 which has a known issue. | | 195 | + # See https://github.com/grpc/grpc/pull/30642 | | 196 | + session.install("--pre", "grpcio!=1.49.0rc1") | 194 | 197 |
| 195 | 198 | session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES, *constraints) | 196 | 199 |
| @@ -326,3 +329,94 @@ def docfx(session): | 326 | 329 | os.path.join("docs", ""), | 327 | 330 | os.path.join("docs", "_build", "html", ""), | 328 | 331 | ) | | 332 | + | | 333 | + | | 334 | +@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) | | 335 | +def prerelease_deps(session): | | 336 | + """Run all tests with prerelease versions of dependencies installed.""" | | 337 | + | | 338 | + # Install all dependencies | | 339 | + session.install("-e", ".[all, tests, tracing]") | | 340 | + unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES | | 341 | + session.install(*unit_deps_all) | | 342 | + system_deps_all = ( | | 343 | + SYSTEM_TEST_STANDARD_DEPENDENCIES | | 344 | + + SYSTEM_TEST_EXTERNAL_DEPENDENCIES | | 345 | + + SYSTEM_TEST_EXTRAS | | 346 | + ) | | 347 | + session.install(*system_deps_all) | | 348 | + | | 349 | + # Because we test minimum dependency versions on the minimum Python | | 350 | + # version, the first version we test with in the unit tests sessions has a | | 351 | + # constraints file containing all dependencies and extras. | | 352 | + with open( | | 353 | + CURRENT_DIRECTORY | | 354 | + / "testing" | | 355 | + / f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt", | | 356 | + encoding="utf-8", | | 357 | + ) as constraints_file: | | 358 | + constraints_text = constraints_file.read() | | 359 | + | | 360 | + # Ignore leading whitespace and comment lines. | | 361 | + constraints_deps = [ | | 362 | + match.group(1) | | 363 | + for match in re.finditer( | | 364 | + r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE | | 365 | + ) | | 366 | + ] | | 367 | + | | 368 | + session.install(*constraints_deps) | | 369 | + | | 370 | + prerel_deps = [ | | 371 | + "protobuf", | | 372 | + # dependency of grpc | | 373 | + "six", | | 374 | + "googleapis-common-protos", | | 375 | + # Exclude version 1.49.0rc1 which has a known issue. See https://github.com/grpc/grpc/pull/30642 | | 376 | + "grpcio!=1.49.0rc1", | | 377 | + "grpcio-status", | | 378 | + "google-api-core", | | 379 | + "proto-plus", | | 380 | + "google-cloud-testutils", | | 381 | + # dependencies of google-cloud-testutils" | | 382 | + "click", | | 383 | + ] | | 384 | + | | 385 | + for dep in prerel_deps: | | 386 | + session.install("--pre", "--no-deps", "--upgrade", dep) | | 387 | + | | 388 | + # Remaining dependencies | | 389 | + other_deps = [ | | 390 | + "requests", | | 391 | + "google-auth", | | 392 | + ] | | 393 | + session.install(*other_deps) | | 394 | + | | 395 | + # Print out prerelease package versions | | 396 | + session.run( | | 397 | + "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" | | 398 | + ) | | 399 | + session.run("python", "-c", "import grpc; print(grpc.__version__)") | | 400 | + | | 401 | + session.run("py.test", "tests/unit") | | 402 | + | | 403 | + system_test_path = os.path.join("tests", "system.py") | | 404 | + system_test_folder_path = os.path.join("tests", "system") | | 405 | + | | 406 | + # Only run system tests if found. | | 407 | + if os.path.exists(system_test_path): | | 408 | + session.run( | | 409 | + "py.test", | | 410 | + "--verbose", | | 411 | + f"--junitxml=system_{session.python}_sponge_log.xml", | | 412 | + system_test_path, | | 413 | + *session.posargs, | | 414 | + ) | | 415 | + if os.path.exists(system_test_folder_path): | | 416 | + session.run( | | 417 | + "py.test", | | 418 | + "--verbose", | | 419 | + f"--junitxml=system_{session.python}_sponge_log.xml", | | 420 | + system_test_folder_path, | | 421 | + *session.posargs, | | 422 | + ) |
Collapse file Copy file name to clipboardExpand all lines: owlbot.py +4-2Lines changed: 4 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 99 | 99 | ".coveragerc", | 100 | 100 | ".kokoro/continuous/common.cfg", | 101 | 101 | ".kokoro/presubmit/presubmit.cfg", | | 102 | + ".kokoro/continuous/prerelease-deps.cfg", | | 103 | + ".kokoro/presubmit/prerelease-deps.cfg", | 102 | 104 | # exclude sample configs so periodic samples are tested against main | 103 | 105 | # instead of pypi | 104 | | - ".kokoro/samples/python3.6/periodic.cfg", | 105 | 106 | ".kokoro/samples/python3.7/periodic.cfg", | 106 | 107 | ".kokoro/samples/python3.8/periodic.cfg", | 107 | 108 | ".kokoro/samples/python3.9/periodic.cfg", | 108 | 109 | ".kokoro/samples/python3.10/periodic.cfg", | 109 | 110 | ".github/CODEOWNERS", | 110 | 111 | ".github/workflows", # exclude gh actions as credentials are needed for tests | | 112 | + "README.rst", | 111 | 113 | ], | 112 | 114 | ) # the microgenerator has a good coveragerc file | 113 | 115 |
| | 130 | 132 |
| 131 | 133 | s.replace( | 132 | 134 | ".kokoro/test-samples-impl.sh", | 133 | | - "python3.6", | | 135 | + "python3.9", | 134 | 136 | "python3", | 135 | 137 | ) | 136 | 138 |
| |
Collapse file Copy file name to clipboardExpand all lines: renovate.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 5 | 5 | ":preserveSemverRanges", | 6 | 6 | ":disableDependencyDashboard" | 7 | 7 | ], | 8 | | - "ignorePaths": [".pre-commit-config.yaml"], | | 8 | + "ignorePaths": [".pre-commit-config.yaml", ".kokoro/requirements.txt"], | 9 | 9 | "pip_requirements": { | 10 | 10 | "fileMatch": ["requirements-test.txt", "samples/[\\S/]*constraints.txt", "samples/[\\S/]*constraints-test.txt"] | 11 | 11 | } | |
Collapse file Copy file name to clipboardExpand all lines: samples/model-builder/noxfile.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]: | 89 | 89 |
| 90 | 90 | # DO NOT EDIT - automatically generated. | 91 | 91 | # All versions used to test samples. | 92 | | -ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"] | | 92 | +ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10"] | 93 | 93 |
| 94 | 94 | # Any default versions that should be ignored. | 95 | 95 | IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] | |
Collapse file Copy file name to clipboardExpand all lines: samples/snippets/noxfile.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]: | 89 | 89 |
| 90 | 90 | # DO NOT EDIT - automatically generated. | 91 | 91 | # All versions used to test samples. | 92 | | -ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"] | | 92 | +ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10"] | 93 | 93 |
| 94 | 94 | # Any default versions that should be ignored. | 95 | 95 | IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] | |
|