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

Commit 16ea0ed

Browse files
Merge branch 'main' into ai-gsutil-migration-961c838c0aff4777b43e911588d989d3
2 parents 46cc666 + d6098ca commit 16ea0ed

File tree

138 files changed

+1292
-572
lines changed

Some content is hidden

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

138 files changed

+1292
-572
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Code owners file.
22
# This file controls who is tagged for review for any given pull request.
33

4-
* @googleapis/python-core-client-libraries
4+
* @googleapis/cloud-sdk-python-team

.github/blunderbuss.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
# Note: This file is autogenerated. To make changes to the assignee
55
# team, please update `codeowner_team` in `.repo-metadata.json`.
66
assign_issues:
7-
- googleapis/actools-python
7+
- googleapis/cloud-sdk-python-team
88

99
assign_issues_by:
1010
- labels:
1111
- "samples"
1212
to:
1313
- googleapis/python-samples-reviewers
14-
- googleapis/actools-python
14+
- googleapis/cloud-sdk-python-team
1515

1616
assign_prs:
17-
- googleapis/actools-python
17+
- googleapis/cloud-sdk-python-team

.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.5
4+
version: 1.30.7
55
last_generated_commit: ""
66
apis: []
77
source_roots:

.repo-metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"repo": "googleapis/gapic-generator-python",
1111
"distribution_name": "gapic-generator",
1212
"default_version": "",
13-
"codeowner_team": "@googleapis/actools-python"
13+
"codeowner_team": "@googleapis/cloud-sdk-python-team"
1414
}

CHANGELOG.md

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

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

