Skip to content

Commit c382386

Browse files
chore: update templated files (#544)
* chore(python): drop python 3.6 Source-Link: googleapis/synthtool@4f89b13 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c * remove python 3.6 sample configs * exclude templated README * use python 3.8 for readthedocs build Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent b6c3f7a commit c382386

File tree

13 files changed

+62
-107
lines changed

13 files changed

+62
-107
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:65e656411895bff71cffcae97246966460160028f253c2e45b7a25d805a5b142
17-
# created: 2022-06-12T13:11:45.905884945Z
16+
digest: sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c
17+
# created: 2022-07-05T18:31:20.838186805Z

.kokoro/samples/python3.6/common.cfg

Lines changed: 0 additions & 40 deletions
This file was deleted.

.kokoro/samples/python3.6/continuous.cfg

Lines changed: 0 additions & 7 deletions
This file was deleted.

.kokoro/samples/python3.6/periodic-head.cfg

Lines changed: 0 additions & 11 deletions
This file was deleted.

.kokoro/samples/python3.6/periodic.cfg

Lines changed: 0 additions & 6 deletions
This file was deleted.

.kokoro/samples/python3.6/presubmit.cfg

Lines changed: 0 additions & 6 deletions
This file was deleted.

.kokoro/test-samples-impl.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export PYTHONUNBUFFERED=1
3333
env | grep KOKORO
3434

3535
# Install nox
36-
python3.6 -m pip install --upgrade --quiet nox
36+
python3.9 -m pip install --upgrade --quiet nox
3737

3838
# Use secrets acessor service account to get secrets
3939
if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then
@@ -76,7 +76,7 @@ for file in samples/**/requirements.txt; do
7676
echo "------------------------------------------------------------"
7777

7878
# Use nox to execute the tests for the project.
79-
python3.6 -m nox -s "$RUN_TESTS_SESSION"
79+
python3.9 -m nox -s "$RUN_TESTS_SESSION"
8080
EXIT=$?
8181

8282
# If this is a periodic build, send the test log to the FlakyBot.

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ build:
77
image: latest
88
python:
99
pip_install: true
10-
version: 3.6
10+
version: 3.8

noxfile.py

Lines changed: 53 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -422,28 +422,15 @@ def docfx(session):
422422
def prerelease_deps(session):
423423
"""Run all tests with prerelease versions of dependencies installed."""
424424

425-
prerel_deps = [
426-
"protobuf",
427-
"googleapis-common-protos",
428-
"google-auth",
429-
"grpcio",
430-
"grpcio-status",
431-
"google-api-core",
432-
"proto-plus",
433-
# dependencies of google-auth
434-
"cryptography",
435-
"pyasn1",
436-
]
437-
438-
for dep in prerel_deps:
439-
session.install("--pre", "--no-deps", "--upgrade", dep)
440-
441-
# Remaining dependencies
442-
other_deps = ["requests"]
443-
session.install(*other_deps)
444-
425+
# Install all dependencies
426+
session.install("-e", ".[all, tests, tracing]")
445427
session.install(*UNIT_TEST_STANDARD_DEPENDENCIES)
446-
session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES)
428+
system_deps_all = (
429+
SYSTEM_TEST_STANDARD_DEPENDENCIES
430+
+ SYSTEM_TEST_EXTERNAL_DEPENDENCIES
431+
+ SYSTEM_TEST_EXTRAS
432+
)
433+
session.install(*system_deps_all)
447434

448435
# Because we test minimum dependency versions on the minimum Python
449436
# version, the first version we test with in the unit tests sessions has a
@@ -457,19 +444,44 @@ def prerelease_deps(session):
457444
constraints_text = constraints_file.read()
458445

459446
# Ignore leading whitespace and comment lines.
460-
deps = [
447+
constraints_deps = [
461448
match.group(1)
462449
for match in re.finditer(
463450
r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE
464451
)
465452
]
466453

467-
# Don't overwrite prerelease packages.
468-
deps = [dep for dep in deps if dep not in prerel_deps]
469-
# We use --no-deps to ensure that pre-release versions aren't overwritten
470-
# by the version ranges in setup.py.
471-
session.install(*deps)
472-
session.install("--no-deps", "-e", ".[all]")
454+
session.install(*constraints_deps)
455+
456+
if os.path.exists("samples/snippets/requirements.txt"):
457+
session.install("-r", "samples/snippets/requirements.txt")
458+
459+
if os.path.exists("samples/snippets/requirements-test.txt"):
460+
session.install("-r", "samples/snippets/requirements-test.txt")
461+
462+
prerel_deps = [
463+
"protobuf",
464+
# dependency of grpc
465+
"six",
466+
"googleapis-common-protos",
467+
"grpcio",
468+
"grpcio-status",
469+
"google-api-core",
470+
"proto-plus",
471+
"google-cloud-testutils",
472+
# dependencies of google-cloud-testutils"
473+
"click",
474+
]
475+
476+
for dep in prerel_deps:
477+
session.install("--pre", "--no-deps", "--upgrade", dep)
478+
479+
# Remaining dependencies
480+
other_deps = [
481+
"requests",
482+
"google-auth",
483+
]
484+
session.install(*other_deps)
473485

474486
# Print out prerelease package versions
475487
session.run(
@@ -478,5 +490,16 @@ def prerelease_deps(session):
478490
session.run("python", "-c", "import grpc; print(grpc.__version__)")
479491

480492
session.run("py.test", "tests/unit")
481-
session.run("py.test", "tests/system")
482-
session.run("py.test", "samples/snippets")
493+
494+
system_test_path = os.path.join("tests", "system.py")
495+
system_test_folder_path = os.path.join("tests", "system")
496+
497+
# Only run system tests if found.
498+
if os.path.exists(system_test_path) or os.path.exists(system_test_folder_path):
499+
session.run("py.test", "tests/system")
500+
501+
snippets_test_path = os.path.join("samples", "snippets")
502+
503+
# Only run samples tests if found.
504+
if os.path.exists(snippets_test_path):
505+
session.run("py.test", "samples/snippets")

owlbot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
# Mulit-processing note isn't relevant, as pandas_gbq is responsible for
5656
# creating clients, not the end user.
5757
"docs/multiprocessing.rst",
58+
"README.rst",
5859
],
5960
)
6061

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"]

scripts/readme-gen/templates/install_deps.tmpl.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Install Dependencies
1212
.. _Python Development Environment Setup Guide:
1313
https://cloud.google.com/python/setup
1414

15-
#. Create a virtualenv. Samples are compatible with Python 3.6+.
15+
#. Create a virtualenv. Samples are compatible with Python 3.7+.
1616

1717
.. code-block:: bash
1818

testing/constraints-3.7.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ pandas==0.24.2
1616
pyarrow==3.0.0
1717
pydata-google-auth==0.1.2
1818
tqdm==4.23.0
19+
protobuf==3.19.0

0 commit comments

Comments
 (0)