Skip to content

Commit 8ff91ac

Browse files
chore: update templated files
Source-Link: googleapis/synthtool@a37f74c Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:d3de8a02819f65001effcbd3ea76ce97e9bcff035c7a89457f40f892c87c5b32
1 parent 55dff95 commit 8ff91ac

22 files changed

+329
-373
lines changed

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2023 Google LLC
3+
# Copyright 2024 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2023 Google LLC
3+
# Copyright 2024 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

.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:5a4c19d17e597b92d786e569be101e636c9c2817731f80a5adec56b2aa8fe070
17-
# created: 2024-04-12T11:35:58.922854369Z
16+
digest: sha256:d3de8a02819f65001effcbd3ea76ce97e9bcff035c7a89457f40f892c87c5b32
17+
# created: 2024-07-03T17:43:00.77142528Z

.github/auto-label.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 Google LLC
1+
# Copyright 2024 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.kokoro/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2023 Google LLC
2+
# Copyright 2024 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.kokoro/docker/docs/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 Google LLC
1+
# Copyright 2024 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.kokoro/populate-secrets.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2023 Google LLC.
2+
# Copyright 2024 Google LLC.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.kokoro/publish-docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2023 Google LLC
2+
# Copyright 2024 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.kokoro/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2023 Google LLC
2+
# Copyright 2024 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.kokoro/requirements.txt

Lines changed: 266 additions & 243 deletions
Large diffs are not rendered by default.

.kokoro/test-samples-against-head.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2023 Google LLC
2+
# Copyright 2024 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.kokoro/test-samples-impl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2023 Google LLC
2+
# Copyright 2024 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.kokoro/test-samples.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2023 Google LLC
2+
# Copyright 2024 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.kokoro/trampoline.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2023 Google LLC
2+
# Copyright 2024 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.kokoro/trampoline_v2.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# Copyright 2023 Google LLC
2+
# Copyright 2024 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 Google LLC
1+
# Copyright 2024 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.trampolinerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 Google LLC
1+
# Copyright 2024 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2023 Google LLC
3+
# Copyright 2024 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2023 Google LLC
2+
# Copyright 2024 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

noxfile.py

Lines changed: 42 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2023 Google LLC
3+
# Copyright 2024 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -162,98 +162,33 @@ def install_unittest_dependencies(session, *constraints):
162162
session.install("-e", ".", *constraints)
163163

164164

165-
def default(session, tests_path):
165+
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
166+
@nox.parametrize(
167+
"protobuf_implementation",
168+
["python", "upb", "cpp"],
169+
)
170+
def unit(session, protobuf_implementation):
166171
# Install all test dependencies, then install this package in-place.
167172

168-
constraints_path = str(
169-
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
170-
)
171-
install_unittest_dependencies(session, "-c", constraints_path)
173+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12"):
174+
session.skip("cpp implementation is not supported in python 3.11+")
172175

173-
# Run py.test against the unit tests.
174-
session.run(
175-
"py.test",
176-
"--quiet",
177-
f"--junitxml={os.path.split(tests_path)[-1]}_{session.python}_sponge_log.xml",
178-
"--cov=db_dtypes",
179-
"--cov=tests/unit",
180-
"--cov-append",
181-
"--cov-config=.coveragerc",
182-
"--cov-report=",
183-
"--cov-fail-under=0",
184-
tests_path,
185-
*session.posargs,
186-
)
187-
188-
189-
def prerelease(session, tests_path):
190176
constraints_path = str(
191177
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
192178
)
179+
install_unittest_dependencies(session, "-c", constraints_path)
193180

194-
# PyArrow prerelease packages are published to an alternative PyPI host.
195-
# https://arrow.apache.org/docs/python/install.html#installing-nightly-packages
196-
session.install(
197-
"--extra-index-url",
198-
"https://pypi.fury.io/arrow-nightlies/",
199-
"--prefer-binary",
200-
"--pre",
201-
"--upgrade",
202-
"pyarrow",
203-
)
204-
# Avoid pandas==2.2.0rc0 as this version causes PyArrow to fail. Once newer
205-
# prerelease comes out, this constraint can be removed. See
206-
# https://github.com/googleapis/python-db-dtypes-pandas/issues/234
207-
session.install(
208-
"--extra-index-url",
209-
"https://pypi.anaconda.org/scipy-wheels-nightly/simple",
210-
"--prefer-binary",
211-
"--pre",
212-
"--upgrade",
213-
"pandas!=2.2.0rc0",
214-
)
215-
session.install(
216-
"mock",
217-
"asyncmock",
218-
"pytest",
219-
"pytest-cov",
220-
"pytest-asyncio",
221-
"-c",
222-
constraints_path,
223-
)
224-
225-
# Because we test minimum dependency versions on the minimum Python
226-
# version, the first version we test with in the unit tests sessions has a
227-
# constraints file containing all dependencies and extras.
228-
with open(
229-
CURRENT_DIRECTORY
230-
/ "testing"
231-
/ f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt",
232-
encoding="utf-8",
233-
) as constraints_file:
234-
constraints_text = constraints_file.read()
235-
236-
# Ignore leading whitespace and comment lines.
237-
deps = [
238-
match.group(1)
239-
for match in re.finditer(
240-
r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE
241-
)
242-
]
243-
244-
# We use --no-deps to ensure that pre-release versions aren't overwritten
245-
# by the version ranges in setup.py.
246-
session.install(*deps)
247-
session.install("--no-deps", "-e", ".")
248-
249-
# Print out prerelease package versions.
250-
session.run("python", "-m", "pip", "freeze")
181+
# TODO(https://github.com/googleapis/synthtool/issues/1976):
182+
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
183+
# The 'cpp' implementation requires Protobuf<4.
184+
if protobuf_implementation == "cpp":
185+
session.install("protobuf<4")
251186

