diff --git a/noxfile.py b/noxfile.py index 86758e1f..650cef28 100644 --- a/noxfile.py +++ b/noxfile.py @@ -14,13 +14,15 @@ from __future__ import absolute_import import os +import pathlib import shutil # https://github.com/google/importlab/issues/25 import nox # pytype: disable=import-error -_MINIMAL_ASYNCIO_SUPPORT_PYTHON_VERSION = [3, 6] +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() +_MINIMAL_ASYNCIO_SUPPORT_PYTHON_VERSION = [3, 6] def _greater_or_equal_than_36(version_string): tokens = version_string.split(".") @@ -40,9 +42,13 @@ def default(session): Python corresponding to the ``nox`` binary the ``PATH`` can run the tests. """ + constraints_path = str( + CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" + ) + # Install all test dependencies, then install this package in-place. session.install("mock", "pytest", "pytest-cov", "grpcio >= 1.0.2") - session.install("-e", ".") + session.install("-e", ".", "-c", constraints_path) pytest_args = [ "python", @@ -80,9 +86,11 @@ def unit(session): @nox.session(python=["2.7", "3.6", "3.7", "3.8", "3.9"]) def unit_grpc_gcp(session): """Run the unit test suite with grpcio-gcp installed.""" - + constraints_path = str( + CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" + ) # Install grpcio-gcp - session.install("grpcio-gcp") + session.install("grpcio-gcp", "-c", constraints_path) default(session) diff --git a/setup.py b/setup.py index 576363a5..30adb954 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ "protobuf >= 3.12.0", "google-auth >= 1.21.1, < 2.0dev", "requests >= 2.18.0, < 3.0.0dev", - "setuptools >= 34.0.0", + "setuptools >= 40.3.0", "six >= 1.13.0", "pytz", 'futures >= 3.2.0; python_version < "3.2"', diff --git a/testing/constraints-2.7.txt b/testing/constraints-2.7.txt new file mode 100644 index 00000000..e69de29b diff --git a/testing/constraints-3.10.txt b/testing/constraints-3.10.txt new file mode 100644 index 00000000..e69de29b diff --git a/testing/constraints-3.11.txt b/testing/constraints-3.11.txt new file mode 100644 index 00000000..e69de29b diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt new file mode 100644 index 00000000..2d498173 --- /dev/null +++ b/testing/constraints-3.6.txt @@ -0,0 +1,16 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List *all* library dependencies and extras in this file. +# Pin the version to the lower bound. +# +# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", +# Then this file should have foo==1.14.0 +googleapis-common-protos==1.6.0 +protobuf==3.12.0 +google-auth==1.21.1 +requests==2.18.0 +setuptools==40.3.0 +six==1.13.0 +grpcio==1.29.0 +grpcio-gcp==0.2.2 +grpcio-gcp==0.2.2 diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt new file mode 100644 index 00000000..e69de29b diff --git a/testing/constraints-3.8.txt b/testing/constraints-3.8.txt new file mode 100644 index 00000000..e69de29b diff --git a/testing/constraints-3.9.txt b/testing/constraints-3.9.txt new file mode 100644 index 00000000..e69de29b