Skip to content

Commit c5fee89

Browse files
authored
chore: add constraints file (googleapis#122)
Add constraints file to test lower bounds.
1 parent c2f094b commit c5fee89

9 files changed

+29
-5
lines changed

noxfile.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414

1515
from __future__ import absolute_import
1616
import os
17+
import pathlib
1718
import shutil
1819

1920
# https://github.com/google/importlab/issues/25
2021
import nox # pytype: disable=import-error
2122

22-
_MINIMAL_ASYNCIO_SUPPORT_PYTHON_VERSION = [3, 6]
23+
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
2324

25+
_MINIMAL_ASYNCIO_SUPPORT_PYTHON_VERSION = [3, 6]
2426

2527
def _greater_or_equal_than_36(version_string):
2628
tokens = version_string.split(".")
@@ -40,9 +42,13 @@ def default(session):
4042
Python corresponding to the ``nox`` binary the ``PATH`` can
4143
run the tests.
4244
"""
45+
constraints_path = str(
46+
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
47+
)
48+
4349
# Install all test dependencies, then install this package in-place.
4450
session.install("mock", "pytest", "pytest-cov", "grpcio >= 1.0.2")
45-
session.install("-e", ".")
51+
session.install("-e", ".", "-c", constraints_path)
4652

4753
pytest_args = [
4854
"python",
@@ -80,9 +86,11 @@ def unit(session):
8086
@nox.session(python=["2.7", "3.6", "3.7", "3.8", "3.9"])
8187
def unit_grpc_gcp(session):
8288
"""Run the unit test suite with grpcio-gcp installed."""
83-
89+
constraints_path = str(
90+
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
91+
)
8492
# Install grpcio-gcp
85-
session.install("grpcio-gcp")
93+
session.install("grpcio-gcp", "-c", constraints_path)
8694

8795
default(session)
8896

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"protobuf >= 3.12.0",
3434
"google-auth >= 1.21.1, < 2.0dev",
3535
"requests >= 2.18.0, < 3.0.0dev",
36-
"setuptools >= 34.0.0",
36+
"setuptools >= 40.3.0",
3737
"six >= 1.13.0",
3838
"pytz",
3939
'futures >= 3.2.0; python_version < "3.2"',

testing/constraints-2.7.txt

Whitespace-only changes.

testing/constraints-3.10.txt

Whitespace-only changes.

testing/constraints-3.11.txt

Whitespace-only changes.

testing/constraints-3.6.txt

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This constraints file is used to check that lower bounds
2+
# are correct in setup.py
3+
# List *all* library dependencies and extras in this file.
4+
# Pin the version to the lower bound.
5+
#
6+
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
7+
# Then this file should have foo==1.14.0
8+
googleapis-common-protos==1.6.0
9+
protobuf==3.12.0
10+
google-auth==1.21.1
11+
requests==2.18.0
12+
setuptools==40.3.0
13+
six==1.13.0
14+
grpcio==1.29.0
15+
grpcio-gcp==0.2.2
16+
grpcio-gcp==0.2.2

testing/constraints-3.7.txt

Whitespace-only changes.

testing/constraints-3.8.txt

Whitespace-only changes.

testing/constraints-3.9.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)