Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit c281bb6

Browse files
Merge branch 'main' into run-mypy-on-fragments-latest
2 parents 673df90 + 54550f0 commit c281bb6

File tree

54 files changed

+263
-301
lines changed

Some content is hidden

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

54 files changed

+263
-301
lines changed

.librarian/state.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:68c7c79adf43af1be4c0527673342dd180aebebf652ea623614eaebff924ca27
22
libraries:
33
- id: gapic-generator
4-
version: 1.30.10
4+
version: 1.30.13
55
last_generated_commit: ""
66
apis: []
77
source_roots:

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
[1]: https://pypi.org/project/gapic-generator/#history
66

7+
## [1.30.13](https://github.com/googleapis/gapic-generator-python/compare/v1.30.12...v1.30.13) (2026-03-13)
8+
9+
## [1.30.12](https://github.com/googleapis/gapic-generator-python/compare/v1.30.11...v1.30.12) (2026-03-12)
10+
11+
## [1.30.11](https://github.com/googleapis/gapic-generator-python/compare/v1.30.10...v1.30.11) (2026-03-11)
12+
713
## [1.30.10](https://github.com/googleapis/gapic-generator-python/compare/v1.30.9...v1.30.10) (2026-03-09)
814

915

gapic/templates/_pypi_packages.j2

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ Where the first <tuple> contains the API, including the version and the second
44
tuple contains the PyPI package name, the minimum allowed version and the maximum
55
allowed version.
66
7-
Note: Set the minimum version for google-cloud-documentai to 2.0.0 which has support for `barcode` in `google.cloud.documentai.types`
87
-->
98
{% set pypi_packages = {
109
("google", "apps", "card", "v1"): {"package_name": "google-apps-card", "lower_bound": "0.3.0", "upper_bound": "1.0.0"},
1110
("google", "apps", "script", "type"): {"package_name": "google-apps-script-type", "lower_bound": "0.2.0", "upper_bound": "1.0.0"},
1211
("google", "geo", "type"): {"package_name": "google-geo-type", "lower_bound": "0.1.0", "upper_bound": "1.0.0"},
13-
("google", "identity", "accesscontextmanager", "v1"): {"package_name": "google-cloud-access-context-manager", "lower_bound": "0.1.2", "upper_bound": "1.0.0"},
14-
("google", "cloud", "documentai", "v1"): {"package_name": "google-cloud-documentai", "lower_bound": "2.0.0", "upper_bound": "4.0.0"},
15-
("google", "cloud", "kms", "v1"): {"package_name": "google-cloud-kms", "lower_bound": "2.3.0", "upper_bound": "4.0.0"},
16-
("google", "cloud", "osconfig", "v1"): {"package_name": "google-cloud-os-config", "lower_bound": "1.0.0", "upper_bound": "2.0.0"},
12+
("google", "identity", "accesscontextmanager", "v1"): {"package_name": "google-cloud-access-context-manager", "lower_bound": "0.2.0", "upper_bound": "1.0.0"},
13+
("google", "cloud", "documentai", "v1"): {"package_name": "google-cloud-documentai", "lower_bound": "2.4.1", "upper_bound": "4.0.0"},
14+
("google", "cloud", "kms", "v1"): {"package_name": "google-cloud-kms", "lower_bound": "2.13.0", "upper_bound": "4.0.0"},
15+
("google", "cloud", "osconfig", "v1"): {"package_name": "google-cloud-os-config", "lower_bound": "1.13.0", "upper_bound": "2.0.0"},
1716
("google", "iam", "v1"): {"package_name": "grpc-google-iam-v1", "lower_bound": "0.14.0", "upper_bound": "1.0.0"},
1817
("google", "iam", "v2"): {"package_name": "google-cloud-iam", "lower_bound": "2.12.2", "upper_bound": "3.0.0"},
1918
("google", "shopping", "type"): {"package_name": "google-shopping-type", "lower_bound": "1.0.0", "upper_bound": "2.0.0"}

gapic/templates/examples/feature_fragments.j2

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ request=request
230230
{# Note: this doesn't deal with enums or unions #}
231231
{# LROs return operation objects and paged requests return pager objects #}
232232
{% if transport == "grpc-async" and calling_form not in
233-
[calling_form_enum.LongRunningRequestPromise, calling_form_enum.RequestPagedAll] %}
233+
[calling_form_enum.RequestPaged, calling_form_enum.RequestPagedAll] %}
234234
await{{ " "}}
235235
{%- endif -%}
236236
{% if calling_form in [calling_form_enum.RequestStreamingBidi,
@@ -242,13 +242,6 @@ client.{{ render_method_name(sample)|trim }}({{ render_request_params_unary(samp
242242
{% endif %}
243243
{% endmacro %}
244244

245-
{% macro operation_text(transport) %}
246-
{% if transport == "grpc-async" %}
247-
(await operation)
248-
{% else %}
249-
operation
250-
{% endif %}
251-
{% endmacro %}
252245

253246
{# Setting up the method invocation is the responsibility of the caller: #}
254247
{# it's just easier to set up client side streaming and other things from outside this macro. #}
@@ -294,9 +287,7 @@ operation = {{ method_invocation_text|trim }}
294287

295288
print("Waiting for operation to complete...")
296289

297-
{% with operation_text = operation_text(transport) %}
298-
response = {{ operation_text|trim }}.result()
299-
{% endwith %}
290+
response = {% if transport == "grpc-async" %}await {% endif %}operation.result()
300291

301292
# Handle the response
302293
{% for statement in response_statements %}

gapic/templates/noxfile.py.j2

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@ nox.options.error_on_missing_interpreters = True
8787
@nox.session(python=ALL_PYTHON)
8888
def mypy(session):
8989
"""Run the type checker."""
90+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2579):
91+
# use the latest version of mypy
9092
session.install(
91-
"mypy",
93+
"mypy<1.16.0",
9294
"types-requests",
9395
"types-protobuf",
9496
)
@@ -246,27 +248,16 @@ def install_unittest_dependencies(session, *constraints):
246248
@nox.session(python=ALL_PYTHON)
247249
@nox.parametrize(
248250
"protobuf_implementation",
249-
["python", "upb", "cpp"],
251+
["python", "upb"],
250252
)
251253
def unit(session, protobuf_implementation):
252254
# Install all test dependencies, then install this package in-place.
253255

254-
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
255-
# Remove this check once support for Protobuf 3.x is dropped.
256-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
257-
session.skip("cpp implementation is not supported in python 3.11+")
258-
259256
constraints_path = str(
260257
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
261258
)
262259
install_unittest_dependencies(session, "-c", constraints_path)
263260

264-
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
265-
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
266-
# The 'cpp' implementation requires Protobuf<4.
267-
if protobuf_implementation == "cpp":
268-
session.install("protobuf<4")
269-
270261
# Run py.test against the unit tests.
271262
session.run(
272263
"py.test",
@@ -461,7 +452,7 @@ def docfx(session):
461452
@nox.session(python=PREVIEW_PYTHON_VERSION)
462453
@nox.parametrize(
463454
"protobuf_implementation",
464-
["python", "upb", "cpp"],
455+
["python", "upb"],
465456
)
466457
def prerelease_deps(session, protobuf_implementation):
467458
"""
@@ -471,11 +462,6 @@ def prerelease_deps(session, protobuf_implementation):
471462
`pip install --pre <package>`.
472463
"""
473464

474-
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
475-
# Remove this check once support for Protobuf 3.x is dropped.
476-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
477-
session.skip("cpp implementation is not supported in python 3.11+")
478-
479465
# Install all dependencies
480466
session.install("-e", ".")
481467

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
name = "gapic-generator"
2323
description = "Google API Client Generator for Python"
2424
url = "https://github.com/googleapis/gapic-generator-python"
25-
version = "1.30.10"
25+
version = "1.30.13"
2626
release_status = "Development Status :: 5 - Production/Stable"
2727
dependencies = [
2828
# Ensure that the lower bounds of these dependencies match what we have in the

tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,11 @@ async def sample_export_assets():
322322
)
323323
324324
# Make the request
325-
operation = client.export_assets(request=request)
325+
operation = await client.export_assets(request=request)
326326
327327
print("Waiting for operation to complete...")
328328
329-
response = (await operation).result()
329+
response = await operation.result()
330330
331331
# Handle the response
332332
print(response)
@@ -1727,11 +1727,11 @@ async def sample_analyze_iam_policy_longrunning():
17271727
)
17281728
17291729
# Make the request
1730-
operation = client.analyze_iam_policy_longrunning(request=request)
1730+
operation = await client.analyze_iam_policy_longrunning(request=request)
17311731
17321732
print("Waiting for operation to complete...")
17331733
1734-
response = (await operation).result()
1734+
response = await operation.result()
17351735
17361736
# Handle the response
17371737
print(response)

tests/integration/goldens/asset/noxfile.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@
9494
@nox.session(python=ALL_PYTHON)
9595
def mypy(session):
9696
"""Run the type checker."""
97+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2579):
98+
# use the latest version of mypy
9799
session.install(
98-
"mypy",
100+
"mypy<1.16.0",
99101
"types-requests",
100102
"types-protobuf",
101103
)
@@ -244,27 +246,16 @@ def install_unittest_dependencies(session, *constraints):
244246
@nox.session(python=ALL_PYTHON)
245247
@nox.parametrize(
246248
"protobuf_implementation",
247-
["python", "upb", "cpp"],
249+
["python", "upb"],
248250
)
249251
def unit(session, protobuf_implementation):
250252
# Install all test dependencies, then install this package in-place.
251253

252-
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
253-
# Remove this check once support for Protobuf 3.x is dropped.
254-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
255-
session.skip("cpp implementation is not supported in python 3.11+")
256-
257254
constraints_path = str(
258255
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
259256
)
260257
install_unittest_dependencies(session, "-c", constraints_path)
261258

262-
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
263-
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
264-
# The 'cpp' implementation requires Protobuf<4.
265-
if protobuf_implementation == "cpp":
266-
session.install("protobuf<4")
267-
268259
# Run py.test against the unit tests.
269260
session.run(
270261
"py.test",
@@ -453,7 +444,7 @@ def docfx(session):
453444
@nox.session(python=PREVIEW_PYTHON_VERSION)
454445
@nox.parametrize(
455446
"protobuf_implementation",
456-
["python", "upb", "cpp"],
447+
["python", "upb"],
457448
)
458449
def prerelease_deps(session, protobuf_implementation):
459450
"""
@@ -463,11 +454,6 @@ def prerelease_deps(session, protobuf_implementation):
463454
`pip install --pre <package>`.
464455
"""
465456

466-
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2388):
467-
# Remove this check once support for Protobuf 3.x is dropped.
468-
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13", "3.14"):
469-
session.skip("cpp implementation is not supported in python 3.11+")
470-
471457
# Install all dependencies
472458
session.install("-e", ".")
473459

tests/integration/goldens/asset/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ async def sample_analyze_iam_policy_longrunning():
5151
)
5252

5353
# Make the request
54-
operation = client.analyze_iam_policy_longrunning(request=request)
54+
operation = await client.analyze_iam_policy_longrunning(request=request)
5555

5656
print("Waiting for operation to complete...")
5757

58-
response = (await operation).result()
58+
response = await operation.result()
5959

6060
# Handle the response
6161
print(response)

tests/integration/goldens/asset/samples/generated_samples/cloudasset_v1_generated_asset_service_export_assets_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ async def sample_export_assets():
4848
)
4949

5050
# Make the request
51-
operation = client.export_assets(request=request)
51+
operation = await client.export_assets(request=request)
5252

5353
print("Waiting for operation to complete...")
5454

55-
response = (await operation).result()
55+
response = await operation.result()
5656

5757
# Handle the response
5858
print(response)

0 commit comments

Comments
 (0)