Skip to content

Commit 1659ed3

Browse files
authored
Merge branch 'main' into Issue1143-update-dependencies
2 parents ec82666 + d00e966 commit 1659ed3

21 files changed

+406
-308
lines changed

.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: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@
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:5651442a6336971a2fb2df40fb56b3337df67cafa14c0809cc89cb34ccee1b8e

.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.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: 68 additions & 31 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.
@@ -160,22 +160,22 @@ def install_unittest_dependencies(session, *constraints):
160160
else:
161161
session.install("-e", ".", *constraints)
162162

163-
164-
def default(session):
165-
# Install all test dependencies, then install this package in-place.
166-
163+
# XXX Work around Kokoro image's older pip, which borks the OT install.
164+
session.run("pip", "install", "--upgrade", "pip")
167165
constraints_path = str(
168166
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
169167
)
170-
install_unittest_dependencies(session, "-c", constraints_path)
168+
session.install("-e", ".[tracing]", "-c", constraints_path)
169+
# XXX: Dump installed versions to debug OT issue
170+
session.run("pip", "list")
171171

172-
# Run py.test against the unit tests.
172+
# Run py.test against the unit tests with OpenTelemetry.
173173
session.run(
174174
"py.test",
175175
"--quiet",
176-
f"--junitxml=unit_{session.python}_sponge_log.xml",
177-
"--cov=google",
178-
"--cov=tests/unit",
176+
"--cov=google.cloud.spanner",
177+
"--cov=google.cloud",
178+
"--cov=tests.unit",
179179
"--cov-append",
180180
"--cov-config=.coveragerc",
181181
"--cov-report=",
@@ -184,34 +184,48 @@ def default(session):
184184
*session.posargs,
185185
)
186186

187-
# XXX Work around Kokoro image's older pip, which borks the OT install.
188-
session.run("pip", "install", "--upgrade", "pip")
189-
session.install("-e", ".[tracing]", "-c", constraints_path)
190-
# XXX: Dump installed versions to debug OT issue
191-
session.run("pip", "list")
192187

193-
# Run py.test against the unit tests with OpenTelemetry.
188+
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
189+
@nox.parametrize(
190+
"protobuf_implementation",
191+
["python", "upb", "cpp"],
192+
)
193+
def unit(session, protobuf_implementation):
194+
# Install all test dependencies, then install this package in-place.
195+
196+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12"):
197+
session.skip("cpp implementation is not supported in python 3.11+")
198+
199+
constraints_path = str(
200+
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
201+
)
202+
install_unittest_dependencies(session, "-c", constraints_path)
203+
204+
# TODO(https://github.com/googleapis/synthtool/issues/1976):
205+
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
206+
# The 'cpp' implementation requires Protobuf<4.
207+
if protobuf_implementation == "cpp":
208+
session.install("protobuf<4")
209+
210+
# Run py.test against the unit tests.
194211
session.run(
195212
"py.test",
196213
"--quiet",
197-
"--cov=google.cloud.spanner",
198-
"--cov=google.cloud",
199-
"--cov=tests.unit",
214+
f"--junitxml=unit_{session.python}_sponge_log.xml",
215+
"--cov=google",
216+
"--cov=tests/unit",
200217
"--cov-append",
201218
"--cov-config=.coveragerc",
202219
"--cov-report=",
203220
"--cov-fail-under=0",
204221
os.path.join("tests", "unit"),
205222
*session.posargs,
223+
env={
224+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
225+
},
206226
)
207227

208228

209-
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
210-
def unit(session):
211-
"""Run the unit test suite."""
212-
default(session)
213-
214-
215229
def install_systemtest_dependencies(session, *constraints):
216230
# Use pre-release gRPC for system tests.
217231
# Exclude version 1.52.0rc1 which has a known issue.
@@ -399,11 +413,24 @@ def docfx(session):
399413
)
400414

401415

402-
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
403-
@nox.parametrize("database_dialect", ["GOOGLE_STANDARD_SQL", "POSTGRESQL"])
404-
def prerelease_deps(session, database_dialect):
416+
@nox.session(python="3.12")
417+
@nox.parametrize(
418+
"protobuf_implementation,database_dialect",
419+
[
420+
("python", "GOOGLE_STANDARD_SQL"),
421+
("python", "POSTGRESQL"),
422+
("upb", "GOOGLE_STANDARD_SQL"),
423+
("upb", "POSTGRESQL"),
424+
("cpp", "GOOGLE_STANDARD_SQL"),
425+
("cpp", "POSTGRESQL"),
426+
],
427+
)
428+
def prerelease_deps(session, protobuf_implementation, database_dialect):
405429
"""Run all tests with prerelease versions of dependencies installed."""
406430

