diff --git a/gapic/templates/setup.py.j2 b/gapic/templates/setup.py.j2 index 831f5d0f31..dcff94f973 100644 --- a/gapic/templates/setup.py.j2 +++ b/gapic/templates/setup.py.j2 @@ -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", diff --git a/gapic/templates/testing/constraints-3.9-async-rest.txt.j2 b/gapic/templates/testing/constraints-3.9-async-rest.txt.j2 new file mode 100644 index 0000000000..96b0ff860e --- /dev/null +++ b/gapic/templates/testing/constraints-3.9-async-rest.txt.j2 @@ -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 %} \ No newline at end of file diff --git a/gapic/templates/testing/constraints-3.9.txt.j2 b/gapic/templates/testing/constraints-3.9.txt.j2 index 59cd2c38c8..f2d6fa3f6a 100644 --- a/gapic/templates/testing/constraints-3.9.txt.j2 +++ b/gapic/templates/testing/constraints-3.9.txt.j2 @@ -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 %} proto-plus==1.22.3 protobuf==4.25.8 {% for package_tuple, package_info in pypi_packages.items() %} diff --git a/noxfile.py b/noxfile.py index 649de4e7f0..57d6ba010e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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 diff --git a/tests/integration/goldens/asset/setup.py b/tests/integration/goldens/asset/setup.py index 7f5523e3bf..165a48972f 100755 --- a/tests/integration/goldens/asset/setup.py +++ b/tests/integration/goldens/asset/setup.py @@ -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", diff --git a/tests/integration/goldens/asset/testing/constraints-3.9.txt b/tests/integration/goldens/asset/testing/constraints-3.9.txt index 66ee36eb25..8333ac3bda 100755 --- a/tests/integration/goldens/asset/testing/constraints-3.9.txt +++ b/tests/integration/goldens/asset/testing/constraints-3.9.txt @@ -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 diff --git a/tests/integration/goldens/credentials/setup.py b/tests/integration/goldens/credentials/setup.py index 8da6aed1dd..37422f10cc 100755 --- a/tests/integration/goldens/credentials/setup.py +++ b/tests/integration/goldens/credentials/setup.py @@ -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", diff --git a/tests/integration/goldens/credentials/testing/constraints-3.9.txt b/tests/integration/goldens/credentials/testing/constraints-3.9.txt index ac3833d41b..d5ce286e09 100755 --- a/tests/integration/goldens/credentials/testing/constraints-3.9.txt +++ b/tests/integration/goldens/credentials/testing/constraints-3.9.txt @@ -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 diff --git a/tests/integration/goldens/eventarc/setup.py b/tests/integration/goldens/eventarc/setup.py index cbb2177568..946de9f043 100755 --- a/tests/integration/goldens/eventarc/setup.py +++ b/tests/integration/goldens/eventarc/setup.py @@ -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", diff --git a/tests/integration/goldens/eventarc/testing/constraints-3.9.txt b/tests/integration/goldens/eventarc/testing/constraints-3.9.txt index dcb9a9b3d8..faecbe2655 100755 --- a/tests/integration/goldens/eventarc/testing/constraints-3.9.txt +++ b/tests/integration/goldens/eventarc/testing/constraints-3.9.txt @@ -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 diff --git a/tests/integration/goldens/logging/setup.py b/tests/integration/goldens/logging/setup.py index 0b99458443..2f1b079f1b 100755 --- a/tests/integration/goldens/logging/setup.py +++ b/tests/integration/goldens/logging/setup.py @@ -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", diff --git a/tests/integration/goldens/logging/testing/constraints-3.9.txt b/tests/integration/goldens/logging/testing/constraints-3.9.txt index ac3833d41b..d5ce286e09 100755 --- a/tests/integration/goldens/logging/testing/constraints-3.9.txt +++ b/tests/integration/goldens/logging/testing/constraints-3.9.txt @@ -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 diff --git a/tests/integration/goldens/logging_internal/setup.py b/tests/integration/goldens/logging_internal/setup.py index 0b99458443..2f1b079f1b 100755 --- a/tests/integration/goldens/logging_internal/setup.py +++ b/tests/integration/goldens/logging_internal/setup.py @@ -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", diff --git a/tests/integration/goldens/logging_internal/testing/constraints-3.9.txt b/tests/integration/goldens/logging_internal/testing/constraints-3.9.txt index ac3833d41b..d5ce286e09 100755 --- a/tests/integration/goldens/logging_internal/testing/constraints-3.9.txt +++ b/tests/integration/goldens/logging_internal/testing/constraints-3.9.txt @@ -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 diff --git a/tests/integration/goldens/redis/setup.py b/tests/integration/goldens/redis/setup.py index 2cf3926c8e..29648855db 100755 --- a/tests/integration/goldens/redis/setup.py +++ b/tests/integration/goldens/redis/setup.py @@ -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", diff --git a/tests/integration/goldens/redis/testing/constraints-3.9-async-rest.txt b/tests/integration/goldens/redis/testing/constraints-3.9-async-rest.txt new file mode 100644 index 0000000000..0845245d47 --- /dev/null +++ b/tests/integration/goldens/redis/testing/constraints-3.9-async-rest.txt @@ -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 diff --git a/tests/integration/goldens/redis/testing/constraints-3.9.txt b/tests/integration/goldens/redis/testing/constraints-3.9.txt index ac3833d41b..d5ce286e09 100755 --- a/tests/integration/goldens/redis/testing/constraints-3.9.txt +++ b/tests/integration/goldens/redis/testing/constraints-3.9.txt @@ -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 diff --git a/tests/integration/goldens/redis_selective/setup.py b/tests/integration/goldens/redis_selective/setup.py index 2cf3926c8e..29648855db 100755 --- a/tests/integration/goldens/redis_selective/setup.py +++ b/tests/integration/goldens/redis_selective/setup.py @@ -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", diff --git a/tests/integration/goldens/redis_selective/testing/constraints-3.9-async-rest.txt b/tests/integration/goldens/redis_selective/testing/constraints-3.9-async-rest.txt new file mode 100644 index 0000000000..0845245d47 --- /dev/null +++ b/tests/integration/goldens/redis_selective/testing/constraints-3.9-async-rest.txt @@ -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 diff --git a/tests/integration/goldens/redis_selective/testing/constraints-3.9.txt b/tests/integration/goldens/redis_selective/testing/constraints-3.9.txt index ac3833d41b..d5ce286e09 100755 --- a/tests/integration/goldens/redis_selective/testing/constraints-3.9.txt +++ b/tests/integration/goldens/redis_selective/testing/constraints-3.9.txt @@ -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