From 92251a5c8ea4d663773506eb1c630201a657aa69 Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Thu, 8 Jul 2021 17:30:33 -0400 Subject: [PATCH] fix(deps): update minimum dependency versions to pick up bugfixes (#496) Also, actually test those minimum versions using constraints file. Closes #494 --- noxfile.py | 21 +++++++++++++++------ setup.py | 4 ++-- testing/constraints-2.7.txt | 0 testing/constraints-3.6.txt | 8 ++++---- 4 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 testing/constraints-2.7.txt diff --git a/noxfile.py b/noxfile.py index c34e8b981..b4c875452 100644 --- a/noxfile.py +++ b/noxfile.py @@ -18,6 +18,7 @@ from __future__ import absolute_import import os +import pathlib import shutil import nox @@ -30,6 +31,8 @@ SYSTEM_TEST_PYTHON_VERSIONS = ["2.7", "3.8"] UNIT_TEST_PYTHON_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + @nox.session(python=DEFAULT_PYTHON_VERSION) def lint(session): @@ -65,9 +68,12 @@ def lint_setup_py(session): def default(session): + 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") - session.install("-e", ".") + session.install("mock", "pytest", "pytest-cov", "-c", constraints_path) + session.install("-e", ".", "-c", constraints_path) # Run py.test against the unit tests. session.run( @@ -93,6 +99,9 @@ def unit(session): @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) def system(session): + constraints_path = str( + CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" + ) """Run the system test suite.""" system_test_path = os.path.join("tests", "system.py") system_test_folder_path = os.path.join("tests", "system") @@ -121,15 +130,15 @@ def system(session): # 2021-05-06: defer installing 'google-cloud-*' to after this package, # in order to work around Python 2.7 googolapis-common-protos # issue. - session.install( - "mock", "pytest", - ) - session.install("-e", ".") + session.install("mock", "pytest", "-c", constraints_path) + session.install("-e", ".", "-c", constraints_path) session.install( "google-cloud-testutils", "google-cloud-iam", "google-cloud-pubsub < 2.0.0", "google-cloud-kms < 2.0dev", + "-c", + constraints_path, ) # Run py.test against the system tests. diff --git a/setup.py b/setup.py index 6f6fa1f3d..2a54a2951 100644 --- a/setup.py +++ b/setup.py @@ -28,8 +28,8 @@ # 'Development Status :: 5 - Production/Stable' release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-auth >= 1.11.0, < 2.0dev", - "google-cloud-core >= 1.4.1, < 2.0dev", + "google-auth >= 1.24.0, < 2.0dev", + "google-cloud-core >= 1.6.0, < 2.0dev", "google-resumable-media >= 1.3.0, < 2.0dev", "requests >= 2.18.0, < 3.0.0dev", "googleapis-common-protos < 1.53.0; python_version<'3.0'", diff --git a/testing/constraints-2.7.txt b/testing/constraints-2.7.txt new file mode 100644 index 000000000..e69de29bb diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt index 201cbf494..228699957 100644 --- a/testing/constraints-3.6.txt +++ b/testing/constraints-3.6.txt @@ -5,7 +5,7 @@ # # e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", # Then this file should have foo==1.14.0 -google-auth==1.11.0 -google-cloud-core==1.4.1 -google-resumable-media==1.0.0 -requests==2.18.0 \ No newline at end of file +google-auth==1.24.0 +google-cloud-core==1.6.0 +google-resumable-media==1.3.0 +requests==2.18.0