431+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12"):
432+
session.skip("cpp implementation is not supported in python 3.11+")
433+
407434
# Install all dependencies
408435
session.install("-e", ".[all, tests, tracing]")
409436
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
@@ -438,9 +465,9 @@ def prerelease_deps(session, database_dialect):
438465
"protobuf",
439466
# dependency of grpc
440467
"six",
468+
"grpc-google-iam-v1",
441469
"googleapis-common-protos",
442-
# Exclude version 1.52.0rc1 which has a known issue. See https://github.com/grpc/grpc/issues/32163
443-
"grpcio!=1.52.0rc1",
470+
"grpcio",
444471
"grpcio-status",
445472
"google-api-core",
446473
"google-auth",
@@ -466,7 +493,15 @@ def prerelease_deps(session, database_dialect):
466493
session.run("python", "-c", "import grpc; print(grpc.__version__)")
467494
session.run("python", "-c", "import google.auth; print(google.auth.__version__)")
468495

469-
session.run("py.test", "tests/unit")
496+
session.run(
497+
"py.test",
498+
"tests/unit",
499+
env={
500+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
501+
"SPANNER_DATABASE_DIALECT": database_dialect,
502+
"SKIP_BACKUP_TESTS": "true",
503+
},
504+
)
470505

471506
system_test_path = os.path.join("tests", "system.py")
472507
system_test_folder_path = os.path.join("tests", "system")
@@ -480,6 +515,7 @@ def prerelease_deps(session, database_dialect):
480515
system_test_path,
481516
*session.posargs,
482517
env={
518+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
483519
"SPANNER_DATABASE_DIALECT": database_dialect,
484520
"SKIP_BACKUP_TESTS": "true",
485521
},
@@ -492,6 +528,7 @@ def prerelease_deps(session, database_dialect):
492528
system_test_folder_path,
493529
*session.posargs,
494530
env={
531+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
495532
"SPANNER_DATABASE_DIALECT": database_dialect,
496533
"SKIP_BACKUP_TESTS": "true",
497534
},

owlbot.py

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ def place_before(path, text, *before_text, escape=None):
177177
open_telemetry_test = """
178178
# XXX Work around Kokoro image's older pip, which borks the OT install.
179179
session.run("pip", "install", "--upgrade", "pip")
180+
constraints_path = str(
181+
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
182+
)
180183
session.install("-e", ".[tracing]", "-c", constraints_path)
181184
# XXX: Dump installed versions to debug OT issue
182185
session.run("pip", "list")
@@ -239,33 +242,69 @@ def system\(session\):""",
239242
def system(session, database_dialect):""",
240243
)
241244

242-
s.replace("noxfile.py",
243-
"""system_test_path,
244-
\*session.posargs,""",
245-
"""system_test_path,
246-
*session.posargs,
245+
s.replace(
246+
"noxfile.py",
247+
"""\*session.posargs,
248+
\)""",
249+
"""*session.posargs,
247250
env={
248251
"SPANNER_DATABASE_DIALECT": database_dialect,
249252
"SKIP_BACKUP_TESTS": "true",
250-
},"""
253+
},
254+
)""",
251255
)
252256

253257
s.replace("noxfile.py",
254-
"""system_test_folder_path,
255-
\*session.posargs,""",
256-
"""system_test_folder_path,
257-
*session.posargs,
258-
env={
258+
"""env={
259+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
260+
},""",
261+
"""env={
262+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
259263
"SPANNER_DATABASE_DIALECT": database_dialect,
260264
"SKIP_BACKUP_TESTS": "true",
261-
},"""
265+
},""",
266+
)
267+
268+
s.replace("noxfile.py",
269+
"""session.run\(
270+
"py.test",
271+
"tests/unit",
272+
env={
273+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
274+
},
275+
\)""",
276+
"""session.run(
277+
"py.test",
278+
"tests/unit",
279+
env={
280+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
281+
"SPANNER_DATABASE_DIALECT": database_dialect,
282+
"SKIP_BACKUP_TESTS": "true",
283+
},
284+
)""",
262285
)
263286

264287
s.replace(
265288
"noxfile.py",
266-
"""def prerelease_deps\(session\):""",
267-
"""@nox.parametrize("database_dialect", ["GOOGLE_STANDARD_SQL", "POSTGRESQL"])
268-
def prerelease_deps(session, database_dialect):"""
289+
"""\@nox.session\(python="3.12"\)
290+
\@nox.parametrize\(
291+
"protobuf_implementation",
292+
\[ "python", "upb", "cpp" \],
293+
\)
294+
def prerelease_deps\(session, protobuf_implementation\):""",
295+
"""@nox.session(python="3.12")
296+
@nox.parametrize(
297+
"protobuf_implementation,database_dialect",
298+
[
299+
("python", "GOOGLE_STANDARD_SQL"),
300+
("python", "POSTGRESQL"),
301+
("upb", "GOOGLE_STANDARD_SQL"),
302+
("upb", "POSTGRESQL"),
303+
("cpp", "GOOGLE_STANDARD_SQL"),
304+
("cpp", "POSTGRESQL"),
305+
],
306+
)
307+
def prerelease_deps(session, protobuf_implementation, database_dialect):""",
269308
)
270309

271310
s.shell.run(["nox", "-s", "blacken"], hide_output=False)

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)