Skip to content

Commit 484e416

Browse files
chore(python): exclude grpcio==1.49.0rc1 in tests (googleapis#1618)
* chore(python): exclude `grpcio==1.49.0rc1` in tests Source-Link: googleapis/synthtool@c4dd595 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:ce3c1686bc81145c81dd269bd12c4025c6b275b22d14641358827334fddb1d72 * revert changes * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent d591d3e commit 484e416

File tree

11 files changed

+579
-16
lines changed

11 files changed

+579
-16
lines changed

.github/.OwlBot.lock.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
# limitations under the License.
1414
docker:
1515
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

.kokoro/publish-docs.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@ export PYTHONUNBUFFERED=1
2121
export PATH="${HOME}/.local/bin:${PATH}"
2222

2323
# Install nox
24-
python3 -m pip install --user --upgrade --quiet nox
24+
python3 -m pip install --require-hashes -r .kokoro/requirements.txt
2525
python3 -m nox --version
2626

2727
# build docs
2828
nox -s docs
2929

30-
python3 -m pip install --user gcp-docuploader
31-
3230
# create metadata
3331
python3 -m docuploader create-metadata \
3432
--name=$(jq --raw-output '.name // empty' .repo-metadata.json) \

.kokoro/release.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@
1616
set -eo pipefail
1717

1818
# Start the releasetool reporter
19-
python3 -m pip install gcp-releasetool
19+
python3 -m pip install --require-hashes -r .kokoro/requirements.txt
2020
python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script
2121

22-
# Ensure that we have the latest versions of Twine, Wheel, and Setuptools.
23-
python3 -m pip install --upgrade twine wheel setuptools
24-
2522
# Disable buffering, so that the logs stream through.
2623
export PYTHONUNBUFFERED=1
2724

.kokoro/requirements.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
gcp-docuploader
2+
gcp-releasetool
3+
importlib-metadata
4+
typing-extensions
5+
twine
6+
wheel
7+
setuptools
8+
nox

.kokoro/requirements.txt

Lines changed: 464 additions & 0 deletions
Large diffs are not rendered by default.

noxfile.py

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from __future__ import absolute_import
2020
import os
2121
import pathlib
22+
import re
2223
import shutil
2324
import warnings
2425

@@ -190,7 +191,9 @@ def unit(session):
190191
def install_systemtest_dependencies(session, *constraints):
191192

192193
# 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")
194197

195198
session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES, *constraints)
196199

@@ -326,3 +329,94 @@ def docfx(session):
326329
os.path.join("docs", ""),
327330
os.path.join("docs", "_build", "html", ""),
328331
)
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+
)

owlbot.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,17 @@
9999
".coveragerc",
100100
".kokoro/continuous/common.cfg",
101101
".kokoro/presubmit/presubmit.cfg",
102+
".kokoro/continuous/prerelease-deps.cfg",
103+
".kokoro/presubmit/prerelease-deps.cfg",
102104
# exclude sample configs so periodic samples are tested against main
103105
# instead of pypi
104-
".kokoro/samples/python3.6/periodic.cfg",
105106
".kokoro/samples/python3.7/periodic.cfg",
106107
".kokoro/samples/python3.8/periodic.cfg",
107108
".kokoro/samples/python3.9/periodic.cfg",
108109
".kokoro/samples/python3.10/periodic.cfg",
109110
".github/CODEOWNERS",
110111
".github/workflows", # exclude gh actions as credentials are needed for tests
112+
"README.rst",
111113
],
112114
) # the microgenerator has a good coveragerc file
113115

@@ -130,7 +132,7 @@
130132

131133
s.replace(
132134
".kokoro/test-samples-impl.sh",
133-
"python3.6",
135+
"python3.9",
134136
"python3",
135137
)
136138

renovate.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
":preserveSemverRanges",
66
":disableDependencyDashboard"
77
],
8-
"ignorePaths": [".pre-commit-config.yaml"],
8+
"ignorePaths": [".pre-commit-config.yaml", ".kokoro/requirements.txt"],
99
"pip_requirements": {
1010
"fileMatch": ["requirements-test.txt", "samples/[\\S/]*constraints.txt", "samples/[\\S/]*constraints-test.txt"]
1111
}

samples/model-builder/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:
8989

9090
# DO NOT EDIT - automatically generated.
9191
# 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"]
9393

9494
# Any default versions that should be ignored.
9595
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]

samples/snippets/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:
8989

9090
# DO NOT EDIT - automatically generated.
9191
# 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"]
9393

9494
# Any default versions that should be ignored.
9595
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]

0 commit comments

Comments
 (0)