Skip to content

Commit 2a7d346

Browse files
authored
tests: remove protobuf cpp from tests which is no longer used as of Protobuf 4.x (#17742)
Both `google-cloud-spanner` and `google-cloud-bigtable` only support Protobuf 6.x+ . The tests for protobuf implementation backend `cpp` are no longer needed . https://github.com/googleapis/google-cloud-python/blob/2c3c213998b3f3aa1cf490dfbf824d160544b732/packages/google-cloud-spanner/setup.py#L54 https://github.com/googleapis/google-cloud-python/blob/2c3c213998b3f3aa1cf490dfbf824d160544b732/packages/google-cloud-bigtable/setup.py#L52 This PR also skips Python 3.15 testing for `google-cloud-bigtable` because it depends on 3.15 wheels from `google-crc32c`. The follow up work is tracked in #17741 Note: Python 3.15 tests are not enabled yet. That will be part of #17585
1 parent 54b648d commit 2a7d346

4 files changed

Lines changed: 20 additions & 112 deletions

File tree

.librarian/generator-input/client-post-processing/bigtable-integration.yaml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ replacements:
385385
"3.12",
386386
"3.13",
387387
"3.14",
388+
"3.15",
388389
]
389390
390391
UNIT_TEST_STANDARD_DEPENDENCIES = [
@@ -568,25 +569,21 @@ replacements:
568569
@nox.session(python=ALL_PYTHON)
569570
@nox.parametrize(
570571
"protobuf_implementation",
571-
["python", "upb", "cpp"],
572+
["python", "upb"],
572573
)
573574
def unit(session, protobuf_implementation):
574575
# Install all test dependencies, then install this package in-place.
575-
py_version = tuple([int(v) for v in session.python.split(".")])
576-
if protobuf_implementation == "cpp" and py_version >= (3, 11):
577-
session.skip("cpp implementation is not supported in python 3.11+")
576+
577+
# TODO(https://github.com/googleapis/google-cloud-python/issues/17741):
578+
# Remove once `google-crc32c` wheels are published for 3.15
579+
if session.python == "3.15":
580+
session.skip("Skipping 3.15 until wheels are available for google-crc32c.")
578581
579582
constraints_path = str(
580583
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
581584
)
582585
install_unittest_dependencies(session, "-c", constraints_path)
583586
584-
# TODO(https://github.com/googleapis/synthtool/issues/1976):
585-
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
586-
# The 'cpp' implementation requires Protobuf<4.
587-
if protobuf_implementation == "cpp":
588-
session.install("protobuf<4")
589-
590587
# Run py.test against the unit tests.
591588
session.run(
592589
"py.test",
@@ -818,15 +815,11 @@ replacements:
818815
@nox.session(python=DEFAULT_PYTHON_VERSION)
819816
@nox.parametrize(
820817
"protobuf_implementation",
821-
["python", "upb", "cpp"],
818+
["python", "upb"],
822819
)
823820
def prerelease_deps(session, protobuf_implementation):
824821
"""Run all tests with prerelease versions of dependencies installed."""
825822
826-
py_version = tuple([int(v) for v in session.python.split(".")])
827-
if protobuf_implementation == "cpp" and py_version >= (3, 11):
828-
session.skip("cpp implementation is not supported in python 3.11+")
829-
830823
# Install all dependencies
831824
session.install("-e", ".[all, tests, tracing]")
832825
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES

.librarian/generator-input/client-post-processing/spanner-integration.yaml

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,7 @@ replacements:
649649
"3.12",
650650
"3.13",
651651
"3.14",
652+
"3.15",
652653
]
653654
UNIT_TEST_STANDARD_DEPENDENCIES = [
654655
"mock",
@@ -827,30 +828,16 @@ replacements:
827828
@nox.session(python=ALL_PYTHON)
828829
@nox.parametrize(
829830
"protobuf_implementation",
830-
["python", "upb", "cpp"],
831+
["python", "upb"],
831832
)
832833
def unit(session, protobuf_implementation):
833834
# Install all test dependencies, then install this package in-place.
834835
835-
if protobuf_implementation == "cpp" and session.python in (
836-
"3.11",
837-
"3.12",
838-
"3.13",
839-
"3.14",
840-
):
841-
session.skip("cpp implementation is not supported in python 3.11+")
842-
843836
constraints_path = str(
844837
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
845838
)
846839
install_unittest_dependencies(session, "-c", constraints_path)
847840
848-
# TODO(https://github.com/googleapis/synthtool/issues/1976):
849-
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
850-
# The 'cpp' implementation requires Protobuf<4.
851-
if protobuf_implementation == "cpp":
852-
session.install("protobuf<4")
853-
854841
# Run py.test against the unit tests.
855842
args = [
856843
"py.test",
@@ -946,8 +933,6 @@ replacements:
946933
("python", "POSTGRESQL"),
947934
("upb", "GOOGLE_STANDARD_SQL"),
948935
("upb", "POSTGRESQL"),
949-
("cpp", "GOOGLE_STANDARD_SQL"),
950-
("cpp", "POSTGRESQL"),
951936
],
952937
)
953938
def system(session, protobuf_implementation, database_dialect):
@@ -975,14 +960,6 @@ replacements:
975960
"Only run system tests on real Spanner with one protobuf implementation to speed up the build"
976961
)
977962
978-
if protobuf_implementation == "cpp" and session.python in (
979-
"3.11",
980-
"3.12",
981-
"3.13",
982-
"3.14",
983-
):
984-
session.skip("cpp implementation is not supported in python 3.11+")
985-
986963
# Install pyopenssl for mTLS testing.
987964
if os.environ.get("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true":
988965
session.install("pyopenssl")
@@ -995,12 +972,6 @@ replacements:
995972
996973
install_systemtest_dependencies(session, "-c", constraints_path)
997974
998-
# TODO(https://github.com/googleapis/synthtool/issues/1976):
999-
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
1000-
# The 'cpp' implementation requires Protobuf<4.
1001-
if protobuf_implementation == "cpp":
1002-
session.install("protobuf<4")
1003-
1004975
# Run py.test against the system tests.
1005976
if system_test_exists:
1006977
args = [
@@ -1174,21 +1145,11 @@ replacements:
11741145
("python", "POSTGRESQL"),
11751146
("upb", "GOOGLE_STANDARD_SQL"),
11761147
("upb", "POSTGRESQL"),
1177-
("cpp", "GOOGLE_STANDARD_SQL"),
1178-
("cpp", "POSTGRESQL"),
11791148
],
11801149
)
11811150
def prerelease_deps(session, protobuf_implementation, database_dialect):
11821151
"""Run all tests with prerelease versions of dependencies installed."""
11831152
1184-
if protobuf_implementation == "cpp" and session.python in (
1185-
"3.11",
1186-
"3.12",
1187-
"3.13",
1188-
"3.14",
1189-
):
1190-
session.skip("cpp implementation is not supported in python 3.11+")
1191-
11921153
# Install all dependencies
11931154
session.install("-e", ".[all, tests, tracing]")
11941155
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES

packages/google-cloud-bigtable/noxfile.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"3.12",
3434
"3.13",
3535
"3.14",
36+
"3.15",
3637
]
3738

3839
UNIT_TEST_STANDARD_DEPENDENCIES = [
@@ -216,25 +217,21 @@ def install_unittest_dependencies(session, *constraints):
216217
@nox.session(python=ALL_PYTHON)
217218
@nox.parametrize(
218219
"protobuf_implementation",
219-
["python", "upb", "cpp"],
220+
["python", "upb"],
220221
)
221222
def unit(session, protobuf_implementation):
222223
# Install all test dependencies, then install this package in-place.
223-
py_version = tuple([int(v) for v in session.python.split(".")])
224-
if protobuf_implementation == "cpp" and py_version >= (3, 11):
225-
session.skip("cpp implementation is not supported in python 3.11+")
224+
225+
# TODO(https://github.com/googleapis/google-cloud-python/issues/17741):
226+
# Remove once `google-crc32c` wheels are published for 3.15
227+
if session.python == "3.15":
228+
session.skip("Skipping 3.15 until wheels are available for google-crc32c.")
226229

227230
constraints_path = str(
228231
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
229232
)
230233
install_unittest_dependencies(session, "-c", constraints_path)
231234

232-
# TODO(https://github.com/googleapis/synthtool/issues/1976):
233-
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
234-
# The 'cpp' implementation requires Protobuf<4.
235-
if protobuf_implementation == "cpp":
236-
session.install("protobuf<4")
237-
238235
# Run py.test against the unit tests.
239236
session.run(
240237
"py.test",
@@ -466,15 +463,11 @@ def docfx(session):
466463
@nox.session(python=DEFAULT_PYTHON_VERSION)
467464
@nox.parametrize(
468465
"protobuf_implementation",
469-
["python", "upb", "cpp"],
466+
["python", "upb"],
470467
)
471468
def prerelease_deps(session, protobuf_implementation):
472469
"""Run all tests with prerelease versions of dependencies installed."""
473470

474-
py_version = tuple([int(v) for v in session.python.split(".")])
475-
if protobuf_implementation == "cpp" and py_version >= (3, 11):
476-
session.skip("cpp implementation is not supported in python 3.11+")
477-
478471
# Install all dependencies
479472
session.install("-e", ".[all, tests, tracing]")
480473
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES

packages/google-cloud-spanner/noxfile.py

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"3.12",
3737
"3.13",
3838
"3.14",
39+
"3.15",
3940
]
4041
UNIT_TEST_STANDARD_DEPENDENCIES = [
4142
"mock",
@@ -214,30 +215,16 @@ def install_unittest_dependencies(session, *constraints):
214215
@nox.session(python=ALL_PYTHON)
215216
@nox.parametrize(
216217
"protobuf_implementation",
217-
["python", "upb", "cpp"],
218+
["python", "upb"],
218219
)
219220
def unit(session, protobuf_implementation):
220221
# Install all test dependencies, then install this package in-place.
221222

222-
if protobuf_implementation == "cpp" and session.python in (
223-
"3.11",
224-
"3.12",
225-
"3.13",
226-
"3.14",
227-
):
228-
session.skip("cpp implementation is not supported in python 3.11+")
229-
230223
constraints_path = str(
231224
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
232225
)
233226
install_unittest_dependencies(session, "-c", constraints_path)
234227

235-
# TODO(https://github.com/googleapis/synthtool/issues/1976):
236-
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
237-
# The 'cpp' implementation requires Protobuf<4.
238-
if protobuf_implementation == "cpp":
239-
session.install("protobuf<4")
240-
241228
# Run py.test against the unit tests.
242229
args = [
243230
"py.test",
@@ -333,8 +320,6 @@ def install_systemtest_dependencies(session, *constraints):
333320
("python", "POSTGRESQL"),
334321
("upb", "GOOGLE_STANDARD_SQL"),
335322
("upb", "POSTGRESQL"),
336-
("cpp", "GOOGLE_STANDARD_SQL"),
337-
("cpp", "POSTGRESQL"),
338323
],
339324
)
340325
def system(session, protobuf_implementation, database_dialect):
@@ -362,14 +347,6 @@ def system(session, protobuf_implementation, database_dialect):
362347
"Only run system tests on real Spanner with one protobuf implementation to speed up the build"
363348
)
364349

