Skip to content

Commit 2ee06d3

Browse files
authored
tests: pin minimum dependency versions under Python 3.6 (#680)
Also, pin 2.7-compatible version of 'googleapis-common-protos' under 2.7 Closes #679.
1 parent 9be06e5 commit 2ee06d3

File tree

7 files changed

+21
-2
lines changed

7 files changed

+21
-2
lines changed

packages/google-cloud-ndb/noxfile.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"""
1919

2020
import os
21+
import pathlib
2122
import shutil
2223

2324
import nox
@@ -28,6 +29,7 @@
2829
ALL_INTERPRETERS = ("2.7", "3.6", "3.7", "3.8", "3.9")
2930
PY3_INTERPRETERS = ("3.6", "3.7", "3.8", "3.9")
3031
MAJOR_INTERPRETERS = ("2.7", "3.8")
32+
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
3133

3234
BLACK_VERSION = "black==20.8b1"
3335

@@ -38,10 +40,13 @@ def get_path(*names):
3840

3941
@nox.session(py=ALL_INTERPRETERS)
4042
def unit(session):
43+
constraints_path = str(
44+
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
45+
)
4146
# Install all dependencies.
4247
session.install("pytest", "pytest-cov")
4348
session.install("mock")
44-
session.install("-e", ".")
49+
session.install("-e", ".", "-c", constraints_path)
4550
# This variable is used to skip coverage by Python version
4651
session.env["PY_VERSION"] = session.python[0]
4752
# Run py.test against the unit tests.
@@ -159,6 +164,9 @@ def doctest(session):
159164
@nox.session(py=MAJOR_INTERPRETERS)
160165
def system(session):
161166
"""Run the system test suite."""
167+
constraints_path = str(
168+
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
169+
)
162170
system_test_path = get_path("tests", "system.py")
163171
system_test_folder_path = os.path.join("tests", "system")
164172

@@ -182,7 +190,7 @@ def system(session):
182190
for local_dep in LOCAL_DEPS:
183191
session.install(local_dep)
184192
session.install("-e", get_path("test_utils", "test_utils"))
185-
session.install("-e", ".")
193+
session.install("-e", ".", "-c", constraints_path)
186194

187195
# Run py.test against the system tests.
188196
if system_test_exists:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
googleapis-common-protos >= 1.6.0, < 1.53dev
2+

packages/google-cloud-ndb/testing/constraints-3.10.txt

Whitespace-only changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
google-cloud-datastore==1.7.0

packages/google-cloud-ndb/testing/constraints-3.7.txt

Whitespace-only changes.

packages/google-cloud-ndb/testing/constraints-3.8.txt

Whitespace-only changes.

packages/google-cloud-ndb/testing/constraints-3.9.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)