Skip to content

Commit b7e0f7f

Browse files
authored
build: update constraints file to test latest major versions (#2362)
1 parent e402442 commit b7e0f7f

File tree

11 files changed

+97
-46
lines changed

11 files changed

+97
-46
lines changed

gapic/templates/setup.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies = [
4242
{# Explicitly exclude protobuf versions mentioned in https://cloud.google.com/support/bulletins#GCP-2022-019 #}
4343
"protobuf>=3.20.2,<7.0.0,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
4444
{% for package_tuple, package_info in pypi_packages.items() %}
45-
{# Quick check to make sure the package is different from this setup.py #}
45+
{# 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. #}
4646
{% if api.naming.warehouse_package_name != package_info.package_name %}
4747
{% if api.requires_package(package_tuple) %}
4848
"{{ package_info.package_name }} >= {{ package_info.lower_bound }}, <{{ package_info.upper_bound }}",

gapic/templates/testing/_default_constraints.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ google-api-core
55
proto-plus
66
protobuf
77
{% for package_tuple, package_info in pypi_packages.items() %}
8-
{# Quick check to make sure the package is different from this setup.py #}
8+
{# 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. #}
99
{% if api.naming.warehouse_package_name != package_info.package_name %}
1010
{% if api.requires_package(package_tuple) %}
1111
{{ package_info.package_name }}
Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
# -*- coding: utf-8 -*-
2-
{% block constraints %}
3-
{% include "testing/_default_constraints.j2" %}
4-
{% endblock %}
1+
{% from '_pypi_packages.j2' import pypi_packages %}
2+
# We use the constraints file for the latest Python version
3+
# (currently this file) to check that the latest
4+
# major versions of dependencies are supported in setup.py.
5+
# List all library dependencies and extras in this file.
6+
# Require the latest major version be installed for each dependency.
7+
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
8+
# Then this file should have google-cloud-foo>=1
9+
google-api-core>=2
10+
google-auth>=2
11+
proto-plus>=1
12+
protobuf>=6
13+
{% for package_tuple, package_info in pypi_packages.items() %}
14+
{# 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. #}
15+
{% if api.naming.warehouse_package_name != package_info.package_name %}
16+
{% if api.requires_package(package_tuple) %}
17+
{{ package_info.package_name }}>={{ (package_info.upper_bound.split(".")[0] | int) - 1 }}
18+
{% endif %}
19+
{% endif %}
20+
{% endfor %}

gapic/templates/testing/constraints-3.7.txt.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ google-auth==2.14.1
1010
proto-plus==1.22.3
1111
protobuf==3.20.2
1212
{% for package_tuple, package_info in pypi_packages.items() %}
13-
{# Quick check to make sure the package is different from this setup.py #}
13+
{# 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. #}
1414
{% if api.naming.warehouse_package_name != package_info.package_name %}
1515
{% if api.requires_package(package_tuple) %}
1616
{{ package_info.package_name }}=={{ package_info.lower_bound }}
Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
# -*- coding: utf-8 -*-
2-
# This constraints file is required for unit tests.
1+
# We use the constraints file for the latest Python version
2+
# (currently this file) to check that the latest
3+
# major versions of dependencies are supported in setup.py.
34
# List all library dependencies and extras in this file.
4-
google-api-core
5-
proto-plus
6-
protobuf
7-
google-cloud-access-context-manager
8-
google-cloud-os-config
9-
grpc-google-iam-v1
5+
# Require the latest major version be installed for each dependency.
6+
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
7+
# Then this file should have google-cloud-foo>=1
8+
google-api-core>=2
9+
google-auth>=2
10+
proto-plus>=1
11+
protobuf>=6
12+
google-cloud-access-context-manager>=0
13+
google-cloud-os-config>=1
14+
grpc-google-iam-v1>=0
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
# -*- coding: utf-8 -*-
2-
# This constraints file is required for unit tests.
1+
# We use the constraints file for the latest Python version
2+
# (currently this file) to check that the latest
3+
# major versions of dependencies are supported in setup.py.
34
# List all library dependencies and extras in this file.
4-
google-api-core
5-
proto-plus
6-
protobuf
5+
# Require the latest major version be installed for each dependency.
6+
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
7+
# Then this file should have google-cloud-foo>=1
8+
google-api-core>=2
9+
google-auth>=2
10+
proto-plus>=1
11+
protobuf>=6
Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
# -*- coding: utf-8 -*-
2-
# This constraints file is required for unit tests.
1+
# We use the constraints file for the latest Python version
2+
# (currently this file) to check that the latest
3+
# major versions of dependencies are supported in setup.py.
34
# List all library dependencies and extras in this file.
4-
google-api-core
5-
proto-plus
6-
protobuf
7-
grpc-google-iam-v1
5+
# Require the latest major version be installed for each dependency.
6+
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
7+
# Then this file should have google-cloud-foo>=1
8+
google-api-core>=2
9+
google-auth>=2
10+
proto-plus>=1
11+
protobuf>=6
12+
grpc-google-iam-v1>=0
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
# -*- coding: utf-8 -*-
2-
# This constraints file is required for unit tests.
1+
# We use the constraints file for the latest Python version
2+
# (currently this file) to check that the latest
3+
# major versions of dependencies are supported in setup.py.
34
# List all library dependencies and extras in this file.
4-
google-api-core
5-
proto-plus
6-
protobuf
5+
# Require the latest major version be installed for each dependency.
6+
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
7+
# Then this file should have google-cloud-foo>=1
8+
google-api-core>=2
9+
google-auth>=2
10+
proto-plus>=1
11+
protobuf>=6
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
# -*- coding: utf-8 -*-
2-
# This constraints file is required for unit tests.
1+
# We use the constraints file for the latest Python version
2+
# (currently this file) to check that the latest
3+
# major versions of dependencies are supported in setup.py.
34
# List all library dependencies and extras in this file.
4-
google-api-core
5-
proto-plus
6-
protobuf
5+
# Require the latest major version be installed for each dependency.
6+
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
7+
# Then this file should have google-cloud-foo>=1
8+
google-api-core>=2
9+
google-auth>=2
10+
proto-plus>=1
11+
protobuf>=6
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
# -*- coding: utf-8 -*-
2-
# This constraints file is required for unit tests.
1+
# We use the constraints file for the latest Python version
2+
# (currently this file) to check that the latest
3+
# major versions of dependencies are supported in setup.py.
34
# List all library dependencies and extras in this file.
4-
google-api-core
5-
proto-plus
6-
protobuf
5+
# Require the latest major version be installed for each dependency.
6+
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
7+
# Then this file should have google-cloud-foo>=1
8+
google-api-core>=2
9+
google-auth>=2
10+
proto-plus>=1
11+
protobuf>=6
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
# -*- coding: utf-8 -*-
2-
# This constraints file is required for unit tests.
1+
# We use the constraints file for the latest Python version
2+
# (currently this file) to check that the latest
3+
# major versions of dependencies are supported in setup.py.
34
# List all library dependencies and extras in this file.
4-
google-api-core
5-
proto-plus
6-
protobuf
5+
# Require the latest major version be installed for each dependency.
6+
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
7+
# Then this file should have google-cloud-foo>=1
8+
google-api-core>=2
9+
google-auth>=2
10+
proto-plus>=1
11+
protobuf>=6

0 commit comments

Comments
 (0)