365-
if protobuf_implementation == "cpp" and session.python in (
366-
"3.11",
367-
"3.12",
368-
"3.13",
369-
"3.14",
370-
):
371-
session.skip("cpp implementation is not supported in python 3.11+")
372-
373350
# Install pyopenssl for mTLS testing.
374351
if os.environ.get("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true":
375352
session.install("pyopenssl")
@@ -382,12 +359,6 @@ def system(session, protobuf_implementation, database_dialect):
382359

383360
install_systemtest_dependencies(session, "-c", constraints_path)
384361

385-
# TODO(https://github.com/googleapis/synthtool/issues/1976):
386-
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
387-
# The 'cpp' implementation requires Protobuf<4.
388-
if protobuf_implementation == "cpp":
389-
session.install("protobuf<4")
390-
391362
# Run py.test against the system tests.
392363
if system_test_exists:
393364
args = [
@@ -561,21 +532,11 @@ def docfx(session):
561532
("python", "POSTGRESQL"),
562533
("upb", "GOOGLE_STANDARD_SQL"),
563534
("upb", "POSTGRESQL"),
564-
("cpp", "GOOGLE_STANDARD_SQL"),
565-
("cpp", "POSTGRESQL"),
566535
],
567536
)
568537
def prerelease_deps(session, protobuf_implementation, database_dialect):
569538
"""Run all tests with prerelease versions of dependencies installed."""
570539

571-
if protobuf_implementation == "cpp" and session.python in (
572-
"3.11",
573-
"3.12",
574-
"3.13",
575-
"3.14",
576-
):
577-
session.skip("cpp implementation is not supported in python 3.11+")
578-
579540
# Install all dependencies
580541
session.install("-e", ".[all, tests, tracing]")
581542
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES

0 commit comments

Comments
 (0)