Skip to content

Commit d4ea9c9

Browse files
authored
Merge branch 'main' into release-please--branches--main--components--google-cloud-productregistry
2 parents d80a66c + cc109ca commit d4ea9c9

67 files changed

Lines changed: 623 additions & 276 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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

Lines changed: 24 additions & 16 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 = [
@@ -418,6 +419,16 @@ replacements:
418419
SYSTEM_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
419420
420421
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
422+
# Path to the centralized mypy configuration file at the repository root.
423+
# Search upwards to support running nox from both monorepo packages and integration test goldens.
424+
MYPY_CONFIG_FILE = next(
425+
(
426+
str(p / "mypy.ini")
427+
for p in CURRENT_DIRECTORY.parents
428+
if (p / "mypy.ini").exists()
429+
),
430+
str(CURRENT_DIRECTORY.parent.parent / "mypy.ini"),
431+
)
421432
422433
# 'docfx' is excluded since it only needs to run in 'docs-presubmit'
423434
nox.options.sessions = [
@@ -527,7 +538,12 @@ replacements:
527538
"types-requests",
528539
)
529540
session.install("google-cloud-testutils")
530-
session.run("mypy", "-p", "google.cloud.bigtable.data")
541+
session.run(
542+
"mypy",
543+
f"--config-file={MYPY_CONFIG_FILE}",
544+
"-p",
545+
"google.cloud.bigtable.data",
546+
)
531547
532548
533549
@nox.session(python=DEFAULT_PYTHON_VERSION)
@@ -568,25 +584,21 @@ replacements:
568584
@nox.session(python=ALL_PYTHON)
569585
@nox.parametrize(
570586
"protobuf_implementation",
571-
["python", "upb", "cpp"],
587+
["python", "upb"],
572588
)
573589
def unit(session, protobuf_implementation):
574590
# 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+")
591+
592+
# TODO(https://github.com/googleapis/google-cloud-python/issues/17741):
593+
# Remove once `google-crc32c` wheels are published for 3.15
594+
if session.python == "3.15":
595+
session.skip("Skipping 3.15 until wheels are available for google-crc32c.")
578596
579597
constraints_path = str(
580598
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
581599
)
582600
install_unittest_dependencies(session, "-c", constraints_path)
583601
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-
590602
# Run py.test against the unit tests.
591603
session.run(
592604
"py.test",
@@ -818,15 +830,11 @@ replacements:
818830
@nox.session(python=DEFAULT_PYTHON_VERSION)
819831
@nox.parametrize(
820832
"protobuf_implementation",
821-
["python", "upb", "cpp"],
833+
["python", "upb"],
822834
)
823835
def prerelease_deps(session, protobuf_implementation):
824836
"""Run all tests with prerelease versions of dependencies installed."""
825837
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-
830838
# Install all dependencies
831839
session.install("-e", ".[all, tests, tracing]")
832840
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES

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

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -328,14 +328,14 @@ replacements:
328328
-------------------
329329
.. toctree::
330330
:maxdepth: 2
331-
331+
332332
usage
333-
333+
334334
Documentation
335335
-------------------
336336
.. toctree::
337337
:maxdepth: 3
338-
338+
339339
client
340340
logger
341341
entries
@@ -344,20 +344,20 @@ replacements:
344344
sink
345345
handlers
346346
transport
347-
348-
347+
348+
349349
Migration Guides
350350
----------------
351-
351+
352352
See the guide below for instructions on migrating between major releases of this library.
353-
353+
354354
.. toctree::
355355
:maxdepth: 2
356-
356+
357357
UPGRADING
358358
count: 1
359359
- paths: [
360-
"packages/google-cloud-logging/google/cloud/logging/__init__.py",
360+
"packages/google-cloud-logging/google/cloud/logging/__init__.py",
361361
]
362362
before: |
363363
from google.cloud.logging import gapic_version as package_version
@@ -463,6 +463,24 @@ replacements:
463463
"django",
464464
]
465465
count: 1
466+
- paths: [
467+
packages/google-cloud-logging/noxfile.py
468+
]
469+
before: |
470+
CURRENT_DIRECTORY = pathlib.Path\(__file__\).parent.absolute\(\)
471+
after: |
472+
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
473+
# Path to the centralized mypy configuration file at the repository root.
474+
# Search upwards to support running nox from both monorepo packages and integration test goldens.
475+
MYPY_CONFIG_FILE = next(
476+
(
477+
str(p / "mypy.ini")
478+
for p in CURRENT_DIRECTORY.parents
479+
if (p / "mypy.ini").exists()
480+
),
481+
str(CURRENT_DIRECTORY.parent.parent / "mypy.ini"),
482+
)
483+
count: 1
466484
- paths: [
467485
packages/google-cloud-logging/noxfile.py
468486
]
@@ -478,4 +496,19 @@ replacements:
478496
# TODO(https://github.com/googleapis/google-cloud-python/issues/13362):
479497
# Enable mypy once this repo has been updated for mypy evaluation.
480498
session.skip("Skip mypy since this library is not yet updated for mypy evaluation")
499+
500+
session.install("-e", ".")
501+
session.install(
502+
"mypy",
503+
"types-setuptools",
504+
"types-protobuf",
505+
"types-requests",
506+
)
507+
session.run(
508+
"mypy",
509+
f"--config-file={MYPY_CONFIG_FILE}",
510+
"-p",
511+
"google",
512+
*session.posargs,
513+
)
481514
count: 1

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

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
replacements:
2-
- paths:
2+
- paths:
33
- "packages/google-cloud-pubsub/google/pubsub_v1/services/**/*client.py"
44
before: 'instead\.\n(?:[ \t]*\n)*([ \t]+)DEFAULT_ENDPOINT = "pubsub\.googleapis\.com"'
55
after: |-
@@ -13,7 +13,7 @@ replacements:
1313
\g<1>DEFAULT_ENDPOINT = "pubsub.googleapis.com"
1414
count: 3
1515

16-
- paths:
16+
- paths:
1717
- "packages/google-cloud-pubsub/google/pubsub_v1/services/*/client.py"
1818
before: 'import json\n(?:[ \t]*\n)*import logging as std_logging'
1919
after: |-
@@ -23,7 +23,7 @@ replacements:
2323
import logging as std_logging
2424
count: 3
2525

26-
- paths:
26+
- paths:
2727
- "packages/google-cloud-pubsub/google/pubsub_v1/services/*/client.py"
2828
before: 'class\n(?:[ \t]*\n)*([ \t]+)self\._transport = transport_init\('
2929
after: |-
@@ -38,7 +38,7 @@ replacements:
3838
\g<1>self._transport = transport_init(
3939
count: 3
4040

41-
- paths:
41+
- paths:
4242
- "packages/google-cloud-pubsub/google/pubsub_v1/services/*/transports/grpc*.py"
4343
- "packages/google-cloud-pubsub/tests/unit/gapic/pubsub_v1/*.py"
4444
before: '\("grpc\.max_receive_message_length", -1\),\n(?:[ \t]*\n)*([ \t]+)\]'
@@ -49,19 +49,19 @@ replacements:
4949
\g<1>]
5050
count: 21
5151

52-
- paths:
52+
- paths:
5353
- "packages/google-cloud-pubsub/google/pubsub_v1/services/publisher/transports/base.py"
5454
before: 'deadline=60\.0,'
5555
after: 'deadline=600.0,'
5656
count: 9
5757

58-
- paths:
58+
- paths:
5959
- "packages/google-cloud-pubsub/google/pubsub_v1/services/**/*.py"
6060
before: 'gapic_version=package_version\.__version__'
6161
after: 'client_library_version=package_version.__version__'
6262
count: 9
6363

64-
- paths:
64+
- paths:
6565
- "packages/google-cloud-pubsub/google/pubsub_v1/services/subscriber/client.py"
6666
before: 'import logging as std_logging\n(?:[ \t]*\n)*import os'
6767
after: |-
@@ -71,7 +71,7 @@ replacements:
7171
import os
7272
count: 1
7373

74-
- paths:
74+
- paths:
7575
- "packages/google-cloud-pubsub/google/pubsub_v1/services/subscriber/async_client.py"
7676
before: 'import logging as std_logging\n(?:[ \t]*\n)*import re'
7777
after: |-
@@ -80,7 +80,7 @@ replacements:
8080
import re
8181
count: 1
8282

83-
- paths:
83+
- paths:
8484
- "packages/google-cloud-pubsub/google/pubsub_v1/services/subscriber/client.py"
8585
- "packages/google-cloud-pubsub/google/pubsub_v1/services/subscriber/async_client.py"
8686
before: 'request\.max_messages = max_messages\n(?:[ \t]*\n)*([ \t]+)# Wrap the RPC method'
@@ -96,7 +96,7 @@ replacements:
9696
\g<1># Wrap the RPC method
9797
count: 2
9898

99-
- paths:
99+
- paths:
100100
- "packages/google-cloud-pubsub/google/pubsub_v1/services/subscriber/client.py"
101101
before: '"""\n(?:[ \t]*\n)*([ \t]+)# Wrap the RPC method; this adds retry and timeout information,\n(?:[ \t]*\n)*[ \t]+# and friendly error handling\.\n(?:[ \t]*\n)*[ \t]+rpc = self\._transport\._wrapped_methods\[self\._transport\.streaming_pull\]'
102102
after: |-
@@ -403,6 +403,16 @@ replacements:
403403
before: 'nox\.options\.sessions = \[\n(?:[ \t]+)"unit",\n(?:[ \t]+)"system",\n(?:[ \t]+)"cover",\n(?:[ \t]+)"lint",\n(?:[ \t]+)"lint_setup_py",\n(?:[ \t]+)"blacken",\n(?:[ \t]+)"docs",\n\]'
404404
after: |-
405405
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
406+
# Path to the centralized mypy configuration file at the repository root.
407+
# Search upwards to support running nox from both monorepo packages and integration test goldens.
408+
MYPY_CONFIG_FILE = next(
409+
(
410+
str(p / "mypy.ini")
411+
for p in CURRENT_DIRECTORY.parents
412+
if (p / "mypy.ini").exists()
413+
),
414+
str(CURRENT_DIRECTORY.parent.parent / "mypy.ini"),
415+
)
406416
407417
nox.options.sessions = [
408418
"unit",
@@ -450,7 +460,7 @@ replacements:
450460
# mypy checks yet.
451461
# https://github.com/googleapis/gapic-generator-python/issues/1092
452462
# TODO: Re-enable mypy checks once we merge, since incremental checks are failing due to protobuf upgrade
453-
# session.run("mypy", "-p", "google.cloud", "--exclude", "google/pubsub_v1/")
463+
# session.run("mypy", f"--config-file={MYPY_CONFIG_FILE}", "-p", "google.cloud", "--exclude", "google/pubsub_v1/")
454464
455465
456466
@nox.session(python=DEFAULT_PYTHON_VERSION)

.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

0 commit comments

Comments
 (0)