Skip to content

Commit

Permalink
test: add 3.9 tests (#96)
Browse files Browse the repository at this point in the history
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/6490b6f9-79ee-41b3-8813-ec1cd161dafb/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@778d8be
Source-Link: googleapis/synthtool@573f765
Source-Link: googleapis/synthtool@ba960d7
Source-Link: googleapis/synthtool@56ddc68
Source-Link: googleapis/synthtool@16ec872
Source-Link: googleapis/synthtool@fb53b6f
  • Loading branch information
yoshi-automation committed Feb 11, 2021
1 parent 5d80a92 commit c19ce6c
Show file tree
Hide file tree
Showing 14 changed files with 62 additions and 18 deletions.
15 changes: 15 additions & 0 deletions packages/google-cloud-vision/.github/header-checker-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{"allowedCopyrightHolders": ["Google LLC"],
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt"],
"sourceFileExtensions": [
"ts",
"js",
"java",
"sh",
"Dockerfile",
"yaml",
"py",
"html",
"txt"
]
}
16 changes: 10 additions & 6 deletions packages/google-cloud-vision/.kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@

set -eo pipefail

cd github/python-vision
if [[ -z "${PROJECT_ROOT:-}" ]]; then
PROJECT_ROOT="github/python-vision"
fi

cd "${PROJECT_ROOT}"

# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1
Expand All @@ -30,16 +34,16 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")

# Remove old nox
python3.6 -m pip uninstall --yes --quiet nox-automation
python3 -m pip uninstall --yes --quiet nox-automation

# Install nox
python3.6 -m pip install --upgrade --quiet nox
python3.6 -m nox --version
python3 -m pip install --upgrade --quiet nox
python3 -m nox --version

# If NOX_SESSION is set, it only runs the specified session,
# otherwise run all the sessions.
if [[ -n "${NOX_SESSION:-}" ]]; then
python3.6 -m nox -s "${NOX_SESSION:-}"
python3 -m nox -s ${NOX_SESSION:-}
else
python3.6 -m nox
python3 -m nox
fi
11 changes: 11 additions & 0 deletions packages/google-cloud-vision/.kokoro/docs/docs-presubmit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,14 @@ env_vars: {
key: "TRAMPOLINE_IMAGE_UPLOAD"
value: "false"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-vision/.kokoro/build.sh"
}

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "docs docfx"
}
1 change: 1 addition & 0 deletions packages/google-cloud-vision/.trampolinerc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ required_envvars+=(
pass_down_envvars+=(
"STAGING_BUCKET"
"V2_STAGING_BUCKET"
"NOX_SESSION"
)

# Prevent unintentional override on the default image.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient):
"GetReferenceImageRequest",
"Image",
"ImageAnnotationContext",
"ImageAnnotatorClient",
"ImageContext",
"ImageProperties",
"ImageSource",
Expand Down Expand Up @@ -186,6 +185,7 @@ class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient):
"Paragraph",
"Position",
"Product",
"ProductSearchClient",
"ProductSearchParams",
"ProductSearchResults",
"ProductSet",
Expand All @@ -204,5 +204,5 @@ class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient):
"WebDetection",
"WebDetectionParams",
"Word",
"ProductSearchClient",
"ImageAnnotatorClient",
)
12 changes: 12 additions & 0 deletions packages/google-cloud-vision/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"]
UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"]

# 'docfx' is excluded since it only needs to run in 'docs-presubmit'
nox.options.sessions = [
"unit",
"system",
"cover",
"lint",
"lint_setup_py",
"blacken",
"docs",
]


@nox.session(python=DEFAULT_PYTHON_VERSION)
def lint(session):
Expand Down Expand Up @@ -75,6 +86,7 @@ def default(session):
session.install(
"mock", "pytest", "pytest-cov",
)

session.install("-e", ".")

# Run py.test against the unit tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_pytest_env_vars() -> Dict[str, str]:

# DO NOT EDIT - automatically generated.
# All versions used to tested samples.
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"]
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"]

# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG['ignored_versions']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_pytest_env_vars() -> Dict[str, str]:

# DO NOT EDIT - automatically generated.
# All versions used to tested samples.
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"]
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"]

# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG['ignored_versions']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_pytest_env_vars() -> Dict[str, str]:

# DO NOT EDIT - automatically generated.
# All versions used to tested samples.
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"]
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"]

# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG['ignored_versions']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_pytest_env_vars() -> Dict[str, str]:

# DO NOT EDIT - automatically generated.
# All versions used to tested samples.
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"]
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"]

# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG['ignored_versions']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_pytest_env_vars() -> Dict[str, str]:

# DO NOT EDIT - automatically generated.
# All versions used to tested samples.
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"]
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"]

# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG['ignored_versions']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_pytest_env_vars() -> Dict[str, str]:

# DO NOT EDIT - automatically generated.
# All versions used to tested samples.
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"]
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"]

# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG['ignored_versions']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_pytest_env_vars() -> Dict[str, str]:

# DO NOT EDIT - automatically generated.
# All versions used to tested samples.
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"]
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"]

# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG['ignored_versions']
Expand Down
7 changes: 4 additions & 3 deletions packages/google-cloud-vision/synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/python-vision.git",
"sha": "2fa6dcd06b59debf1dba80e7061c83e3e3f972a9"
"sha": "79c5dd6dbd8f940a501ad9c0d1b2d6f3adbe5dbc"
}
},
{
Expand All @@ -19,14 +19,14 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "41a4e56982620d3edcf110d76f4fcdfdec471ac8"
"sha": "778d8beae28d6d87eb01fdc839a4b4d966ed2ebe"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "41a4e56982620d3edcf110d76f4fcdfdec471ac8"
"sha": "778d8beae28d6d87eb01fdc839a4b4d966ed2ebe"
}
}
],
Expand Down Expand Up @@ -84,6 +84,7 @@
".github/ISSUE_TEMPLATE/feature_request.md",
".github/ISSUE_TEMPLATE/support_request.md",
".github/PULL_REQUEST_TEMPLATE.md",
".github/header-checker-lint.yml",
".github/release-please.yml",
".github/snippet-bot.yml",
".gitignore",
Expand Down

0 comments on commit c19ce6c

Please sign in to comment.