Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
description: Update google-auth version to avoid dependency conflict
url: https://github.com/googleapis/google-cloud-python/issues/17131
replacements:
- paths: [
packages/google-cloud-automl/setup.py,
]
before: |
dependencies = \[
"google-api-core[grpc\] >= 2.17.1, <3.0.0",
# Exclude incompatible versions of `google-auth`
# See https://github.com/googleapis/google-cloud-python/issues/12364
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
"grpcio >= 1.44.0, < 2.0.0",
"grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
"proto-plus >= 1.22.3, <2.0.0",
"proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'",
"protobuf >= 4.25.8, < 8.0.0",
Comment on lines +20 to +30
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The before block uses hardcoded versions. According to the repository rules, search patterns for automated code replacements in librarian post-processing YAML files should use flexible regex patterns (such as [\s\S]*) to match version strings instead of hardcoding specific versions. This ensures the replacement logic remains functional even when dependency versions are updated in the source files. Also, ensure all special characters like [ are properly escaped.

    before: |
      dependencies = \[
          "google-api-core\[grpc\] >= [\s\S]*, <3.0.0",
          # Exclude incompatible versions of google-auth
          # See https://github.com/googleapis/google-cloud-python/issues/12364
          "google-auth >= [\s\S]*, <3.0.0,!=2.24.0,!=2.25.0",
          "grpcio >= [\s\S]*, < 2.0.0",
          "grpcio >= [\s\S]*, < 2.0.0; python_version >= '[\s\S]*'",
          "proto-plus >= [\s\S]*, <2.0.0",
          "proto-plus >= [\s\S]*, <2.0.0; python_version >= '[\s\S]*'",
          "protobuf >= [\s\S]*, < 8.0.0",
References
  1. When defining search patterns for automated code replacements in librarian post-processing YAML files, use flexible regex patterns (such as [\s\S]*) to match version strings instead of hardcoding specific versions. This ensures the replacement logic remains functional even when dependency versions are updated in the source files, preventing match failures.

after: |
dependencies = [
"google-api-core[grpc] >= 2.17.1, <3.0.0",
# Exclude incompatible versions of `google-auth`
# See https://github.com/googleapis/google-cloud-python/issues/17131
"google-auth >= 2.26.1, <3.0.0,!=2.24.0,!=2.25.0",
"grpcio >= 1.44.0, < 2.0.0",
"grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
"proto-plus >= 1.22.3, <2.0.0",
"proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'",
"protobuf >= 4.25.8, < 8.0.0",
count: 1
1 change: 0 additions & 1 deletion librarian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ libraries:
- google/cloud/automl_v1beta1/services/tables/__init__.py
- google/cloud/automl_v1beta1/services/tables/gcs_client.py
- google/cloud/automl_v1beta1/services/tables/tables_client.py
skip_generate: true
python:
library_type: GAPIC_COMBO
metadata_name_override: automl
Expand Down
4 changes: 2 additions & 2 deletions packages/google-cloud-automl/docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -83,7 +83,7 @@

# General information about the project.
project = "google-cloud-automl"
copyright = "2025, Google, LLC"
copyright = "2026, Google, LLC"
author = "Google APIs"

# The version info for the project you're documenting, acts as replacement for
Expand Down
25 changes: 4 additions & 21 deletions packages/google-cloud-automl/google/cloud/automl_v1/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -21,13 +21,7 @@

__version__ = package_version.__version__

if sys.version_info >= (3, 8): # pragma: NO COVER
from importlib import metadata
else: # pragma: NO COVER
# TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
# this code path once we drop support for Python 3.7
import importlib_metadata as metadata

from importlib import metadata

from .services.auto_ml import AutoMlAsyncClient, AutoMlClient
from .services.prediction_service import (
Expand Down Expand Up @@ -149,28 +143,17 @@
# An older version of api_core is installed which does not define the
# functions above. We do equivalent checks manually.
try:
import sys
import warnings

_py_version_str = sys.version.split()[0]
_package_label = "google.cloud.automl_v1"
if sys.version_info < (3, 9):
if sys.version_info < (3, 10):
warnings.warn(
"You are using a non-supported Python version "
+ f"({_py_version_str}). Google will not post any further "
+ f"updates to {_package_label} supporting this Python version. "
+ "Please upgrade to the latest Python version, or at "
+ f"least to Python 3.9, and then update {_package_label}.",
FutureWarning,
)
if sys.version_info[:2] == (3, 9):
warnings.warn(
f"You are using a Python version ({_py_version_str}) "
+ f"which Google will stop supporting in {_package_label} in "
+ "January 2026. Please "
+ "upgrade to the latest Python version, or at "
+ "least to Python 3.10, before then, and "
+ f"then update {_package_label}.",
+ f"least to Python 3.10, and then update {_package_label}.",
FutureWarning,
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -365,11 +365,11 @@ async def sample_create_dataset():
)

# Make the request
operation = client.create_dataset(request=request)
operation = await client.create_dataset(request=request)

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

response = (await operation).result()
response = await operation.result()

# Handle the response
print(response)
Expand Down Expand Up @@ -869,11 +869,11 @@ async def sample_delete_dataset():
)

# Make the request
operation = client.delete_dataset(request=request)
operation = await client.delete_dataset(request=request)

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

response = (await operation).result()
response = await operation.result()

# Handle the response
print(response)
Expand Down Expand Up @@ -1016,11 +1016,11 @@ async def sample_import_data():
)

# Make the request
operation = client.import_data(request=request)
operation = await client.import_data(request=request)

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

response = (await operation).result()
response = await operation.result()

# Handle the response
print(response)
Expand Down Expand Up @@ -1168,11 +1168,11 @@ async def sample_export_data():
)

# Make the request
operation = client.export_data(request=request)
operation = await client.export_data(request=request)

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

response = (await operation).result()
response = await operation.result()

# Handle the response
print(response)
Expand Down Expand Up @@ -1424,11 +1424,11 @@ async def sample_create_model():
)

# Make the request
operation = client.create_model(request=request)
operation = await client.create_model(request=request)

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

response = (await operation).result()
response = await operation.result()

# Handle the response
print(response)
Expand Down Expand Up @@ -1796,11 +1796,11 @@ async def sample_delete_model():
)

# Make the request
operation = client.delete_model(request=request)
operation = await client.delete_model(request=request)

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

response = (await operation).result()
response = await operation.result()

# Handle the response
print(response)
Expand Down Expand Up @@ -2064,11 +2064,11 @@ async def sample_deploy_model():
)

# Make the request
operation = client.deploy_model(request=request)
operation = await client.deploy_model(request=request)

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

response = (await operation).result()
response = await operation.result()

# Handle the response
print(response)
Expand Down Expand Up @@ -2205,11 +2205,11 @@ async def sample_undeploy_model():
)

# Make the request
operation = client.undeploy_model(request=request)
operation = await client.undeploy_model(request=request)

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

response = (await operation).result()
response = await operation.result()

# Handle the response
print(response)
Expand Down Expand Up @@ -2350,11 +2350,11 @@ async def sample_export_model():
)

# Make the request
operation = client.export_model(request=request)
operation = await client.export_model(request=request)

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

response = (await operation).result()
response = await operation.result()

# Handle the response
print(response)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -570,11 +570,11 @@ async def sample_batch_predict():
)

# Make the request
operation = client.batch_predict(request=request)
operation = await client.batch_predict(request=request)

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

response = (await operation).result()
response = await operation.result()

# Handle the response
print(response)
Expand Down
Loading
Loading