7+
## [1.30.7](https://github.com/googleapis/gapic-generator-python/compare/v1.30.6...v1.30.7) (2026-02-05)
8+
9+
10+
### Bug Fixes
11+
12+
* updates tests for ListValue response fields (#2532) ([cb659ad2ba5b1a169b9acb5f9055e5ee003f84bd](https://github.com/googleapis/gapic-generator-python/commit/cb659ad2ba5b1a169b9acb5f9055e5ee003f84bd))
13+
14+
## [1.30.6](https://github.com/googleapis/gapic-generator-python/compare/v1.30.5...v1.30.6) (2026-01-30)
15+
16+
17+
### Bug Fixes
18+
19+
* fix incorrect REST request serialization (#2549) ([46e765e5fa2677b5b0d5c85ae5bdad495f9f7e60](https://github.com/googleapis/gapic-generator-python/commit/46e765e5fa2677b5b0d5c85ae5bdad495f9f7e60))
20+
* filter sphinx warnings related to adding a new line after lists (#2533) ([ae0a9e817513c6d4d03fc86685f66be8d9699862](https://github.com/googleapis/gapic-generator-python/commit/ae0a9e817513c6d4d03fc86685f66be8d9699862))
21+
722
## [1.30.5](https://github.com/googleapis/gapic-generator-python/compare/v1.30.4...v1.30.5) (2026-01-26)
823

924

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Execute unit tests by running one of the sessions prefixed with `unit-`.
2323

2424
## Formatting
2525

26-
- Lint sources by running `nox -s blacken`. Use `nox -s lint` to run lint check.
26+
- Format sources by running `nox -s format`. Use `nox -s lint` to run lint check.
2727

2828
## Integration Tests
2929

docs/conf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232
# Replace |version| in the docs with the actual version string.
3333
rst_epilog = """
3434
.. |version| replace:: {version}
35-
""".format(
36-
version=version
37-
)
35+
""".format(version=version)
3836

3937
# -- General configuration ---------------------------------------------------
4038

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{% macro sphinx_imports() -%}
2+
import logging
3+
from typing import Any
4+
{%- endmacro %}
5+
6+
{% macro sphinx_setup() -%}
7+
class UnexpectedUnindentFilter(logging.Filter):
8+
"""Filter out warnings about unexpected unindentation following bullet lists."""
9+
10+
def filter(self, record: logging.LogRecord) -> bool:
11+
"""Filter the log record.
12+
13+
Args:
14+
record (logging.LogRecord): The log record.
15+
16+
Returns:
17+
bool: False to suppress the warning, True to allow it.
18+
"""
19+
msg = record.getMessage()
20+
if "Bullet list ends without a blank line" in msg:
21+
return False
22+
return True
23+
24+
25+
def setup(app: Any) -> None:
26+
"""Setup the Sphinx application.
27+
28+
Args:
29+
app (Any): The Sphinx application.
30+
"""
31+
# Sphinx's logger is hierarchical. Adding a filter to the
32+
# root 'sphinx' logger will catch warnings from all sub-loggers.
33+
logger = logging.getLogger('sphinx')
34+
logger.addFilter(UnexpectedUnindentFilter())
35+
{%- endmacro %}

gapic/ads-templates/docs/conf.py.j2

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% extends '_base.py.j2' %}
22

33
{% block content %}
4+
{% from "docs/common_setup.py.j2" import sphinx_imports, sphinx_setup %}
45

56
#
67
# {{ api.naming.warehouse_package_name }} documentation build configuration file
@@ -14,9 +15,11 @@
1415
# All configuration values have a default; values that are commented out
1516
# serve to show the default.
1617

17-
import sys
18+
import logging
1819
import os
1920
import shlex
21+
import sys
22+
{{ sphinx_imports() }}
2023

2124
# If extensions (or modules to document with autodoc) are in another directory,
2225
# add these directories to sys.path here. If the directory is relative to the
@@ -361,4 +364,7 @@ napoleon_use_admonition_for_references = False
361364
napoleon_use_ivar = False
362365
napoleon_use_param = True
363366
napoleon_use_rtype = True
367+
368+
# Setup for sphinx behaviors such as warning filters.
369+
{{ sphinx_setup() }}
364370
{% endblock %}

gapic/cli/generate.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from gapic import generator
2424
from gapic.schema import api
2525
from gapic.utils import Options
26+
from gapic.utils.cache import generation_cache_context
2627

2728

2829
@click.command()
@@ -38,7 +39,7 @@
3839
"--output",
3940
type=click.File("wb"),
4041
default=sys.stdout.buffer,
41-
help="Where to output the `CodeGeneratorResponse`. " "Defaults to stdout.",
42+
help="Where to output the `CodeGeneratorResponse`. Defaults to stdout.",
4243
)
4344
def generate(request: typing.BinaryIO, output: typing.BinaryIO) -> None:
4445
"""Generate a full API client description."""
@@ -56,15 +57,23 @@ def generate(request: typing.BinaryIO, output: typing.BinaryIO) -> None:
5657
[p.package for p in req.proto_file if p.name in req.file_to_generate]
5758
).rstrip(".")
5859

59-
# Build the API model object.
60-
# This object is a frozen representation of the whole API, and is sent
61-
# to each template in the rendering step.
62-
api_schema = api.API.build(req.proto_file, opts=opts, package=package)
60+
# Create the generation cache context.
61+
# This provides the shared storage for the @cached_proto_context decorator.
62+
# 1. Performance: Memoizes `with_context` calls, speeding up generation significantly.
63+
# 2. Safety: The decorator uses this storage to "pin" Proto objects in memory.
64+
# This prevents Python's Garbage Collector from deleting objects created during
65+
# `API.build` while `Generator.get_response` is still using their IDs.
66+
# (See `gapic.utils.cache.cached_proto_context` for the specific pinning logic).
67+
with generation_cache_context():
68+
# Build the API model object.
69+
# This object is a frozen representation of the whole API, and is sent
70+
# to each template in the rendering step.
71+
api_schema = api.API.build(req.proto_file, opts=opts, package=package)
6372

64-
# Translate into a protobuf CodeGeneratorResponse; this reads the
65-
# individual templates and renders them.
66-
# If there are issues, error out appropriately.
67-
res = generator.Generator(opts).get_response(api_schema, opts)
73+
# Translate into a protobuf CodeGeneratorResponse; this reads the
74+
# individual templates and renders them.
75+
# If there are issues, error out appropriately.
76+
res = generator.Generator(opts).get_response(api_schema, opts)
6877

6978
# Output the serialized response.
7079
output.write(res.SerializeToString())

0 commit comments

Comments
 (0)