252187
# Run py.test against the unit tests.
253188
session.run(
254189
"py.test",
255190
"--quiet",
256-
f"--junitxml={os.path.split(tests_path)[-1]}_prerelease_{session.python}_sponge_log.xml",
191+
f"--junitxml={os.path.split(tests_path)[-1]}_{session.python}_sponge_log.xml",
257192
"--cov=db_dtypes",
258193
"--cov=tests/unit",
259194
"--cov-append",
@@ -262,33 +197,12 @@ def prerelease(session, tests_path):
262197
"--cov-fail-under=0",
263198
tests_path,
264199
*session.posargs,
200+
env={
201+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
202+
},
265203
)
266204

267205

268-
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS[-1])
269-
def compliance(session):
270-
"""Run the compliance test suite."""
271-
default(session, os.path.join("tests", "compliance"))
272-
273-
274-
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS[-1])
275-
def compliance_prerelease(session):
276-
"""Run the compliance test suite with prerelease dependencies."""
277-
prerelease(session, os.path.join("tests", "compliance"))
278-
279-
280-
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
281-
def unit(session):
282-
"""Run the unit test suite."""
283-
default(session, os.path.join("tests", "unit"))
284-
285-
286-
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS[-1])
287-
def unit_prerelease(session):
288-
"""Run the unit test suite with prerelease dependencies."""
289-
prerelease(session, os.path.join("tests", "unit"))
290-
291-
292206
def install_systemtest_dependencies(session, *constraints):
293207
# Use pre-release gRPC for system tests.
294208
# Exclude version 1.52.0rc1 which has a known issue.
@@ -457,9 +371,16 @@ def docfx(session):
457371

458372

459373
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
460-
def prerelease_deps(session):
374+
@nox.parametrize(
375+
"protobuf_implementation",
376+
["python", "upb", "cpp"],
377+
)
378+
def prerelease_deps(session, protobuf_implementation):
461379
"""Run all tests with prerelease versions of dependencies installed."""
462380

381+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12"):
382+
session.skip("cpp implementation is not supported in python 3.11+")
383+
463384
# Install all dependencies
464385
session.install("-e", ".[all, tests, tracing]")
465386
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
@@ -494,9 +415,9 @@ def prerelease_deps(session):
494415
"protobuf",
495416
# dependency of grpc
496417
"six",
418+
"grpc-google-iam-v1",
497419
"googleapis-common-protos",
498-
# Exclude version 1.52.0rc1 which has a known issue. See https://github.com/grpc/grpc/issues/32163
499-
"grpcio!=1.52.0rc1",
420+
"grpcio",
500421
"grpcio-status",
501422
"google-api-core",
502423
"google-auth",
@@ -522,7 +443,13 @@ def prerelease_deps(session):
522443
session.run("python", "-c", "import grpc; print(grpc.__version__)")
523444
session.run("python", "-c", "import google.auth; print(google.auth.__version__)")
524445

525-
session.run("py.test", "tests/unit")
446+
session.run(
447+
"py.test",
448+
"tests/unit",
449+
env={
450+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
451+
},
452+
)
526453

527454
system_test_path = os.path.join("tests", "system.py")
528455
system_test_folder_path = os.path.join("tests", "system")
@@ -535,6 +462,9 @@ def prerelease_deps(session):
535462
f"--junitxml=system_{session.python}_sponge_log.xml",
536463
system_test_path,
537464
*session.posargs,
465+
env={
466+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
467+
},
538468
)
539469
if os.path.exists(system_test_folder_path):
540470
session.run(
@@ -543,4 +473,7 @@ def prerelease_deps(session):
543473
f"--junitxml=system_{session.python}_sponge_log.xml",
544474
system_test_folder_path,
545475
*session.posargs,
476+
env={
477+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
478+
},
546479
)

scripts/decrypt-secrets.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# Copyright 2023 Google LLC All rights reserved.
3+
# Copyright 2024 Google LLC All rights reserved.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

scripts/readme-gen/readme_gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
# Copyright 2023 Google LLC
3+
# Copyright 2024 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)