8000 test(python): use constraints files to check dependency lower bounds by yoshi-automation · Pull Request #56 · googleapis/python-bigquery-connection · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

test(python): use constraints files to check dependency lower bounds #56

Merged
merged 6 commits into from
Apr 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ repos:
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
rev: 3.9.0
hooks:
- id: flake8
22 changes: 14 additions & 8 deletions noxfile.py
Original file line number Diff line number Diff line change
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 @@ -84,13 +87,15 @@ 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 All @@ -117,6 +122,9 @@ def unit(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 @@ -141,10 +149,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
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@
platforms="Posix; MacOS X; Windows",
include_package_data=True,
install_requires=(
"google-api-core >= 1.21.0, < 2.0.0dev",
"google-api-core >= 1.22.2, < 2.0.0dev",
"proto-plus >= 1.4.0",
"grpc-google-iam-v1",
"libcst >= 0.2.5",
"grpc-google-iam-v1 >= 0.12.3, < 0.13.0dev",
Comment on lines +43 to +45
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tswast I adjusted the versions for grpc-google-iam-v1 here and in the constraints.txt. PTAL. :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

),
python_requires=">=3.6",
scripts=["scripts/fixup_keywords.py"],
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
Expand Down
5 changes: 3 additions & 2 deletions synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "79c8dd7ee768292f933012d3a69a5b4676404cda"
"sha": "86ed43d4f56e6404d068e62e497029018879c771"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "79c8dd7ee768292f933012d3a69a5b4676404cda"
"sha": "86ed43d4f56e6404d068e62e497029018879c771"
}
}
],
Expand Down Expand Up @@ -98,6 +98,7 @@
"CONTRIBUTING.rst",
"LICENSE",
"MANIFEST.in",
"bigquery-connection-v1-py.tar.gz",
"docs/_static/custom.css",
"docs/_templates/layout.html",
"docs/bigquery_connection_v1/connection_service.rst",
Expand Down
2 changes: 1 addition & 1 deletion synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
bazel_target=f"//google/cloud/bigquery/connection/v1:bigquery-connection-v1-py"
)

s.move(library, excludes=["setup.py", "README.rst", "docs/index.rst"])
s.move(library, excludes=["setup.py", "README.rst", "docs/index.rst", "*.tar.gz"])

# ----------------------------------------------------------------------------
# Add templated files
Expand Down
5 changes: 2 additions & 3 deletions testing/constraints-3.6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#
# 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.21.0
google-api-core==1.22.2
proto-plus==1.4.0
grpc-google-iam-v1==0.9.0
libcst==0.2.5
grpc-google-iam-v1==0.12.3
0