Skip to content

Commit

Permalink
fix(deps): require google-api-core >= 1.26.0 (#344)
Browse files Browse the repository at this point in the history
Also, pin google-auth to lower version in constraints.
  • Loading branch information
busunkim96 committed Jun 25, 2021
1 parent b4e07f8 commit ce4ceb6
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 11 deletions.
26 changes: 16 additions & 10 deletions noxfile.py
Expand Up @@ -18,6 +18,7 @@

from __future__ import absolute_import
import os
import pathlib
import shutil

import nox
Expand All @@ -30,6 +31,8 @@
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"]
UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"]

CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()

# 'docfx' is excluded since it only needs to run in 'docs-presubmit'
nox.options.sessions = [
"unit",
Expand Down Expand Up @@ -78,13 +81,14 @@ def lint_setup_py(session):

def default(session):
# Install all test dependencies, then install this package in-place.
session.install("asyncmock", "pytest-asyncio")

session.install(
"mock", "pytest", "pytest-cov",
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
session.install("asyncmock", "pytest-asyncio", "-c", constraints_path)

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(
Expand Down Expand Up @@ -136,6 +140,10 @@ def system_emulated(session):
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
def system(session):
"""Run the system test suite."""
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)

system_test_path = os.path.join("tests", "system.py")
system_test_folder_path = os.path.join("tests", "system")

Expand All @@ -147,7 +155,7 @@ def system(session):
session.skip("Credentials must be set via environment variable")
# Install pyopenssl for mTLS testing.
if os.environ.get("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true":
session.install("pyopenssl")
session.install("pyopenssl", "-c", constraints_path)

system_test_exists = os.path.exists(system_test_path)
system_test_folder_exists = os.path.exists(system_test_folder_path)
Expand All @@ -160,10 +168,8 @@ def system(session):

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install(
"mock", "pytest", "google-cloud-testutils",
)
session.install("-e", ".")
session.install("mock", "pytest", "google-cloud-testutils", "-c", constraints_path)
session.install("-e", ".", "-c", constraints_path)

# Run py.test against the system tests.
if system_test_exists:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -29,7 +29,7 @@
# 'Development Status :: 5 - Production/Stable'
release_status = "Development Status :: 5 - Production/Stable"
dependencies = [
"google-api-core[grpc] >= 1.22.2, < 2.0.0dev",
"google-api-core[grpc] >= 1.26.0, < 2.0.0dev",
"google-cloud-core >= 1.4.1, < 2.0dev",
"grpc-google-iam-v1 >= 0.12.3, < 0.13dev",
"proto-plus >= 1.13.0",
Expand Down
Empty file added testing/constraints-3.10.txt
Empty file.
14 changes: 14 additions & 0 deletions testing/constraints-3.6.txt
@@ -0,0 +1,14 @@
# 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
google-api-core==1.26.0
google-cloud-core==1.4.1
grpc-google-iam-v1==0.12.3
proto-plus==1.13.0
libcst==0.2.5
packaging==14.3
google-auth==1.24.0 # TODO: remove when google-auth >= 1.25.0 is required transitively through google-api-core
Empty file added testing/constraints-3.7.txt
Empty file.
Empty file added testing/constraints-3.8.txt
Empty file.
Empty file added testing/constraints-3.9.txt
Empty file.

0 comments on commit ce4ceb6

Please sign in to comment.