Skip to content
Open
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
2 changes: 1 addition & 1 deletion gapic/templates/setup.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ else:
release_status = "Development Status :: 5 - Production/Stable"

dependencies = [
"google-api-core[grpc] >= 2.11.0, <3.0.0",
"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",
Expand Down
28 changes: 28 additions & 0 deletions gapic/templates/testing/constraints-3.9-async-rest.txt.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{% set rest_async_io_enabled = api.all_library_settings[api.naming.proto_package].python_settings.experimental_features.rest_async_io_enabled %}
{% if rest_async_io_enabled %}
# -*- coding: utf-8 -*-
{% from '_pypi_packages.j2' import pypi_packages %}
# This constraints file is used to check that lower bounds
# are correct in setup.py
# List all library dependencies and extras in this file,
# pinning their versions to their lower bounds.
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# then this file should have google-cloud-foo==1.14.0
google-api-core==2.21.0
google-auth==2.35.0
{% if api.requires_package(("google", "iam", "v1")) or api.naming.warehouse_package_name == 'google-fragment' %}
grpcio==1.44.0 # from grpc-google-iam-v1
{% else %}
grpcio==1.33.2 # from google-api-core
{% endif %}
proto-plus==1.22.3
protobuf==4.25.8
{% for package_tuple, package_info in pypi_packages.items() %}
{# Quick check to make sure `package_info.package_name` is not the package being generated so we don't circularly include this package in its own constraints file. #}
{% if api.naming.warehouse_package_name != package_info.package_name %}
{% if api.requires_package(package_tuple) %}
{{ package_info.package_name }}=={{ package_info.lower_bound }}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
11 changes: 7 additions & 4 deletions gapic/templates/testing/constraints-3.9.txt.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
# pinning their versions to their lower bounds.
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# then this file should have google-cloud-foo==1.14.0
google-api-core==2.21.0
google-auth==2.35.0
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453)
# Add the minimum supported version of grpcio to constraints files
google-api-core==2.17.1
google-auth==2.14.1
{% if api.requires_package(("google", "iam", "v1")) or api.naming.warehouse_package_name == 'google-fragment' %}
grpcio==1.44.0 # from grpc-google-iam-v1
{% else %}
grpcio==1.33.2 # from google-api-core
{% endif %}
Copy link
Contributor Author

@daniel-sanche daniel-sanche Mar 18, 2026

Choose a reason for hiding this comment

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

This has a bit of a risk where if there is another package that depends on a higher version of grpcio, and its not covered by the goldens, we would have an error

I had gemini do an analysis of our existing packages, and the only ones it could find were fully hand-written. Still, let me know if you have thoughts here. (Maybe we should leave the grpc part out?)

  ┌────────────────────────────────┬─────────────────────────┬───────────────────────────────────────────────────────────────────┐
  │ Package                        │ grpcio Version Required │ Path                                                              │
  ├────────────────────────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────────┤
  │ grpc-google-iam-v1             │ >= 1.44.0, < 2.0.0      │ grpc-google-iam-v1 -> grpcio                                      │
  │ bigquery-magics                │ >= 1.47.0, < 2.0.0*     │ bigquery-magics -> grpcio                                         │
  │ google-api-core                │ Unspecified             │ google-api-core -> google-auth -> grpcio                          │
  │ google-apps-card               │ >= 1.33.2, < 2.0.0*     │ google-apps-card -> grpcio                                        │
  │ google-apps-script-type        │ >= 1.33.2, < 2.0.0*     │ google-apps-script-type -> grpcio                                 │
  │ google-auth                    │ Unspecified             │ google-auth -> grpcio                                             │
  │ google-cloud-appengine-logging │ >= 1.33.2, < 2.0.0*     │ google-cloud-appengine-logging -> grpcio                          │
  │ google-cloud-bigquery          │ Unspecified             │ google-cloud-bigquery -> google-api-core -> google-auth -> grpcio │
  │ google-cloud-bigquery-storage  │ >= 1.33.2, < 2.0.0*     │ google-cloud-bigquery-storage -> grpcio                           │
  │ google-cloud-common            │ >= 1.33.2, < 2.0.0*     │ google-cloud-common -> grpcio                                     │
  │ google-cloud-core              │ >= 1.33.2, < 2.0.0*     │ google-cloud-core -> grpcio                                       │
  │ google-cloud-datastore         │ >= 1.33.2, < 2.0.0*     │ google-cloud-datastore -> grpcio                                  │
  │ google-cloud-documentai        │ >= 1.33.2, < 2.0.0*     │ google-cloud-documentai -> grpcio                                 │
  │ google-cloud-iam               │ >= 1.33.2, < 2.0.0*     │ google-cloud-iam -> grpcio                                        │
  │ google-cloud-kms               │ >= 1.33.2, < 2.0.0*     │ google-cloud-kms -> grpcio                                        │
  │ google-cloud-logging           │ >= 1.33.2, < 2.0.0*     │ google-cloud-logging -> grpcio                                    │
  │ google-cloud-org-policy        │ >= 1.33.2, < 2.0.0*     │ google-cloud-org-policy -> grpcio                                 │
  │ google-cloud-os-config         │ >= 1.33.2, < 2.0.0*     │ google-cloud-os-config -> grpcio                                  │
  │ google-geo-type                │ >= 1.33.2, < 2.0.0*     │ google-geo-type -> grpcio                                         │
  │ google-resumable-media         │ Unspecified             │ google-resumable-media -> google-auth -> grpcio                   │
  │ google-shopping-type           │ >= 1.33.2, < 2.0.0*     │ google-shopping-type -> grpcio                                    │
  │ grafeas                        │ >= 1.33.2, < 2.0.0*     │ grafeas -> grpcio                                                 │
  │ grpcio-status                  │ Unspecified             │ grpcio-status -> grpcio                                           │
  └────────────────────────────────┴─────────────────────────┴───────────────────────────────────────────────────────────────────┘



proto-plus==1.22.3
protobuf==4.25.8
{% for package_tuple, package_info in pypi_packages.items() %}
Expand Down
30 changes: 15 additions & 15 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,21 +357,21 @@ def showcase_library(
constraints_path = str(
f"{tmp_dir}/testing/constraints-{session.python}.txt"
)
# Install the library with a constraints file.
session.install(
"-e",
tmp_dir + ("[async_rest]" if rest_async_io_enabled else ""),
"-r",
constraints_path,
)
# Exclude `google-auth==2.40.0` which contains a regression
# https://github.com/googleapis/gapic-generator-python/issues/2385
session.install(
"--no-cache-dir",
"--force-reinstall",
"--upgrade",
"google-auth[aiohttp]!=2.40.0",
)
extras = ""
if rest_async_io_enabled:
async_rest_constraints_path = str(
f"{tmp_dir}/testing/constraints-{session.python}-async-rest.txt"
)
if os.path.exists(async_rest_constraints_path):
# use async-rest constraints if available
constraints_path = async_rest_constraints_path
else:
session.log(
f"{async_rest_constraints_path} not found. Using base constraints file"
)
extras = "[async_rest]"

session.install("-e", f"{tmp_dir}{extras}", "-r", constraints_path)
else:
# The ads templates do not have constraints files.
# See https://github.com/googleapis/gapic-generator-python/issues/1788
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/goldens/asset/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
release_status = "Development Status :: 5 - Production/Stable"

dependencies = [
"google-api-core[grpc] >= 2.11.0, <3.0.0",
"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",
Expand Down
7 changes: 3 additions & 4 deletions tests/integration/goldens/asset/testing/constraints-3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
# pinning their versions to their lower bounds.
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# then this file should have google-cloud-foo==1.14.0
google-api-core==2.21.0
google-auth==2.35.0
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453)
# Add the minimum supported version of grpcio to constraints files
google-api-core==2.17.1
google-auth==2.14.1
grpcio==1.44.0 # from grpc-google-iam-v1
proto-plus==1.22.3
protobuf==4.25.8
google-cloud-access-context-manager==0.2.0
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/goldens/credentials/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
release_status = "Development Status :: 5 - Production/Stable"

dependencies = [
"google-api-core[grpc] >= 2.11.0, <3.0.0",
"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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
# pinning their versions to their lower bounds.
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# then this file should have google-cloud-foo==1.14.0
google-api-core==2.21.0
google-auth==2.35.0
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453)
# Add the minimum supported version of grpcio to constraints files
google-api-core==2.17.1
google-auth==2.14.1
grpcio==1.33.2 # from google-api-core
proto-plus==1.22.3
protobuf==4.25.8
2 changes: 1 addition & 1 deletion tests/integration/goldens/eventarc/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
release_status = "Development Status :: 5 - Production/Stable"

dependencies = [
"google-api-core[grpc] >= 2.11.0, <3.0.0",
"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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
# pinning their versions to their lower bounds.
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# then this file should have google-cloud-foo==1.14.0
google-api-core==2.21.0
google-auth==2.35.0
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453)
# Add the minimum supported version of grpcio to constraints files
google-api-core==2.17.1
google-auth==2.14.1
grpcio==1.44.0 # from grpc-google-iam-v1
proto-plus==1.22.3
protobuf==4.25.8
grpc-google-iam-v1==0.14.0
2 changes: 1 addition & 1 deletion tests/integration/goldens/logging/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
release_status = "Development Status :: 5 - Production/Stable"

dependencies = [
"google-api-core[grpc] >= 2.11.0, <3.0.0",
"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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
# pinning their versions to their lower bounds.
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# then this file should have google-cloud-foo==1.14.0
google-api-core==2.21.0
google-auth==2.35.0
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453)
# Add the minimum supported version of grpcio to constraints files
google-api-core==2.17.1
google-auth==2.14.1
grpcio==1.33.2 # from google-api-core
proto-plus==1.22.3
protobuf==4.25.8
2 changes: 1 addition & 1 deletion tests/integration/goldens/logging_internal/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
release_status = "Development Status :: 5 - Production/Stable"

dependencies = [
"google-api-core[grpc] >= 2.11.0, <3.0.0",
"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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
# pinning their versions to their lower bounds.
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# then this file should have google-cloud-foo==1.14.0
google-api-core==2.21.0
google-auth==2.35.0
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453)
# Add the minimum supported version of grpcio to constraints files
google-api-core==2.17.1
google-auth==2.14.1
grpcio==1.33.2 # from google-api-core
proto-plus==1.22.3
protobuf==4.25.8
2 changes: 1 addition & 1 deletion tests/integration/goldens/redis/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
release_status = "Development Status :: 5 - Production/Stable"

dependencies = [
"google-api-core[grpc] >= 2.11.0, <3.0.0",
"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",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
# This constraints file is used to check that lower bounds
# are correct in setup.py
# List all library dependencies and extras in this file,
# pinning their versions to their lower bounds.
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# then this file should have google-cloud-foo==1.14.0
google-api-core==2.21.0
google-auth==2.35.0
grpcio==1.33.2 # from google-api-core
proto-plus==1.22.3
protobuf==4.25.8
7 changes: 3 additions & 4 deletions tests/integration/goldens/redis/testing/constraints-3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
# pinning their versions to their lower bounds.
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# then this file should have google-cloud-foo==1.14.0
google-api-core==2.21.0
google-auth==2.35.0
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453)
# Add the minimum supported version of grpcio to constraints files
google-api-core==2.17.1
google-auth==2.14.1
grpcio==1.33.2 # from google-api-core
proto-plus==1.22.3
protobuf==4.25.8
2 changes: 1 addition & 1 deletion tests/integration/goldens/redis_selective/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
release_status = "Development Status :: 5 - Production/Stable"

dependencies = [
"google-api-core[grpc] >= 2.11.0, <3.0.0",
"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",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
# This constraints file is used to check that lower bounds
# are correct in setup.py
# List all library dependencies and extras in this file,
# pinning their versions to their lower bounds.
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# then this file should have google-cloud-foo==1.14.0
google-api-core==2.21.0
google-auth==2.35.0
grpcio==1.33.2 # from google-api-core
proto-plus==1.22.3
protobuf==4.25.8
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
# pinning their versions to their lower bounds.
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
# then this file should have google-cloud-foo==1.14.0
google-api-core==2.21.0
google-auth==2.35.0
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453)
# Add the minimum supported version of grpcio to constraints files
google-api-core==2.17.1
google-auth==2.14.1
grpcio==1.33.2 # from google-api-core
proto-plus==1.22.3
protobuf==4.25.8
Loading