Skip to content

Commit fc14e4a

Browse files
authored
Merge branch 'googleapis:main' into main
2 parents 2464fd3 + c353aa5 commit fc14e4a

2,844 files changed

Lines changed: 306359 additions & 115293 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.

.generator/cli.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,12 @@ def handle_configure(
290290
)
291291
prepared_config = _prepare_new_library_config(new_library_config)
292292

293-
# Create a `CHANGELOG.md` and `docs/CHANGELOG.md` file for the new library
293+
is_mono_repo = _is_mono_repo(input)
294294
library_id = _get_library_id(prepared_config)
295-
_create_new_changelog_for_library(library_id, output)
295+
path_to_library = f"packages/{library_id}" if is_mono_repo else "."
296+
if not Path(f"{repo}/{path_to_library}").exists():
297+
# Create a `CHANGELOG.md` and `docs/CHANGELOG.md` file for the new library
298+
_create_new_changelog_for_library(library_id, output)
296299

297300
# Write the new library configuration to configure-response.json.
298301
_write_json_file(f"{librarian}/configure-response.json", prepared_config)
@@ -410,13 +413,19 @@ def _copy_files_needed_for_post_processing(
410413
destination_dir = f"{output}/{path_to_library}"
411414

412415
if Path(source_dir).exists():
413-
shutil.copytree(
414-
source_dir,
415-
destination_dir,
416-
dirs_exist_ok=True,
417-
)
418-
# Apply headers only to the generator-input files copied above.
419-
_add_header_to_files(destination_dir)
416+
with tempfile.TemporaryDirectory() as tmp_dir:
417+
shutil.copytree(
418+
source_dir,
419+
tmp_dir,
420+
dirs_exist_ok=True,
421+
)
422+
# Apply headers only to the generator-input files copied above.
423+
_add_header_to_files(tmp_dir)
424+
shutil.copytree(
425+
tmp_dir,
426+
destination_dir,
427+
dirs_exist_ok=True,
428+
)
420429

421430
# We need to create these directories so that we can copy files necessary for post-processing.
422431
os.makedirs(

.generator/requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
click
2-
gapic-generator==1.28.3 # format generated samples
2+
gapic-generator==1.30.2 # remove formatting changes
33
nox
44
starlark-pyo3>=2025.1
55
build

.github/CODEOWNERS

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,4 @@
44
# Default owner for all directories not owned by others
55
* @googleapis/python-core-client-libraries @googleapis/cloud-sdk-librarian-team
66

7-
# Packages onboarded to librarian require review from both groups
8-
/packages/google-cloud-dlp/ @googleapis/python-core-client-libraries
9-
/packages/google-cloud-dlp/ @googleapis/cloud-sdk-librarian-team
10-
117
/packages/google-cloud-bigquery-storage/ @googleapis/api-bigquery
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
description: Allow documentation warnings for google-shopping-merchant-accounts due to formatting issue in google/protobuf/empty.proto
15+
url: https://github.com/googleapis/gapic-generator-python/issues/2490
16+
replacements:
17+
- paths: [
18+
packages/google-shopping-merchant-accounts/noxfile.py,
19+
]
20+
before: ' "-W", # warnings as errors\n'
21+
after: ''
22+
count: 1

.librarian/generator-input/client-post-processing/bigquery-storage-integration.yaml

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,12 @@ replacements:
183183
"ReadRowsStream",
184184
"ReadSession",
185185
count: 1
186-
# Given that this file is mostly handwritten, we could omit the file completely when we migrate to librarian
187-
# See `preserve_regex` in https://github.com/googleapis/librarian/blob/main/doc/language-onboarding.md#generate
186+
# Given that this file is mostly handwritten, we could omit the file during code generation
187+
# This will require a change to gapic-generator-python to provide the ability to omit files
188188
- paths: [
189189
packages/google-cloud-bigquery-storage/google/cloud/bigquery_storage_v1/__init__.py,
190190
]
191191
before: |
192-
__version__ = package_version.__version__\n\n
193192
from .services.big_query_read import BigQueryReadAsyncClient, BigQueryReadClient
194193
from .services.big_query_write import BigQueryWriteAsyncClient, BigQueryWriteClient
195194
from .types.arrow import ArrowRecordBatch, ArrowSchema, ArrowSerializationOptions
@@ -224,6 +223,19 @@ replacements:
224223
WriteStreamView,
225224
\)
226225
from .types.table import TableFieldSchema, TableSchema\n
226+
after: |
227+
from google.cloud.bigquery_storage_v1 import client, types\n\n
228+
class BigQueryReadClient(client.BigQueryReadClient):
229+
__doc__ = client.BigQueryReadClient.__doc__\n\n
230+
class BigQueryWriteClient(client.BigQueryWriteClient):
231+
__doc__ = client.BigQueryWriteClient.__doc__\n\n
232+
count: 1
233+
# Given that this file is mostly handwritten, we could omit the file during code generation
234+
# This will require a change to gapic-generator-python to provide the ability to omit files
235+
- paths: [
236+
packages/google-cloud-bigquery-storage/google/cloud/bigquery_storage_v1/__init__.py,
237+
]
238+
before: |
227239
__all__ = \(
228240
"BigQueryReadAsyncClient",
229241
"BigQueryWriteAsyncClient",
@@ -265,12 +277,6 @@ replacements:
265277
"WriteStreamView",
266278
\)
267279
after: |
268-
__version__ = package_version.__version__\n
269-
from google.cloud.bigquery_storage_v1 import client, types\n\n
270-
class BigQueryReadClient(client.BigQueryReadClient):
271-
__doc__ = client.BigQueryReadClient.__doc__\n\n
272-
class BigQueryWriteClient(client.BigQueryWriteClient):
273-
__doc__ = client.BigQueryWriteClient.__doc__\n\n
274280
__all__ = (
275281
# google.cloud.bigquery_storage_v1
276282
"__version__",
@@ -280,14 +286,13 @@ replacements:
280286
"BigQueryWriteClient",
281287
)
282288
count: 1
283-
# Given that this file is mostly handwritten, we could omit the file completely when we migrate to librarian
284-
# See `preserve_regex` in https://github.com/googleapis/librarian/blob/main/doc/language-onboarding.md#generate
289+
# Given that this file is mostly handwritten, we could omit the file during code generation
290+
# This will require a change to gapic-generator-python to provide the ability to omit files
285291
- paths: [
286292
packages/google-cloud-bigquery-storage/google/cloud/bigquery_storage_v1alpha/__init__.py,
287293
packages/google-cloud-bigquery-storage/google/cloud/bigquery_storage_v1beta/__init__.py,
288294
]
289295
before: |
290-
__version__ = package_version.__version__\n\n
291296
from .services.metastore_partition_service import \(
292297
MetastorePartitionServiceAsyncClient,
293298
MetastorePartitionServiceClient,
@@ -316,6 +321,16 @@ replacements:
316321
StorageDescriptor,
317322
StreamList,
318323
\)\n
324+
after: ""
325+
count: 2
326+
# Given that this file is mostly handwritten, we could omit the file during code generation
327+
# This will require a change to gapic-generator-python to provide the ability to omit files
328+
- paths: [
329+
packages/google-cloud-bigquery-storage/google/cloud/bigquery_storage_v1alpha/__init__.py,
330+
packages/google-cloud-bigquery-storage/google/cloud/bigquery_storage_v1beta/__init__.py,
331+
]
332+
before: |
333+
\)\n
319334
__all__ = \(
320335
"MetastorePartitionServiceAsyncClient",
321336
"BatchCreateMetastorePartitionsRequest",
@@ -341,15 +356,14 @@ replacements:
341356
"UpdateMetastorePartitionRequest",
342357
\)
343358
after: |
344-
__version__ = package_version.__version__
359+
)
345360
count: 2
346-
# Given that this file is mostly handwritten, we could omit the file completely when we migrate to librarian
347-
# See `preserve_regex` in https://github.com/googleapis/librarian/blob/main/doc/language-onboarding.md#generate
361+
# Given that this file is mostly handwritten, we could omit the file during code generation
362+
# This will require a change to gapic-generator-python to provide the ability to omit files
348363
- paths: [
349364
packages/google-cloud-bigquery-storage/google/cloud/bigquery_storage_v1beta2/__init__.py,
350365
]
351366
before: |
352-
__version__ = package_version.__version__\n\n
353367
from .services.big_query_read import BigQueryReadAsyncClient, BigQueryReadClient
354368
from .services.big_query_write import BigQueryWriteAsyncClient, BigQueryWriteClient
355369
from .types.arrow import ArrowRecordBatch, ArrowSchema, ArrowSerializationOptions
@@ -377,6 +391,19 @@ replacements:
377391
\)
378392
from .types.stream import DataFormat, ReadSession, ReadStream, WriteStream
379393
from .types.table import TableFieldSchema, TableSchema\n
394+
after: |
395+
from google.cloud.bigquery_storage_v1beta2 import client, types\n\n
396+
class BigQueryReadClient(client.BigQueryReadClient):
397+
__doc__ = client.BigQueryReadClient.__doc__\n\n
398+
class BigQueryWriteClient(client.BigQueryWriteClient):
399+
__doc__ = client.BigQueryWriteClient.__doc__\n\n
400+
count: 1
401+
# Given that this file is mostly handwritten, we could omit the file during code generation
402+
# This will require a change to gapic-generator-python to provide the ability to omit files
403+
- paths: [
404+
packages/google-cloud-bigquery-storage/google/cloud/bigquery_storage_v1beta2/__init__.py,
405+
]
406+
before: |
380407
__all__ = \(
381408
"BigQueryReadAsyncClient",
382409
"BigQueryWriteAsyncClient",
@@ -415,12 +442,6 @@ replacements:
415442
"WriteStream",
416443
\)
417444
after: |
418-
__version__ = package_version.__version__\n
419-
from google.cloud.bigquery_storage_v1beta2 import client, types\n\n
420-
class BigQueryReadClient(client.BigQueryReadClient):
421-
__doc__ = client.BigQueryReadClient.__doc__\n\n
422-
class BigQueryWriteClient(client.BigQueryWriteClient):
423-
__doc__ = client.BigQueryWriteClient.__doc__\n\n
424445
__all__ = (
425446
# google.cloud.bigquery_storage_v1beta2
426447
"__version__",
@@ -430,9 +451,6 @@ replacements:
430451
"BigQueryWriteClient",
431452
)
432453
count: 1
433-
# Given that this file is mostly handwritten, we could omit the file completely when we migrate to librarian
434-
# See `preserve_regex` in https://github.com/googleapis/librarian/blob/main/doc/language-onboarding.md#generate
435-
# We could also consider updating the docs/index.rst template so that the majority of handwritten changes are not required
436454
- paths: [
437455
packages/google-cloud-bigquery-storage/testing/constraints-3.7.txt,
438456
]
@@ -447,6 +465,8 @@ replacements:
447465
pyarrow==0.15.0
448466
google-auth==2.14.1
449467
count: 1
468+
# Given that this file is mostly handwritten, we could omit the file during code generation
469+
# This will require a change to gapic-generator-python to provide the ability to omit files
450470
- paths: [
451471
packages/google-cloud-bigquery-storage/docs/index.rst,
452472
]

.librarian/generator-input/client-post-processing/integrate-isolated-handwritten-code.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ replacements:
4545
packages/google-cloud-vision/google/cloud/vision_v1p4beta1/__init__.py,
4646
]
4747
before: |
48-
from .types.web_detection import WebDetection\n
48+
\)\n
4949
__all__ = \(
5050
after: |
51-
from .types.web_detection import WebDetection\n\n
51+
)\n\n
5252
@add_single_feature_methods
5353
class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient):
5454
__doc__ = IacImageAnnotatorClient.__doc__

0 commit comments

Comments
 (0)