From 78d493bf1c688d1c1f7acf720b1182e867e2db4e Mon Sep 17 00:00:00 2001 From: arithmetic1728 <58957152+arithmetic1728@users.noreply.github.com> Date: Thu, 23 Jul 2020 11:35:02 -0700 Subject: [PATCH 01/86] feat!: migrate to use microgenerator (#23) --- cloudbuild/AUTHORING_GUIDE.md | 1 + cloudbuild/CONTRIBUTING.md | 1 + 2 files changed, 2 insertions(+) create mode 100644 cloudbuild/AUTHORING_GUIDE.md create mode 100644 cloudbuild/CONTRIBUTING.md diff --git a/cloudbuild/AUTHORING_GUIDE.md b/cloudbuild/AUTHORING_GUIDE.md new file mode 100644 index 000000000000..55c97b32f4c1 --- /dev/null +++ b/cloudbuild/AUTHORING_GUIDE.md @@ -0,0 +1 @@ +See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md \ No newline at end of file diff --git a/cloudbuild/CONTRIBUTING.md b/cloudbuild/CONTRIBUTING.md new file mode 100644 index 000000000000..34c882b6f1a3 --- /dev/null +++ b/cloudbuild/CONTRIBUTING.md @@ -0,0 +1 @@ +See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/CONTRIBUTING.md \ No newline at end of file From 438080d488e201c23edc29732f675a8d2a23dd42 Mon Sep 17 00:00:00 2001 From: Dina Graves Portman Date: Thu, 25 Mar 2021 10:17:29 -0700 Subject: [PATCH 02/86] docs: Adding samples (#69) --- cloudbuild/snippets/noxfile.py | 247 ++++++++++++++++++++++ cloudbuild/snippets/quickstart.py | 50 +++++ cloudbuild/snippets/quickstart_test.py | 25 +++ cloudbuild/snippets/requirements-test.txt | 1 + cloudbuild/snippets/requirements.txt | 2 + 5 files changed, 325 insertions(+) create mode 100644 cloudbuild/snippets/noxfile.py create mode 100644 cloudbuild/snippets/quickstart.py create mode 100644 cloudbuild/snippets/quickstart_test.py create mode 100644 cloudbuild/snippets/requirements-test.txt create mode 100644 cloudbuild/snippets/requirements.txt diff --git a/cloudbuild/snippets/noxfile.py b/cloudbuild/snippets/noxfile.py new file mode 100644 index 000000000000..97bf7da80e39 --- /dev/null +++ b/cloudbuild/snippets/noxfile.py @@ -0,0 +1,247 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from __future__ import print_function + +import os +from pathlib import Path +import sys +from typing import Callable, Dict, List, Optional + +import nox + + +# WARNING - WARNING - WARNING - WARNING - WARNING +# WARNING - WARNING - WARNING - WARNING - WARNING +# DO NOT EDIT THIS FILE EVER! +# WARNING - WARNING - WARNING - WARNING - WARNING +# WARNING - WARNING - WARNING - WARNING - WARNING + +# Copy `noxfile_config.py` to your directory and modify it instead. + + +# `TEST_CONFIG` dict is a configuration hook that allows users to +# modify the test configurations. The values here should be in sync +# with `noxfile_config.py`. Users will copy `noxfile_config.py` into +# their directory and modify it. + +TEST_CONFIG = { + # You can opt out from the test for specific Python versions. + 'ignored_versions': ["2.7"], + + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + 'enforce_type_hints': False, + + # An envvar key for determining the project id to use. Change it + # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + 'gcloud_project_env': 'GOOGLE_CLOUD_PROJECT', + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + 'envs': {}, +} + + +try: + # Ensure we can import noxfile_config in the project's directory. + sys.path.append('.') + from noxfile_config import TEST_CONFIG_OVERRIDE +except ImportError as e: + print("No user noxfile_config found: detail: {}".format(e)) + TEST_CONFIG_OVERRIDE = {} + +# Update the TEST_CONFIG with the user supplied values. +TEST_CONFIG.update(TEST_CONFIG_OVERRIDE) + + +def get_pytest_env_vars() -> Dict[str, str]: + """Returns a dict for pytest invocation.""" + ret = {} + + # Override the GCLOUD_PROJECT and the alias. + env_key = TEST_CONFIG['gcloud_project_env'] + # This should error out if not set. + ret['GOOGLE_CLOUD_PROJECT'] = os.environ[env_key] + + # Apply user supplied envs. + ret.update(TEST_CONFIG['envs']) + return ret + + +# DO NOT EDIT - automatically generated. +# All versions used to tested samples. +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'] + +TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) + +INSTALL_LIBRARY_FROM_SOURCE = bool(os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False)) +# +# Style Checks +# + + +def _determine_local_import_names(start_dir: str) -> List[str]: + """Determines all import names that should be considered "local". + + This is used when running the linter to insure that import order is + properly checked. + """ + file_ext_pairs = [os.path.splitext(path) for path in os.listdir(start_dir)] + return [ + basename + for basename, extension in file_ext_pairs + if extension == ".py" + or os.path.isdir(os.path.join(start_dir, basename)) + and basename not in ("__pycache__") + ] + + +# Linting with flake8. +# +# We ignore the following rules: +# E203: whitespace before ‘:’ +# E266: too many leading ‘#’ for block comment +# E501: line too long +# I202: Additional newline in a section of imports +# +# We also need to specify the rules which are ignored by default: +# ['E226', 'W504', 'E126', 'E123', 'W503', 'E24', 'E704', 'E121'] +FLAKE8_COMMON_ARGS = [ + "--show-source", + "--builtin=gettext", + "--max-complexity=20", + "--import-order-style=google", + "--exclude=.nox,.cache,env,lib,generated_pb2,*_pb2.py,*_pb2_grpc.py", + "--ignore=E121,E123,E126,E203,E226,E24,E266,E501,E704,W503,W504,I202", + "--max-line-length=88", +] + + +@nox.session +def lint(session: nox.sessions.Session) -> None: + if not TEST_CONFIG['enforce_type_hints']: + session.install("flake8", "flake8-import-order") + else: + session.install("flake8", "flake8-import-order", "flake8-annotations") + + local_names = _determine_local_import_names(".") + args = FLAKE8_COMMON_ARGS + [ + "--application-import-names", + ",".join(local_names), + "." + ] + session.run("flake8", *args) +# +# Black +# + + +@nox.session +def blacken(session: nox.sessions.Session) -> None: + session.install("black") + python_files = [path for path in os.listdir(".") if path.endswith(".py")] + + session.run("black", *python_files) + +# +# Sample Tests +# + + +PYTEST_COMMON_ARGS = ["--junitxml=sponge_log.xml"] + + +def _session_tests(session: nox.sessions.Session, post_install: Callable = None) -> None: + """Runs py.test for a particular project.""" + if os.path.exists("requirements.txt"): + session.install("-r", "requirements.txt") + + if os.path.exists("requirements-test.txt"): + session.install("-r", "requirements-test.txt") + + if INSTALL_LIBRARY_FROM_SOURCE: + session.install("-e", _get_repo_root()) + + if post_install: + post_install(session) + + session.run( + "pytest", + *(PYTEST_COMMON_ARGS + session.posargs), + # Pytest will return 5 when no tests are collected. This can happen + # on travis where slow and flaky tests are excluded. + # See http://doc.pytest.org/en/latest/_modules/_pytest/main.html + success_codes=[0, 5], + env=get_pytest_env_vars() + ) + + +@nox.session(python=ALL_VERSIONS) +def py(session: nox.sessions.Session) -> None: + """Runs py.test for a sample using the specified version of Python.""" + if session.python in TESTED_VERSIONS: + _session_tests(session) + else: + session.skip("SKIPPED: {} tests are disabled for this sample.".format( + session.python + )) + + +# +# Readmegen +# + + +def _get_repo_root() -> Optional[str]: + """ Returns the root folder of the project. """ + # Get root of this repository. Assume we don't have directories nested deeper than 10 items. + p = Path(os.getcwd()) + for i in range(10): + if p is None: + break + if Path(p / ".git").exists(): + return str(p) + # .git is not available in repos cloned via Cloud Build + # setup.py is always in the library's root, so use that instead + # https://github.com/googleapis/synthtool/issues/792 + if Path(p / "setup.py").exists(): + return str(p) + p = p.parent + raise Exception("Unable to detect repository root.") + + +GENERATED_READMES = sorted([x for x in Path(".").rglob("*.rst.in")]) + + +@nox.session +@nox.parametrize("path", GENERATED_READMES) +def readmegen(session: nox.sessions.Session, path: str) -> None: + """(Re-)generates the readme for a sample.""" + session.install("jinja2", "pyyaml") + dir_ = os.path.dirname(path) + + if os.path.exists(os.path.join(dir_, "requirements.txt")): + session.install("-r", os.path.join(dir_, "requirements.txt")) + + in_file = os.path.join(dir_, "README.rst.in") + session.run( + "python", _get_repo_root() + "/scripts/readme-gen/readme_gen.py", in_file + ) diff --git a/cloudbuild/snippets/quickstart.py b/cloudbuild/snippets/quickstart.py new file mode 100644 index 000000000000..db5130f021dc --- /dev/null +++ b/cloudbuild/snippets/quickstart.py @@ -0,0 +1,50 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# [START cloudbuild_quickstart] +import google.auth +from google.cloud.devtools import cloudbuild_v1 + + +def quickstart(): + """Create and execute a simple Google Cloud Build configuration, + print the in-progress status and print the completed status.""" + + # Authorize the client with Google defaults + credentials, project_id = google.auth.default() + client = cloudbuild_v1.services.cloud_build.CloudBuildClient() + + build = cloudbuild_v1.Build() + + # The following build steps will output "hello world" + # For more information on build configuration, see + # https://cloud.google.com/build/docs/configuring-builds/create-basic-configuration + build.steps = [{"name": "ubuntu", + "entrypoint": "bash", + "args": ["-c", "echo hello world"]}] + + operation = client.create_build(project_id=project_id, build=build) + # Print the in-progress operation + print("IN PROGRESS:") + print(operation.metadata) + + result = operation.result() + # Print the completed status + print("RESULT:", result.status) +# [END cloudbuild_quickstart] + + +if __name__ == "__main__": + quickstart() diff --git a/cloudbuild/snippets/quickstart_test.py b/cloudbuild/snippets/quickstart_test.py new file mode 100644 index 000000000000..2d23530f7e6b --- /dev/null +++ b/cloudbuild/snippets/quickstart_test.py @@ -0,0 +1,25 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import quickstart + + +def test_quickstart(capsys): + quickstart.quickstart() + out, _ = capsys.readouterr() + # Prints in-progress message + assert "hello world" in out + # Prints final status + assert "Status.SUCCESS" in out diff --git a/cloudbuild/snippets/requirements-test.txt b/cloudbuild/snippets/requirements-test.txt new file mode 100644 index 000000000000..3413ad1c893f --- /dev/null +++ b/cloudbuild/snippets/requirements-test.txt @@ -0,0 +1 @@ +pytest==6.0.1 \ No newline at end of file diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt new file mode 100644 index 000000000000..f578fd77b13b --- /dev/null +++ b/cloudbuild/snippets/requirements.txt @@ -0,0 +1,2 @@ +google-cloud-build==3.0.2 +google-auth==1.28.0 \ No newline at end of file From e5290deae046df086e218cf87233ee2c0f98437c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 26 Mar 2021 06:26:49 +0100 Subject: [PATCH 03/86] chore(deps): update dependency google-cloud-build to v3.1.0 (#76) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index f578fd77b13b..ac19cc3cfc43 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.0.2 +google-cloud-build==3.1.0 google-auth==1.28.0 \ No newline at end of file From fbf10ce1bc9a37337a8c2d382f24d66d148fdf21 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 1 Apr 2021 19:27:50 +0200 Subject: [PATCH 04/86] chore(deps): update dependency google-cloud-build to v3.1.1 (#77) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index ac19cc3cfc43..d4940b9916a1 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.1.0 +google-cloud-build==3.1.1 google-auth==1.28.0 \ No newline at end of file From 4a1354bade38affcad2a2c0417d8b5a54ed14fda Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 3 Apr 2021 02:03:52 +0200 Subject: [PATCH 05/86] chore(deps): update dependency google-cloud-build to v3.2.0 (#80) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index d4940b9916a1..882d5e2ba4da 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.1.1 +google-cloud-build==3.2.0 google-auth==1.28.0 \ No newline at end of file From de7e062230f09cb8f8e24548b02f65776684cf54 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 10 Apr 2021 07:42:57 +0200 Subject: [PATCH 06/86] chore(deps): update dependency google-auth to v1.28.1 (#83) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 882d5e2ba4da..a2f1e44c812c 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.2.0 -google-auth==1.28.0 \ No newline at end of file +google-auth==1.28.1 \ No newline at end of file From 466b59327e41983db5a836c8fdc796f4be1ebaaa Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 12 Apr 2021 22:10:33 +0200 Subject: [PATCH 07/86] chore(deps): update dependency pytest to v6.2.3 (#85) --- cloudbuild/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements-test.txt b/cloudbuild/snippets/requirements-test.txt index 3413ad1c893f..d3f3bacff2e6 100644 --- a/cloudbuild/snippets/requirements-test.txt +++ b/cloudbuild/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==6.0.1 \ No newline at end of file +pytest==6.2.3 \ No newline at end of file From 9098a56d4a4fbe8db4c99b546c9f518cf30f30e2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Apr 2021 20:03:35 +0200 Subject: [PATCH 08/86] chore(deps): update dependency google-auth to v1.30.0 (#87) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index a2f1e44c812c..3584b5c7cbd4 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.2.0 -google-auth==1.28.1 \ No newline at end of file +google-auth==1.30.0 \ No newline at end of file From 67b2ff1d03591a3c3eaf625ef641b962cb01145f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 14 May 2021 01:02:55 +0200 Subject: [PATCH 09/86] chore(deps): update dependency pytest to v6.2.4 (#92) --- cloudbuild/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements-test.txt b/cloudbuild/snippets/requirements-test.txt index d3f3bacff2e6..11b890faecfe 100644 --- a/cloudbuild/snippets/requirements-test.txt +++ b/cloudbuild/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==6.2.3 \ No newline at end of file +pytest==6.2.4 \ No newline at end of file From 3b7ad5f297c915b1b791f124e3cf66b3ee791bc4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 18 May 2021 02:42:55 +0200 Subject: [PATCH 10/86] chore(deps): update dependency google-cloud-build to v3.2.1 (#103) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 3584b5c7cbd4..02e3fa712e67 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.2.0 +google-cloud-build==3.2.1 google-auth==1.30.0 \ No newline at end of file From fdc359bcef20617262a630659e3bba632d8de6a1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 25 May 2021 16:13:34 +0200 Subject: [PATCH 11/86] chore(deps): update dependency google-auth to v1.30.1 (#107) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 02e3fa712e67..afa5e7ebdf1a 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.2.1 -google-auth==1.30.0 \ No newline at end of file +google-auth==1.30.1 \ No newline at end of file From 89a0e56fc2adf238f87878b5f0fba3b7f3e369bb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 9 Jun 2021 07:12:58 +0200 Subject: [PATCH 12/86] chore(deps): update dependency google-auth to v1.30.2 (#109) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index afa5e7ebdf1a..ad1f52ffc053 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.2.1 -google-auth==1.30.1 \ No newline at end of file +google-auth==1.30.2 \ No newline at end of file From 9c91ec0ffbd9dccab9db1e10a41456df9d4d9661 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 10 Jun 2021 22:43:22 +0200 Subject: [PATCH 13/86] chore(deps): update dependency google-auth to v1.31.0 (#110) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index ad1f52ffc053..43a3a07ec352 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.2.1 -google-auth==1.30.2 \ No newline at end of file +google-auth==1.31.0 \ No newline at end of file From 85ad643dd69f3855dbc08f88f3c4dede522a7933 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 26 Jun 2021 02:10:26 +0200 Subject: [PATCH 14/86] chore(deps): update dependency google-auth to v1.32.0 (#117) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-auth](https://togithub.com/googleapis/google-auth-library-python) | `==1.31.0` -> `==1.32.0` | [![age](https://badges.renovateapi.com/packages/pypi/google-auth/1.32.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-auth/1.32.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-auth/1.32.0/compatibility-slim/1.31.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-auth/1.32.0/confidence-slim/1.31.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/google-auth-library-python ### [`v1.32.0`](https://togithub.com/googleapis/google-auth-library-python/blob/master/CHANGELOG.md#​1320-httpswwwgithubcomgoogleapisgoogle-auth-library-pythoncomparev1310v1320-2021-06-16) [Compare Source](https://togithub.com/googleapis/google-auth-library-python/compare/v1.31.0...v1.32.0) ##### Features - allow scopes for self signed jwt ([#​776](https://www.github.com/googleapis/google-auth-library-python/issues/776)) ([2cfe655](https://www.github.com/googleapis/google-auth-library-python/commit/2cfe655bba837170abc07701557a1a5e0fe3294e))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/python-cloudbuild). --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 43a3a07ec352..fc3925640401 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.2.1 -google-auth==1.31.0 \ No newline at end of file +google-auth==1.32.0 \ No newline at end of file From 84df89eace1afc203321bf90aaa0179a02608468 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 1 Jul 2021 01:49:57 +0200 Subject: [PATCH 15/86] chore(deps): update dependency google-auth to v1.32.1 (#124) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index fc3925640401..f0f165aef066 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.2.1 -google-auth==1.32.0 \ No newline at end of file +google-auth==1.32.1 \ No newline at end of file From 5ba12d43bb16eda04a5edf5bd1e8234039137585 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 1 Jul 2021 04:12:12 +0200 Subject: [PATCH 16/86] chore(deps): update dependency google-cloud-build to v3.3.0 (#125) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-cloud-build](https://togithub.com/googleapis/python-cloudbuild) | `==3.2.1` -> `==3.3.0` | [![age](https://badges.renovateapi.com/packages/pypi/google-cloud-build/3.3.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-cloud-build/3.3.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-cloud-build/3.3.0/compatibility-slim/3.2.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-cloud-build/3.3.0/confidence-slim/3.2.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/python-cloudbuild ### [`v3.3.0`](https://togithub.com/googleapis/python-cloudbuild/blob/master/CHANGELOG.md#​330-httpswwwgithubcomgoogleapispython-cloudbuildcomparev321v330-2021-06-30) [Compare Source](https://togithub.com/googleapis/python-cloudbuild/compare/v3.2.1...v3.3.0) ##### Features - add always_use_jwt_access ([#​118](https://www.github.com/googleapis/python-cloudbuild/issues/118)) ([6414a3b](https://www.github.com/googleapis/python-cloudbuild/commit/6414a3bcc27baa4e60b2bf7cf2f7d9f776ad6843)) ##### Bug Fixes - disable always_use_jwt_access ([#​123](https://www.github.com/googleapis/python-cloudbuild/issues/123)) ([c1c9608](https://www.github.com/googleapis/python-cloudbuild/commit/c1c960894dc401b0a125801b08ef1a4fee659abe)) ##### Documentation - omit mention of Python 2.7 in 'CONTRIBUTING.rst' ([#​1127](https://www.github.com/googleapis/python-cloudbuild/issues/1127)) ([#​112](https://www.github.com/googleapis/python-cloudbuild/issues/112)) ([e2420f8](https://www.github.com/googleapis/python-cloudbuild/commit/e2420f8ad5630aedff0d52e3cc4facbb11300b72)), closes [#​1126](https://www.github.com/googleapis/python-cloudbuild/issues/1126) ##### [3.2.1](https://www.github.com/googleapis/python-cloudbuild/compare/v3.2.0...v3.2.1) (2021-05-16) ##### Bug Fixes - **deps:** add packaging requirement ([#​101](https://www.github.com/googleapis/python-cloudbuild/issues/101)) ([9563889](https://www.github.com/googleapis/python-cloudbuild/commit/956388912b5aab80375c1a2439d934f211627e3a))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/python-cloudbuild). --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index f0f165aef066..972c29a86978 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.2.1 +google-cloud-build==3.3.0 google-auth==1.32.1 \ No newline at end of file From 2dec2f3648a9e47db5a5ea7fd8bb754cccef8dd7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 16 Jul 2021 01:43:55 +0200 Subject: [PATCH 17/86] chore(deps): update dependency google-auth to v1.33.0 (#128) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 972c29a86978..787e6f1f6768 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.3.0 -google-auth==1.32.1 \ No newline at end of file +google-auth==1.33.0 \ No newline at end of file From 3eb3348ab450fa9cd4fc625f1d3f5612c0b855e8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 21 Jul 2021 17:28:08 +0200 Subject: [PATCH 18/86] chore(deps): update dependency google-auth to v1.33.1 (#133) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-auth](https://togithub.com/googleapis/google-auth-library-python) | `==1.33.0` -> `==1.33.1` | [![age](https://badges.renovateapi.com/packages/pypi/google-auth/1.33.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-auth/1.33.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-auth/1.33.1/compatibility-slim/1.33.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-auth/1.33.1/confidence-slim/1.33.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/google-auth-library-python ### [`v1.33.1`](https://togithub.com/googleapis/google-auth-library-python/blob/master/CHANGELOG.md#​1331-httpswwwgithubcomgoogleapisgoogle-auth-library-pythoncomparev1330v1331-2021-07-20) [Compare Source](https://togithub.com/googleapis/google-auth-library-python/compare/v1.33.0...v1.33.1)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/python-cloudbuild). --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 787e6f1f6768..0f794705a0e2 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.3.0 -google-auth==1.33.0 \ No newline at end of file +google-auth==1.33.1 \ No newline at end of file From b334022f50bf219efa8c424618f85e40a677300f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 26 Jul 2021 22:18:57 +0200 Subject: [PATCH 19/86] chore(deps): update dependency google-cloud-build to v3.3.1 (#140) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-cloud-build](https://togithub.com/googleapis/python-cloudbuild) | `==3.3.0` -> `==3.3.1` | [![age](https://badges.renovateapi.com/packages/pypi/google-cloud-build/3.3.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-cloud-build/3.3.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-cloud-build/3.3.1/compatibility-slim/3.3.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-cloud-build/3.3.1/confidence-slim/3.3.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/python-cloudbuild ### [`v3.3.1`](https://togithub.com/googleapis/python-cloudbuild/blob/master/CHANGELOG.md#​331-httpswwwgithubcomgoogleapispython-cloudbuildcomparev330v331-2021-07-24) [Compare Source](https://togithub.com/googleapis/python-cloudbuild/compare/v3.3.0...v3.3.1)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/python-cloudbuild). --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 0f794705a0e2..1ca6e4a30b3e 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.3.0 +google-cloud-build==3.3.1 google-auth==1.33.1 \ No newline at end of file From 76e526da2cfd8ddc15e17f76ab446b4d63c3f6e0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Jul 2021 16:48:20 +0200 Subject: [PATCH 20/86] chore(deps): update dependency google-auth to v1.34.0 (#141) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 1ca6e4a30b3e..bc64dbd64379 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.3.1 -google-auth==1.33.1 \ No newline at end of file +google-auth==1.34.0 \ No newline at end of file From 7a2a3af4cea9d861d34f885b712f10ee98a8b3d0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 29 Jul 2021 15:14:14 +0200 Subject: [PATCH 21/86] chore(deps): update dependency google-cloud-build to v3.3.2 (#144) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index bc64dbd64379..1faa7e879c59 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.3.1 +google-cloud-build==3.3.2 google-auth==1.34.0 \ No newline at end of file From bae2d1179fecd23726efa4731e761930d5e06e62 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 17 Aug 2021 17:57:43 +0200 Subject: [PATCH 22/86] chore(deps): update dependency google-auth to v1.35.0 (#148) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 1faa7e879c59..9fd232b27470 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.3.2 -google-auth==1.34.0 \ No newline at end of file +google-auth==1.35.0 \ No newline at end of file From aea1f782b96eeac412c48da915ebba959b4e786d Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 20 Aug 2021 17:52:09 -0400 Subject: [PATCH 23/86] chore: add missing import in owlbot.py (#152) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: add missing import in owlbot.py * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- cloudbuild/snippets/noxfile.py | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/cloudbuild/snippets/noxfile.py b/cloudbuild/snippets/noxfile.py index 97bf7da80e39..e73436a15626 100644 --- a/cloudbuild/snippets/noxfile.py +++ b/cloudbuild/snippets/noxfile.py @@ -28,8 +28,9 @@ # WARNING - WARNING - WARNING - WARNING - WARNING # WARNING - WARNING - WARNING - WARNING - WARNING -# Copy `noxfile_config.py` to your directory and modify it instead. +BLACK_VERSION = "black==19.10b0" +# Copy `noxfile_config.py` to your directory and modify it instead. # `TEST_CONFIG` dict is a configuration hook that allows users to # modify the test configurations. The values here should be in sync @@ -38,7 +39,7 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - 'ignored_versions': ["2.7"], + 'ignored_versions': [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them @@ -50,7 +51,10 @@ # to use your own Cloud project. 'gcloud_project_env': 'GOOGLE_CLOUD_PROJECT', # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', - + # If you need to use a specific version of pip, + # change pip_version_override to the string representation + # of the version number, for example, "20.2.4" + "pip_version_override": None, # A dictionary you want to inject into your test. Don't put any # secrets here. These values will override predefined values. 'envs': {}, @@ -84,15 +88,15 @@ 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", "3.9"] +# All versions used to test samples. +ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) -INSTALL_LIBRARY_FROM_SOURCE = bool(os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False)) +INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ("True", "true") # # Style Checks # @@ -156,7 +160,7 @@ def lint(session: nox.sessions.Session) -> None: @nox.session def blacken(session: nox.sessions.Session) -> None: - session.install("black") + session.install(BLACK_VERSION) python_files = [path for path in os.listdir(".") if path.endswith(".py")] session.run("black", *python_files) @@ -170,12 +174,21 @@ def blacken(session: nox.sessions.Session) -> None: def _session_tests(session: nox.sessions.Session, post_install: Callable = None) -> None: + if TEST_CONFIG["pip_version_override"]: + pip_version = TEST_CONFIG["pip_version_override"] + session.install(f"pip=={pip_version}") """Runs py.test for a particular project.""" if os.path.exists("requirements.txt"): - session.install("-r", "requirements.txt") + if os.path.exists("constraints.txt"): + session.install("-r", "requirements.txt", "-c", "constraints.txt") + else: + session.install("-r", "requirements.txt") if os.path.exists("requirements-test.txt"): - session.install("-r", "requirements-test.txt") + if os.path.exists("constraints-test.txt"): + session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt") + else: + session.install("-r", "requirements-test.txt") if INSTALL_LIBRARY_FROM_SOURCE: session.install("-e", _get_repo_root()) From 295e129d8dbe71a627cb5c03c1d14e28cb2ac296 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 21 Aug 2021 00:07:21 +0200 Subject: [PATCH 24/86] chore(deps): update dependency google-auth to v2 (#150) Co-authored-by: Dina Graves Portman --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 9fd232b27470..6a921de43b76 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.3.2 -google-auth==1.35.0 \ No newline at end of file +google-auth==2.0.1 \ No newline at end of file From 943e888abed3d1c5bd2dec72ddfd8824b8730d21 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 23 Aug 2021 17:47:12 +0200 Subject: [PATCH 25/86] chore(deps): update dependency google-cloud-build to v3.4.0 (#153) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 6a921de43b76..9812afaada81 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.3.2 +google-cloud-build==3.4.0 google-auth==2.0.1 \ No newline at end of file From 0aa4f1a087550391c7ed87d7c5fa2249c8ef0c84 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 31 Aug 2021 14:30:44 +0200 Subject: [PATCH 26/86] chore(deps): update dependency google-cloud-build to v3.5.0 (#162) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 9812afaada81..588147aad072 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.4.0 +google-cloud-build==3.5.0 google-auth==2.0.1 \ No newline at end of file From 927ba3a1297f4a081964d0e824af75efade819ba Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 31 Aug 2021 17:03:46 +0200 Subject: [PATCH 27/86] chore(deps): update dependency pytest to v6.2.5 (#161) Co-authored-by: Anthonios Partheniou --- cloudbuild/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements-test.txt b/cloudbuild/snippets/requirements-test.txt index 11b890faecfe..9299a7a8b069 100644 --- a/cloudbuild/snippets/requirements-test.txt +++ b/cloudbuild/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==6.2.4 \ No newline at end of file +pytest==6.2.5 \ No newline at end of file From 1c489d0a49af50cbb0e8ce7c5eca35ef6aeac51c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 1 Sep 2021 13:40:42 +0200 Subject: [PATCH 28/86] chore(deps): update dependency google-auth to v2.0.2 (#163) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 588147aad072..55f44c3dd108 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.5.0 -google-auth==2.0.1 \ No newline at end of file +google-auth==2.0.2 \ No newline at end of file From 20804d7205399b58a4d37f353eaf14e1c28e2223 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 16 Sep 2021 17:05:53 +0200 Subject: [PATCH 29/86] chore(deps): update dependency google-auth to v2.1.0 (#167) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 55f44c3dd108..de9db881240e 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.5.0 -google-auth==2.0.2 \ No newline at end of file +google-auth==2.1.0 \ No newline at end of file From feec64299bba486e3db1880fb1ed21e0689fa171 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 17 Sep 2021 16:08:16 +0000 Subject: [PATCH 30/86] chore: blacken samples noxfile template (#168) --- cloudbuild/snippets/noxfile.py | 44 +++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/cloudbuild/snippets/noxfile.py b/cloudbuild/snippets/noxfile.py index e73436a15626..b008613f03ff 100644 --- a/cloudbuild/snippets/noxfile.py +++ b/cloudbuild/snippets/noxfile.py @@ -39,17 +39,15 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - 'ignored_versions': [], - + "ignored_versions": [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them - 'enforce_type_hints': False, - + "enforce_type_hints": False, # An envvar key for determining the project id to use. Change it # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a # build specific Cloud project. You can also use your own string # to use your own Cloud project. - 'gcloud_project_env': 'GOOGLE_CLOUD_PROJECT', + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', # If you need to use a specific version of pip, # change pip_version_override to the string representation @@ -57,13 +55,13 @@ "pip_version_override": None, # A dictionary you want to inject into your test. Don't put any # secrets here. These values will override predefined values. - 'envs': {}, + "envs": {}, } try: # Ensure we can import noxfile_config in the project's directory. - sys.path.append('.') + sys.path.append(".") from noxfile_config import TEST_CONFIG_OVERRIDE except ImportError as e: print("No user noxfile_config found: detail: {}".format(e)) @@ -78,12 +76,12 @@ def get_pytest_env_vars() -> Dict[str, str]: ret = {} # Override the GCLOUD_PROJECT and the alias. - env_key = TEST_CONFIG['gcloud_project_env'] + env_key = TEST_CONFIG["gcloud_project_env"] # This should error out if not set. - ret['GOOGLE_CLOUD_PROJECT'] = os.environ[env_key] + ret["GOOGLE_CLOUD_PROJECT"] = os.environ[env_key] # Apply user supplied envs. - ret.update(TEST_CONFIG['envs']) + ret.update(TEST_CONFIG["envs"]) return ret @@ -92,11 +90,14 @@ def get_pytest_env_vars() -> Dict[str, str]: ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. -IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] +IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) -INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ("True", "true") +INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ( + "True", + "true", +) # # Style Checks # @@ -141,7 +142,7 @@ def _determine_local_import_names(start_dir: str) -> List[str]: @nox.session def lint(session: nox.sessions.Session) -> None: - if not TEST_CONFIG['enforce_type_hints']: + if not TEST_CONFIG["enforce_type_hints"]: session.install("flake8", "flake8-import-order") else: session.install("flake8", "flake8-import-order", "flake8-annotations") @@ -150,9 +151,11 @@ def lint(session: nox.sessions.Session) -> None: args = FLAKE8_COMMON_ARGS + [ "--application-import-names", ",".join(local_names), - "." + ".", ] session.run("flake8", *args) + + # # Black # @@ -165,6 +168,7 @@ def blacken(session: nox.sessions.Session) -> None: session.run("black", *python_files) + # # Sample Tests # @@ -173,7 +177,9 @@ def blacken(session: nox.sessions.Session) -> None: PYTEST_COMMON_ARGS = ["--junitxml=sponge_log.xml"] -def _session_tests(session: nox.sessions.Session, post_install: Callable = None) -> None: +def _session_tests( + session: nox.sessions.Session, post_install: Callable = None +) -> None: if TEST_CONFIG["pip_version_override"]: pip_version = TEST_CONFIG["pip_version_override"] session.install(f"pip=={pip_version}") @@ -203,7 +209,7 @@ def _session_tests(session: nox.sessions.Session, post_install: Callable = None) # on travis where slow and flaky tests are excluded. # See http://doc.pytest.org/en/latest/_modules/_pytest/main.html success_codes=[0, 5], - env=get_pytest_env_vars() + env=get_pytest_env_vars(), ) @@ -213,9 +219,9 @@ def py(session: nox.sessions.Session) -> None: if session.python in TESTED_VERSIONS: _session_tests(session) else: - session.skip("SKIPPED: {} tests are disabled for this sample.".format( - session.python - )) + session.skip( + "SKIPPED: {} tests are disabled for this sample.".format(session.python) + ) # From 44284d8d669fe420533ced69f1e791a1c0ff88e3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 25 Sep 2021 00:15:11 +0200 Subject: [PATCH 31/86] chore(deps): update dependency google-cloud-build to v3.5.1 (#174) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index de9db881240e..943f948bf808 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.5.0 +google-cloud-build==3.5.1 google-auth==2.1.0 \ No newline at end of file From 447a8d96a2424654503ea9aae2540564bdfcf138 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 27 Sep 2021 19:51:01 +0200 Subject: [PATCH 32/86] chore(deps): update dependency google-auth to v2.2.0 (#175) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 943f948bf808..a049799f6fb0 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.5.1 -google-auth==2.1.0 \ No newline at end of file +google-auth==2.2.0 \ No newline at end of file From a66b34066cb524b3cf5c59fd8426b847d5a556b0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 29 Sep 2021 16:55:51 +0200 Subject: [PATCH 33/86] chore(deps): update dependency google-auth to v2.2.1 (#176) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index a049799f6fb0..03f7b7fc7faf 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.5.1 -google-auth==2.2.0 \ No newline at end of file +google-auth==2.2.1 \ No newline at end of file From 627fa172d8e52f016e2f900b2aaa72ac2d92fbb9 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 30 Sep 2021 15:44:41 +0000 Subject: [PATCH 34/86] chore: fail samples nox session if python version is missing (#179) --- cloudbuild/snippets/noxfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cloudbuild/snippets/noxfile.py b/cloudbuild/snippets/noxfile.py index b008613f03ff..1fd8956fbf01 100644 --- a/cloudbuild/snippets/noxfile.py +++ b/cloudbuild/snippets/noxfile.py @@ -98,6 +98,10 @@ def get_pytest_env_vars() -> Dict[str, str]: "True", "true", ) + +# Error if a python version is missing +nox.options.error_on_missing_interpreters = True + # # Style Checks # From 36b5d9f17099c0ec989e114612fe5f6ae82b2944 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 8 Oct 2021 17:16:24 +0000 Subject: [PATCH 35/86] chore(python): Add kokoro configs for python 3.10 samples testing (#186) --- cloudbuild/snippets/noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/noxfile.py b/cloudbuild/snippets/noxfile.py index 1fd8956fbf01..93a9122cc457 100644 --- a/cloudbuild/snippets/noxfile.py +++ b/cloudbuild/snippets/noxfile.py @@ -87,7 +87,7 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. # All versions used to test samples. -ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] +ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] From ace00b5381c766003911e700ff82318881e8d1b4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 10 Oct 2021 00:03:19 +0200 Subject: [PATCH 36/86] chore(deps): update dependency google-cloud-build to v3.5.2 (#180) Co-authored-by: Anthonios Partheniou Co-authored-by: kelsk <38271546+kelsk@users.noreply.github.com> --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 03f7b7fc7faf..9e16f390016b 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.5.1 +google-cloud-build==3.5.2 google-auth==2.2.1 \ No newline at end of file From a14ff571d05cf125ad8891c4e8aa42948441052e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 11 Oct 2021 18:00:27 +0200 Subject: [PATCH 37/86] chore(deps): update dependency google-auth to v2.3.0 (#187) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 9e16f390016b..fb80967d6713 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.5.2 -google-auth==2.2.1 \ No newline at end of file +google-auth==2.3.0 \ No newline at end of file From dac754d28dd9fabe77e70eba25950af6b3e6152c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 12 Oct 2021 21:13:30 +0200 Subject: [PATCH 38/86] chore(deps): update dependency google-cloud-build to v3.6.0 (#188) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index fb80967d6713..cbad6e3a8565 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.5.2 +google-cloud-build==3.6.0 google-auth==2.3.0 \ No newline at end of file From 696559674e26d7f1fad6bf760994ae104fe7929d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 15 Oct 2021 09:20:10 +0200 Subject: [PATCH 39/86] chore(deps): update dependency google-cloud-build to v3.7.0 (#191) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index cbad6e3a8565..8a519e1f8dd8 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.6.0 +google-cloud-build==3.7.0 google-auth==2.3.0 \ No newline at end of file From dea2200b7d63aee42e162481ca6ad310261e1829 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 25 Oct 2021 23:23:07 +0200 Subject: [PATCH 40/86] chore(deps): update dependency google-auth to v2.3.1 (#192) Co-authored-by: Anthonios Partheniou --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 8a519e1f8dd8..1b51d8f93c05 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.7.0 -google-auth==2.3.0 \ No newline at end of file +google-auth==2.3.1 \ No newline at end of file From a661fcea7d24a9f2bc2d9bdab625d0ec787a9ea0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 26 Oct 2021 21:54:41 +0200 Subject: [PATCH 41/86] chore(deps): update dependency google-auth to v2.3.2 (#194) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 1b51d8f93c05..6effe081cb51 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.7.0 -google-auth==2.3.1 \ No newline at end of file +google-auth==2.3.2 \ No newline at end of file From 7649cb630977925f3df77c0b3b52078a30efd658 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 2 Nov 2021 15:39:22 +0100 Subject: [PATCH 42/86] chore(deps): update dependency google-auth to v2.3.3 (#197) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 6effe081cb51..77aafb0beae3 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.7.0 -google-auth==2.3.2 \ No newline at end of file +google-auth==2.3.3 \ No newline at end of file From b47ae1298358e0d89e0cbf164d4977f3c78b45cb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 9 Nov 2021 17:05:47 +0100 Subject: [PATCH 43/86] chore(deps): update dependency google-cloud-build to v3.7.1 (#203) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 77aafb0beae3..7d17c9be93de 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.7.0 +google-cloud-build==3.7.1 google-auth==2.3.3 \ No newline at end of file From c712324bfe5df6927009fb7facd14aced2f37b88 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sun, 12 Dec 2021 12:00:43 -0500 Subject: [PATCH 44/86] chore: update python-docs-samples link to main branch (#207) Source-Link: https://github.com/googleapis/synthtool/commit/0941ef32b18aff0be34a40404f3971d9f51996e9 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2f90537dd7df70f6b663cd654b1fa5dee483cf6a4edcfd46072b2775be8a23ec Co-authored-by: Owl Bot --- cloudbuild/AUTHORING_GUIDE.md | 2 +- cloudbuild/CONTRIBUTING.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudbuild/AUTHORING_GUIDE.md b/cloudbuild/AUTHORING_GUIDE.md index 55c97b32f4c1..8249522ffc2d 100644 --- a/cloudbuild/AUTHORING_GUIDE.md +++ b/cloudbuild/AUTHORING_GUIDE.md @@ -1 +1 @@ -See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md \ No newline at end of file +See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md \ No newline at end of file diff --git a/cloudbuild/CONTRIBUTING.md b/cloudbuild/CONTRIBUTING.md index 34c882b6f1a3..f5fe2e6baf13 100644 --- a/cloudbuild/CONTRIBUTING.md +++ b/cloudbuild/CONTRIBUTING.md @@ -1 +1 @@ -See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/CONTRIBUTING.md \ No newline at end of file +See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/CONTRIBUTING.md \ No newline at end of file From bb253f21a40f75ba9964936abbf1e23b173149b4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 Jan 2022 07:37:43 -0500 Subject: [PATCH 45/86] chore(samples): Add check for tests in directory (#214) Source-Link: https://github.com/googleapis/synthtool/commit/52aef91f8d25223d9dbdb4aebd94ba8eea2101f3 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:36a95b8f494e4674dc9eee9af98961293b51b86b3649942aac800ae6c1f796d4 Co-authored-by: Owl Bot --- cloudbuild/snippets/noxfile.py | 70 +++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/cloudbuild/snippets/noxfile.py b/cloudbuild/snippets/noxfile.py index 93a9122cc457..3bbef5d54f44 100644 --- a/cloudbuild/snippets/noxfile.py +++ b/cloudbuild/snippets/noxfile.py @@ -14,6 +14,7 @@ from __future__ import print_function +import glob import os from pathlib import Path import sys @@ -184,37 +185,44 @@ def blacken(session: nox.sessions.Session) -> None: def _session_tests( session: nox.sessions.Session, post_install: Callable = None ) -> None: - if TEST_CONFIG["pip_version_override"]: - pip_version = TEST_CONFIG["pip_version_override"] - session.install(f"pip=={pip_version}") - """Runs py.test for a particular project.""" - if os.path.exists("requirements.txt"): - if os.path.exists("constraints.txt"): - session.install("-r", "requirements.txt", "-c", "constraints.txt") - else: - session.install("-r", "requirements.txt") - - if os.path.exists("requirements-test.txt"): - if os.path.exists("constraints-test.txt"): - session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt") - else: - session.install("-r", "requirements-test.txt") - - if INSTALL_LIBRARY_FROM_SOURCE: - session.install("-e", _get_repo_root()) - - if post_install: - post_install(session) - - session.run( - "pytest", - *(PYTEST_COMMON_ARGS + session.posargs), - # Pytest will return 5 when no tests are collected. This can happen - # on travis where slow and flaky tests are excluded. - # See http://doc.pytest.org/en/latest/_modules/_pytest/main.html - success_codes=[0, 5], - env=get_pytest_env_vars(), - ) + # check for presence of tests + test_list = glob.glob("*_test.py") + glob.glob("test_*.py") + if len(test_list) == 0: + print("No tests found, skipping directory.") + else: + if TEST_CONFIG["pip_version_override"]: + pip_version = TEST_CONFIG["pip_version_override"] + session.install(f"pip=={pip_version}") + """Runs py.test for a particular project.""" + if os.path.exists("requirements.txt"): + if os.path.exists("constraints.txt"): + session.install("-r", "requirements.txt", "-c", "constraints.txt") + else: + session.install("-r", "requirements.txt") + + if os.path.exists("requirements-test.txt"): + if os.path.exists("constraints-test.txt"): + session.install( + "-r", "requirements-test.txt", "-c", "constraints-test.txt" + ) + else: + session.install("-r", "requirements-test.txt") + + if INSTALL_LIBRARY_FROM_SOURCE: + session.install("-e", _get_repo_root()) + + if post_install: + post_install(session) + + session.run( + "pytest", + *(PYTEST_COMMON_ARGS + session.posargs), + # Pytest will return 5 when no tests are collected. This can happen + # on travis where slow and flaky tests are excluded. + # See http://doc.pytest.org/en/latest/_modules/_pytest/main.html + success_codes=[0, 5], + env=get_pytest_env_vars(), + ) @nox.session(python=ALL_VERSIONS) From 8a297344c638982524b696b111a78b0b60b88141 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 18 Jan 2022 19:55:53 -0500 Subject: [PATCH 46/86] chore(python): Noxfile recognizes that tests can live in a folder (#219) Source-Link: https://github.com/googleapis/synthtool/commit/4760d8dce1351d93658cb11d02a1b7ceb23ae5d7 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f0e4b51deef56bed74d3e2359c583fc104a8d6367da3984fc5c66938db738828 Co-authored-by: Owl Bot --- cloudbuild/snippets/noxfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cloudbuild/snippets/noxfile.py b/cloudbuild/snippets/noxfile.py index 3bbef5d54f44..20cdfc620138 100644 --- a/cloudbuild/snippets/noxfile.py +++ b/cloudbuild/snippets/noxfile.py @@ -187,6 +187,7 @@ def _session_tests( ) -> None: # check for presence of tests test_list = glob.glob("*_test.py") + glob.glob("test_*.py") + test_list.extend(glob.glob("tests")) if len(test_list) == 0: print("No tests found, skipping directory.") else: From 23e5799d563af48316a2e661bbebe0b4b01ddf27 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 7 Feb 2022 17:18:42 +0100 Subject: [PATCH 47/86] chore(deps): update all dependencies (#224) --- cloudbuild/snippets/requirements-test.txt | 2 +- cloudbuild/snippets/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudbuild/snippets/requirements-test.txt b/cloudbuild/snippets/requirements-test.txt index 9299a7a8b069..618cbcc93794 100644 --- a/cloudbuild/snippets/requirements-test.txt +++ b/cloudbuild/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==6.2.5 \ No newline at end of file +pytest==7.0.0 \ No newline at end of file diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 7d17c9be93de..d6a7af690d18 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.7.1 -google-auth==2.3.3 \ No newline at end of file +google-auth==2.6.0 \ No newline at end of file From d7c58a397fe8d27118d3a7b048ed736fc924e2e6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 14 Feb 2022 16:52:47 +0100 Subject: [PATCH 48/86] chore(deps): update dependency pytest to v7.0.1 (#229) --- cloudbuild/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements-test.txt b/cloudbuild/snippets/requirements-test.txt index 618cbcc93794..76593bb6e893 100644 --- a/cloudbuild/snippets/requirements-test.txt +++ b/cloudbuild/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.0.0 \ No newline at end of file +pytest==7.0.1 \ No newline at end of file From fbe596db7fec8c63985d460b2413505d405a7097 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 23 Feb 2022 16:49:35 +0100 Subject: [PATCH 49/86] chore(deps): update dependency google-cloud-build to v3.8.0 (#230) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index d6a7af690d18..0c28ff1905ed 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.7.1 +google-cloud-build==3.8.0 google-auth==2.6.0 \ No newline at end of file From 7e167655ecdd285e7e81aea3601dc256d2de90c3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 4 Mar 2022 13:12:30 -0500 Subject: [PATCH 50/86] chore: Adding support for pytest-xdist and pytest-parallel (#240) Source-Link: https://github.com/googleapis/synthtool/commit/82f5cb283efffe96e1b6cd634738e0e7de2cd90a Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:5d8da01438ece4021d135433f2cf3227aa39ef0eaccc941d62aa35e6902832ae Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- cloudbuild/snippets/noxfile.py | 80 +++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 34 deletions(-) diff --git a/cloudbuild/snippets/noxfile.py b/cloudbuild/snippets/noxfile.py index 20cdfc620138..4c808af73ea2 100644 --- a/cloudbuild/snippets/noxfile.py +++ b/cloudbuild/snippets/noxfile.py @@ -188,42 +188,54 @@ def _session_tests( # check for presence of tests test_list = glob.glob("*_test.py") + glob.glob("test_*.py") test_list.extend(glob.glob("tests")) + if len(test_list) == 0: print("No tests found, skipping directory.") - else: - if TEST_CONFIG["pip_version_override"]: - pip_version = TEST_CONFIG["pip_version_override"] - session.install(f"pip=={pip_version}") - """Runs py.test for a particular project.""" - if os.path.exists("requirements.txt"): - if os.path.exists("constraints.txt"): - session.install("-r", "requirements.txt", "-c", "constraints.txt") - else: - session.install("-r", "requirements.txt") - - if os.path.exists("requirements-test.txt"): - if os.path.exists("constraints-test.txt"): - session.install( - "-r", "requirements-test.txt", "-c", "constraints-test.txt" - ) - else: - session.install("-r", "requirements-test.txt") - - if INSTALL_LIBRARY_FROM_SOURCE: - session.install("-e", _get_repo_root()) - - if post_install: - post_install(session) - - session.run( - "pytest", - *(PYTEST_COMMON_ARGS + session.posargs), - # Pytest will return 5 when no tests are collected. This can happen - # on travis where slow and flaky tests are excluded. - # See http://doc.pytest.org/en/latest/_modules/_pytest/main.html - success_codes=[0, 5], - env=get_pytest_env_vars(), - ) + return + + if TEST_CONFIG["pip_version_override"]: + pip_version = TEST_CONFIG["pip_version_override"] + session.install(f"pip=={pip_version}") + """Runs py.test for a particular project.""" + concurrent_args = [] + if os.path.exists("requirements.txt"): + if os.path.exists("constraints.txt"): + session.install("-r", "requirements.txt", "-c", "constraints.txt") + else: + session.install("-r", "requirements.txt") + with open("requirements.txt") as rfile: + packages = rfile.read() + + if os.path.exists("requirements-test.txt"): + if os.path.exists("constraints-test.txt"): + session.install( + "-r", "requirements-test.txt", "-c", "constraints-test.txt" + ) + else: + session.install("-r", "requirements-test.txt") + with open("requirements-test.txt") as rtfile: + packages += rtfile.read() + + if INSTALL_LIBRARY_FROM_SOURCE: + session.install("-e", _get_repo_root()) + + if post_install: + post_install(session) + + if "pytest-parallel" in packages: + concurrent_args.extend(['--workers', 'auto', '--tests-per-worker', 'auto']) + elif "pytest-xdist" in packages: + concurrent_args.extend(['-n', 'auto']) + + session.run( + "pytest", + *(PYTEST_COMMON_ARGS + session.posargs + concurrent_args), + # Pytest will return 5 when no tests are collected. This can happen + # on travis where slow and flaky tests are excluded. + # See http://doc.pytest.org/en/latest/_modules/_pytest/main.html + success_codes=[0, 5], + env=get_pytest_env_vars(), + ) @nox.session(python=ALL_VERSIONS) From 36b3a64f3f272230c3814abceec98faebec57847 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 7 Mar 2022 22:02:57 +0100 Subject: [PATCH 51/86] chore(deps): update dependency google-cloud-build to v3.8.1 (#243) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 0c28ff1905ed..193925f41be5 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.8.0 +google-cloud-build==3.8.1 google-auth==2.6.0 \ No newline at end of file From 22fd6514267aed0aa8516275441bc23ceb0d2768 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 13 Mar 2022 16:15:28 +0100 Subject: [PATCH 52/86] chore(deps): update dependency pytest to v7.1.0 (#246) --- cloudbuild/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements-test.txt b/cloudbuild/snippets/requirements-test.txt index 76593bb6e893..90f614f99902 100644 --- a/cloudbuild/snippets/requirements-test.txt +++ b/cloudbuild/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.0.1 \ No newline at end of file +pytest==7.1.0 \ No newline at end of file From de17fa33d5676a3593f711a5b26d01e6b49dba36 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 19 Mar 2022 11:59:57 +0100 Subject: [PATCH 53/86] chore(deps): update all dependencies (#247) --- cloudbuild/snippets/requirements-test.txt | 2 +- cloudbuild/snippets/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudbuild/snippets/requirements-test.txt b/cloudbuild/snippets/requirements-test.txt index 90f614f99902..49435c9d77e7 100644 --- a/cloudbuild/snippets/requirements-test.txt +++ b/cloudbuild/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.1.0 \ No newline at end of file +pytest==7.1.1 \ No newline at end of file diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 193925f41be5..07bf20863e4f 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.8.1 -google-auth==2.6.0 \ No newline at end of file +google-auth==2.6.2 \ No newline at end of file From 2b6dbe2afd313d34f604a7a32aec8568177fb738 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 00:00:34 +0000 Subject: [PATCH 54/86] chore(python): use black==22.3.0 (#250) Source-Link: https://github.com/googleapis/synthtool/commit/6fab84af09f2cf89a031fd8671d1def6b2931b11 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe --- cloudbuild/snippets/noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/noxfile.py b/cloudbuild/snippets/noxfile.py index 4c808af73ea2..949e0fde9ae1 100644 --- a/cloudbuild/snippets/noxfile.py +++ b/cloudbuild/snippets/noxfile.py @@ -29,7 +29,7 @@ # WARNING - WARNING - WARNING - WARNING - WARNING # WARNING - WARNING - WARNING - WARNING - WARNING -BLACK_VERSION = "black==19.10b0" +BLACK_VERSION = "black==22.3.0" # Copy `noxfile_config.py` to your directory and modify it instead. From 87967fc89bdc473d6a8a8d52b5fdde75bd512f34 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 8 Apr 2022 01:12:30 +0200 Subject: [PATCH 55/86] chore(deps): update dependency google-auth to v2.6.3 (#261) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 07bf20863e4f..68d9a65ffdc5 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.8.1 -google-auth==2.6.2 \ No newline at end of file +google-auth==2.6.3 \ No newline at end of file From 0d279206d71a1af0090172447cc2516c92c01533 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 13 Apr 2022 01:28:15 +0200 Subject: [PATCH 56/86] chore(deps): update dependency google-auth to v2.6.4 (#265) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 68d9a65ffdc5..1a9cfc70dc22 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.8.1 -google-auth==2.6.3 \ No newline at end of file +google-auth==2.6.4 \ No newline at end of file From 692eddf8d7d686a26e3b8e4afc40f09ff692259f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 15 Apr 2022 02:44:32 +0200 Subject: [PATCH 57/86] chore(deps): update dependency google-auth to v2.6.5 (#267) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 1a9cfc70dc22..04850b41d378 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.8.1 -google-auth==2.6.4 \ No newline at end of file +google-auth==2.6.5 \ No newline at end of file From d396ffbf6b25f8255dd9cb8a78de6d9ea81c072b Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Tue, 19 Apr 2022 12:40:46 -0700 Subject: [PATCH 58/86] chore(quickstart): clarify private pools instructions (#268) --- cloudbuild/snippets/quickstart.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cloudbuild/snippets/quickstart.py b/cloudbuild/snippets/quickstart.py index db5130f021dc..39064e498bf8 100644 --- a/cloudbuild/snippets/quickstart.py +++ b/cloudbuild/snippets/quickstart.py @@ -23,6 +23,8 @@ def quickstart(): print the in-progress status and print the completed status.""" # Authorize the client with Google defaults + # If you're using Private Pools, add a regional `api_endpoint` to `CloudBuildClient()` + # For example, '-cloudbuild.googleapis.com' credentials, project_id = google.auth.default() client = cloudbuild_v1.services.cloud_build.CloudBuildClient() From 14794930336feb11c4db9c55d0ed21eb057be5f4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 20:04:04 -0400 Subject: [PATCH 59/86] chore(python): add nox session to sort python imports (#269) Source-Link: https://github.com/googleapis/synthtool/commit/1b71c10e20de7ed3f97f692f99a0e3399b67049f Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 Co-authored-by: Owl Bot --- cloudbuild/snippets/noxfile.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/cloudbuild/snippets/noxfile.py b/cloudbuild/snippets/noxfile.py index 949e0fde9ae1..38bb0a572b81 100644 --- a/cloudbuild/snippets/noxfile.py +++ b/cloudbuild/snippets/noxfile.py @@ -30,6 +30,7 @@ # WARNING - WARNING - WARNING - WARNING - WARNING BLACK_VERSION = "black==22.3.0" +ISORT_VERSION = "isort==5.10.1" # Copy `noxfile_config.py` to your directory and modify it instead. @@ -168,12 +169,32 @@ def lint(session: nox.sessions.Session) -> None: @nox.session def blacken(session: nox.sessions.Session) -> None: + """Run black. Format code to uniform standard.""" session.install(BLACK_VERSION) python_files = [path for path in os.listdir(".") if path.endswith(".py")] session.run("black", *python_files) +# +# format = isort + black +# + +@nox.session +def format(session: nox.sessions.Session) -> None: + """ + Run isort to sort imports. Then run black + to format code to uniform standard. + """ + session.install(BLACK_VERSION, ISORT_VERSION) + python_files = [path for path in os.listdir(".") if path.endswith(".py")] + + # Use the --fss option to sort imports using strict alphabetical order. + # See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections + session.run("isort", "--fss", *python_files) + session.run("black", *python_files) + + # # Sample Tests # From 5a6593e062c899a32558072978edc1b98f9bbebb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 22 Apr 2022 10:29:29 +0200 Subject: [PATCH 60/86] chore(deps): update dependency google-auth to v2.6.6 (#272) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 04850b41d378..8b233415bba6 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.8.1 -google-auth==2.6.5 \ No newline at end of file +google-auth==2.6.6 \ No newline at end of file From f3943383752777a12e75e6de73c9951266f544dc Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 25 Apr 2022 17:06:36 +0200 Subject: [PATCH 61/86] chore(deps): update dependency pytest to v7.1.2 (#273) --- cloudbuild/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements-test.txt b/cloudbuild/snippets/requirements-test.txt index 49435c9d77e7..6a3d7bca6791 100644 --- a/cloudbuild/snippets/requirements-test.txt +++ b/cloudbuild/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.1.1 \ No newline at end of file +pytest==7.1.2 \ No newline at end of file From fbb8ef78f0215785d407f3d8f06e1ed9fb7b3b95 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 5 May 2022 21:38:45 +0200 Subject: [PATCH 62/86] chore(deps): update dependency google-cloud-build to v3.8.2 (#278) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 8b233415bba6..a0512573512a 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.8.1 +google-cloud-build==3.8.2 google-auth==2.6.6 \ No newline at end of file From 8767483d22038f55c46e063acaafaaa8562b3100 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sun, 10 Jul 2022 08:39:51 -0400 Subject: [PATCH 63/86] fix: require python 3.7+ (#308) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(python): drop python 3.6 Source-Link: https://github.com/googleapis/synthtool/commit/4f89b13af10d086458f9b379e56a614f9d6dab7b Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c * add api_description to .repo-metadata.json * require python 3.7+ in setup.py * remove python 3.6 sample configs * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- cloudbuild/snippets/noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/noxfile.py b/cloudbuild/snippets/noxfile.py index 38bb0a572b81..5fcb9d7461f2 100644 --- a/cloudbuild/snippets/noxfile.py +++ b/cloudbuild/snippets/noxfile.py @@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. # All versions used to test samples. -ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"] +ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] From 02490d1c743e9685984337678c2e53b21224c90a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 16 Jul 2022 14:29:34 +0200 Subject: [PATCH 64/86] chore(deps): update all dependencies (#300) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update all dependencies * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * revert Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- cloudbuild/snippets/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index a0512573512a..abe1bb6457c1 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.8.2 -google-auth==2.6.6 \ No newline at end of file +google-cloud-build==3.8.3 +google-auth==2.7.0 \ No newline at end of file From 9361e88b0e6defddf1b43d13c7a2701185fdb030 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 2 Aug 2022 14:44:45 +0200 Subject: [PATCH 65/86] chore(deps): update all dependencies (#314) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update all dependencies * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * revert Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- cloudbuild/snippets/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index abe1bb6457c1..cef75d1aeeb8 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.8.3 -google-auth==2.7.0 \ No newline at end of file +google-cloud-build==3.9.0 +google-auth==2.9.1 \ No newline at end of file From 088c1d41a8829e6522cc1b8b81fd0690fff71f32 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 6 Aug 2022 02:25:10 +0200 Subject: [PATCH 66/86] chore(deps): update all dependencies (#317) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update all dependencies * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * revert Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index cef75d1aeeb8..12229230cb10 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.9.0 -google-auth==2.9.1 \ No newline at end of file +google-auth==2.10.0 \ No newline at end of file From 8c6f1b5db069c7acf2d587afcd03027d0438cc42 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 18 Aug 2022 20:19:10 +0200 Subject: [PATCH 67/86] chore(deps): update dependency google-cloud-build to v3.9.1 (#323) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 12229230cb10..fb0b7fa4df59 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.9.0 +google-cloud-build==3.9.1 google-auth==2.10.0 \ No newline at end of file From 4ce67634aee500fd02f73d6cc95f806c7f2bb1b1 Mon Sep 17 00:00:00 2001 From: joshuamo Date: Thu, 18 Aug 2022 13:59:56 -0500 Subject: [PATCH 68/86] chore(python): Add example of using client_options for regional endpoints (#316) * Add example of using client_options for regional endpoints * Add example of using client_options for regional endpoints * Add example of using client_options for regional endpoints * Add example of using client_options for regional endpoints Co-authored-by: Aaron Gabriel Neyer --- cloudbuild/snippets/quickstart.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cloudbuild/snippets/quickstart.py b/cloudbuild/snippets/quickstart.py index 39064e498bf8..9885a445eb6a 100644 --- a/cloudbuild/snippets/quickstart.py +++ b/cloudbuild/snippets/quickstart.py @@ -23,11 +23,19 @@ def quickstart(): print the in-progress status and print the completed status.""" # Authorize the client with Google defaults - # If you're using Private Pools, add a regional `api_endpoint` to `CloudBuildClient()` - # For example, '-cloudbuild.googleapis.com' credentials, project_id = google.auth.default() client = cloudbuild_v1.services.cloud_build.CloudBuildClient() + # If you're using Private Pools or a non-global default pool, add a regional + # `api_endpoint` to `CloudBuildClient()` + # For example, '-cloudbuild.googleapis.com' + # + # from google.api_core import client_options + # client_options = client_options.ClientOptions( + # api_endpoint="us-central1-cloudbuild.googleapis.com" + # ) + # client = cloudbuild_v1.services.cloud_build.CloudBuildClient(client_options=client_options) + build = cloudbuild_v1.Build() # The following build steps will output "hello world" From 8baad9fe1ca444a71860c7047df7b6d05bf636dc Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 23 Aug 2022 16:31:04 +0200 Subject: [PATCH 69/86] chore(deps): update dependency google-auth to v2.11.0 (#325) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index fb0b7fa4df59..09b839114403 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.9.1 -google-auth==2.10.0 \ No newline at end of file +google-auth==2.11.0 \ No newline at end of file From c9507fd1cf6d1edfdd605872c616af19e329ed0c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 6 Sep 2022 17:41:49 +0200 Subject: [PATCH 70/86] chore(deps): update dependency pytest to v7.1.3 (#335) --- cloudbuild/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements-test.txt b/cloudbuild/snippets/requirements-test.txt index 6a3d7bca6791..f97bae64aa54 100644 --- a/cloudbuild/snippets/requirements-test.txt +++ b/cloudbuild/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.1.2 \ No newline at end of file +pytest==7.1.3 \ No newline at end of file From 98d79869ffa02c4d20e2f26116a9d0d50105e014 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 16:14:20 +0000 Subject: [PATCH 71/86] chore: detect samples tests in nested directories (#339) Source-Link: https://github.com/googleapis/synthtool/commit/50db768f450a50d7c1fd62513c113c9bb96fd434 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e09366bdf0fd9c8976592988390b24d53583dd9f002d476934da43725adbb978 --- cloudbuild/snippets/noxfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudbuild/snippets/noxfile.py b/cloudbuild/snippets/noxfile.py index 5fcb9d7461f2..0398d72ff690 100644 --- a/cloudbuild/snippets/noxfile.py +++ b/cloudbuild/snippets/noxfile.py @@ -207,8 +207,8 @@ def _session_tests( session: nox.sessions.Session, post_install: Callable = None ) -> None: # check for presence of tests - test_list = glob.glob("*_test.py") + glob.glob("test_*.py") - test_list.extend(glob.glob("tests")) + test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True) + test_list.extend(glob.glob("**/tests", recursive=True)) if len(test_list) == 0: print("No tests found, skipping directory.") From be38215b49d92a498d565c40767c91c56ffed3eb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Sep 2022 13:19:40 +0200 Subject: [PATCH 72/86] chore(deps): update dependency google-auth to v2.11.1 (#340) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 09b839114403..e7bd0350fd07 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.9.1 -google-auth==2.11.0 \ No newline at end of file +google-auth==2.11.1 \ No newline at end of file From 42e452f83034e8f33a86eed37e0b58ecf196144a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 3 Oct 2022 17:17:22 +0200 Subject: [PATCH 73/86] chore(deps): update dependency google-auth to v2.12.0 (#343) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index e7bd0350fd07..b9cd1409e221 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.9.1 -google-auth==2.11.1 \ No newline at end of file +google-auth==2.12.0 \ No newline at end of file From 28c128f3d7db708dbf2c6fd759c236a29b67d641 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 4 Oct 2022 15:33:57 +0200 Subject: [PATCH 74/86] chore(deps): update dependency google-cloud-build to v3.9.2 (#345) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index b9cd1409e221..3da637a16c76 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.9.1 +google-cloud-build==3.9.2 google-auth==2.12.0 \ No newline at end of file From d41a48cc67a976208ca5b38f4876fb152f57674c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 10 Oct 2022 20:00:14 +0200 Subject: [PATCH 75/86] chore(deps): update dependency google-cloud-build to v3.9.3 (#348) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 3da637a16c76..ec6473c142b9 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-build==3.9.2 +google-cloud-build==3.9.3 google-auth==2.12.0 \ No newline at end of file From 335977b65a5fbadb8b47d2dde88de1adecaab0d7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 18 Oct 2022 15:12:01 +0200 Subject: [PATCH 76/86] chore(deps): update dependency google-auth to v2.13.0 (#349) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index ec6473c142b9..12ed8d6cff23 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.9.3 -google-auth==2.12.0 \ No newline at end of file +google-auth==2.13.0 \ No newline at end of file From 7934f8a6dc4d2325520acd1bc8e56469fe204443 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 26 Oct 2022 12:50:20 +0200 Subject: [PATCH 77/86] chore(deps): update dependency pytest to v7.2.0 (#350) --- cloudbuild/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements-test.txt b/cloudbuild/snippets/requirements-test.txt index f97bae64aa54..89cb815c988e 100644 --- a/cloudbuild/snippets/requirements-test.txt +++ b/cloudbuild/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.1.3 \ No newline at end of file +pytest==7.2.0 \ No newline at end of file From 5af6eb3f42de66ae79ada392d20d1baaca43cc37 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 1 Nov 2022 14:11:29 +0100 Subject: [PATCH 78/86] chore(deps): update dependency google-auth to v2.14.0 (#354) --- cloudbuild/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/requirements.txt b/cloudbuild/snippets/requirements.txt index 12ed8d6cff23..c48aa8687fad 100644 --- a/cloudbuild/snippets/requirements.txt +++ b/cloudbuild/snippets/requirements.txt @@ -1,2 +1,2 @@ google-cloud-build==3.9.3 -google-auth==2.13.0 \ No newline at end of file +google-auth==2.14.0 \ No newline at end of file From bfdaf132bf018b1e9cb254be6ce58b0982a83ebe Mon Sep 17 00:00:00 2001 From: Don McCasland Date: Tue, 8 Nov 2022 14:46:45 -0800 Subject: [PATCH 79/86] Adding 2.7 test --- cloudbuild/snippets/noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/noxfile.py b/cloudbuild/snippets/noxfile.py index 0398d72ff690..738b9784e11d 100644 --- a/cloudbuild/snippets/noxfile.py +++ b/cloudbuild/snippets/noxfile.py @@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. # All versions used to test samples. -ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10"] +ALL_VERSIONS = ["2.7", "3.7", "3.8", "3.9", "3.10"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] From 84b6a242c0dfb2e2927e07395e3746f22aeb55b3 Mon Sep 17 00:00:00 2001 From: Don McCasland Date: Tue, 8 Nov 2022 14:59:31 -0800 Subject: [PATCH 80/86] Removing 2.7 test --- cloudbuild/snippets/noxfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudbuild/snippets/noxfile.py b/cloudbuild/snippets/noxfile.py index 738b9784e11d..6d7879fee998 100644 --- a/cloudbuild/snippets/noxfile.py +++ b/cloudbuild/snippets/noxfile.py @@ -41,7 +41,7 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - "ignored_versions": [], + "ignored_versions": ["2.7"], # Old samples are opted out of enforcing Python type hints # All new samples should feature them "enforce_type_hints": False, @@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. # All versions used to test samples. -ALL_VERSIONS = ["2.7", "3.7", "3.8", "3.9", "3.10"] +ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] From 31a92c935729f3aef8c3f77e3e125cf75f7c418a Mon Sep 17 00:00:00 2001 From: Don McCasland Date: Tue, 8 Nov 2022 15:42:19 -0800 Subject: [PATCH 81/86] removing noxfile and adding noxfile_config.py --- cloudbuild/snippets/noxfile.py | 312 -------------------------- cloudbuild/snippets/noxfile_config.py | 40 ++++ 2 files changed, 40 insertions(+), 312 deletions(-) delete mode 100644 cloudbuild/snippets/noxfile.py create mode 100644 cloudbuild/snippets/noxfile_config.py diff --git a/cloudbuild/snippets/noxfile.py b/cloudbuild/snippets/noxfile.py deleted file mode 100644 index 6d7879fee998..000000000000 --- a/cloudbuild/snippets/noxfile.py +++ /dev/null @@ -1,312 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from __future__ import print_function - -import glob -import os -from pathlib import Path -import sys -from typing import Callable, Dict, List, Optional - -import nox - - -# WARNING - WARNING - WARNING - WARNING - WARNING -# WARNING - WARNING - WARNING - WARNING - WARNING -# DO NOT EDIT THIS FILE EVER! -# WARNING - WARNING - WARNING - WARNING - WARNING -# WARNING - WARNING - WARNING - WARNING - WARNING - -BLACK_VERSION = "black==22.3.0" -ISORT_VERSION = "isort==5.10.1" - -# Copy `noxfile_config.py` to your directory and modify it instead. - -# `TEST_CONFIG` dict is a configuration hook that allows users to -# modify the test configurations. The values here should be in sync -# with `noxfile_config.py`. Users will copy `noxfile_config.py` into -# their directory and modify it. - -TEST_CONFIG = { - # You can opt out from the test for specific Python versions. - "ignored_versions": ["2.7"], - # Old samples are opted out of enforcing Python type hints - # All new samples should feature them - "enforce_type_hints": False, - # An envvar key for determining the project id to use. Change it - # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a - # build specific Cloud project. You can also use your own string - # to use your own Cloud project. - "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", - # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', - # If you need to use a specific version of pip, - # change pip_version_override to the string representation - # of the version number, for example, "20.2.4" - "pip_version_override": None, - # A dictionary you want to inject into your test. Don't put any - # secrets here. These values will override predefined values. - "envs": {}, -} - - -try: - # Ensure we can import noxfile_config in the project's directory. - sys.path.append(".") - from noxfile_config import TEST_CONFIG_OVERRIDE -except ImportError as e: - print("No user noxfile_config found: detail: {}".format(e)) - TEST_CONFIG_OVERRIDE = {} - -# Update the TEST_CONFIG with the user supplied values. -TEST_CONFIG.update(TEST_CONFIG_OVERRIDE) - - -def get_pytest_env_vars() -> Dict[str, str]: - """Returns a dict for pytest invocation.""" - ret = {} - - # Override the GCLOUD_PROJECT and the alias. - env_key = TEST_CONFIG["gcloud_project_env"] - # This should error out if not set. - ret["GOOGLE_CLOUD_PROJECT"] = os.environ[env_key] - - # Apply user supplied envs. - ret.update(TEST_CONFIG["envs"]) - return ret - - -# DO NOT EDIT - automatically generated. -# All versions used to test samples. -ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10"] - -# Any default versions that should be ignored. -IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] - -TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) - -INSTALL_LIBRARY_FROM_SOURCE = os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False) in ( - "True", - "true", -) - -# Error if a python version is missing -nox.options.error_on_missing_interpreters = True - -# -# Style Checks -# - - -def _determine_local_import_names(start_dir: str) -> List[str]: - """Determines all import names that should be considered "local". - - This is used when running the linter to insure that import order is - properly checked. - """ - file_ext_pairs = [os.path.splitext(path) for path in os.listdir(start_dir)] - return [ - basename - for basename, extension in file_ext_pairs - if extension == ".py" - or os.path.isdir(os.path.join(start_dir, basename)) - and basename not in ("__pycache__") - ] - - -# Linting with flake8. -# -# We ignore the following rules: -# E203: whitespace before ‘:’ -# E266: too many leading ‘#’ for block comment -# E501: line too long -# I202: Additional newline in a section of imports -# -# We also need to specify the rules which are ignored by default: -# ['E226', 'W504', 'E126', 'E123', 'W503', 'E24', 'E704', 'E121'] -FLAKE8_COMMON_ARGS = [ - "--show-source", - "--builtin=gettext", - "--max-complexity=20", - "--import-order-style=google", - "--exclude=.nox,.cache,env,lib,generated_pb2,*_pb2.py,*_pb2_grpc.py", - "--ignore=E121,E123,E126,E203,E226,E24,E266,E501,E704,W503,W504,I202", - "--max-line-length=88", -] - - -@nox.session -def lint(session: nox.sessions.Session) -> None: - if not TEST_CONFIG["enforce_type_hints"]: - session.install("flake8", "flake8-import-order") - else: - session.install("flake8", "flake8-import-order", "flake8-annotations") - - local_names = _determine_local_import_names(".") - args = FLAKE8_COMMON_ARGS + [ - "--application-import-names", - ",".join(local_names), - ".", - ] - session.run("flake8", *args) - - -# -# Black -# - - -@nox.session -def blacken(session: nox.sessions.Session) -> None: - """Run black. Format code to uniform standard.""" - session.install(BLACK_VERSION) - python_files = [path for path in os.listdir(".") if path.endswith(".py")] - - session.run("black", *python_files) - - -# -# format = isort + black -# - -@nox.session -def format(session: nox.sessions.Session) -> None: - """ - Run isort to sort imports. Then run black - to format code to uniform standard. - """ - session.install(BLACK_VERSION, ISORT_VERSION) - python_files = [path for path in os.listdir(".") if path.endswith(".py")] - - # Use the --fss option to sort imports using strict alphabetical order. - # See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections - session.run("isort", "--fss", *python_files) - session.run("black", *python_files) - - -# -# Sample Tests -# - - -PYTEST_COMMON_ARGS = ["--junitxml=sponge_log.xml"] - - -def _session_tests( - session: nox.sessions.Session, post_install: Callable = None -) -> None: - # check for presence of tests - test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True) - test_list.extend(glob.glob("**/tests", recursive=True)) - - if len(test_list) == 0: - print("No tests found, skipping directory.") - return - - if TEST_CONFIG["pip_version_override"]: - pip_version = TEST_CONFIG["pip_version_override"] - session.install(f"pip=={pip_version}") - """Runs py.test for a particular project.""" - concurrent_args = [] - if os.path.exists("requirements.txt"): - if os.path.exists("constraints.txt"): - session.install("-r", "requirements.txt", "-c", "constraints.txt") - else: - session.install("-r", "requirements.txt") - with open("requirements.txt") as rfile: - packages = rfile.read() - - if os.path.exists("requirements-test.txt"): - if os.path.exists("constraints-test.txt"): - session.install( - "-r", "requirements-test.txt", "-c", "constraints-test.txt" - ) - else: - session.install("-r", "requirements-test.txt") - with open("requirements-test.txt") as rtfile: - packages += rtfile.read() - - if INSTALL_LIBRARY_FROM_SOURCE: - session.install("-e", _get_repo_root()) - - if post_install: - post_install(session) - - if "pytest-parallel" in packages: - concurrent_args.extend(['--workers', 'auto', '--tests-per-worker', 'auto']) - elif "pytest-xdist" in packages: - concurrent_args.extend(['-n', 'auto']) - - session.run( - "pytest", - *(PYTEST_COMMON_ARGS + session.posargs + concurrent_args), - # Pytest will return 5 when no tests are collected. This can happen - # on travis where slow and flaky tests are excluded. - # See http://doc.pytest.org/en/latest/_modules/_pytest/main.html - success_codes=[0, 5], - env=get_pytest_env_vars(), - ) - - -@nox.session(python=ALL_VERSIONS) -def py(session: nox.sessions.Session) -> None: - """Runs py.test for a sample using the specified version of Python.""" - if session.python in TESTED_VERSIONS: - _session_tests(session) - else: - session.skip( - "SKIPPED: {} tests are disabled for this sample.".format(session.python) - ) - - -# -# Readmegen -# - - -def _get_repo_root() -> Optional[str]: - """ Returns the root folder of the project. """ - # Get root of this repository. Assume we don't have directories nested deeper than 10 items. - p = Path(os.getcwd()) - for i in range(10): - if p is None: - break - if Path(p / ".git").exists(): - return str(p) - # .git is not available in repos cloned via Cloud Build - # setup.py is always in the library's root, so use that instead - # https://github.com/googleapis/synthtool/issues/792 - if Path(p / "setup.py").exists(): - return str(p) - p = p.parent - raise Exception("Unable to detect repository root.") - - -GENERATED_READMES = sorted([x for x in Path(".").rglob("*.rst.in")]) - - -@nox.session -@nox.parametrize("path", GENERATED_READMES) -def readmegen(session: nox.sessions.Session, path: str) -> None: - """(Re-)generates the readme for a sample.""" - session.install("jinja2", "pyyaml") - dir_ = os.path.dirname(path) - - if os.path.exists(os.path.join(dir_, "requirements.txt")): - session.install("-r", os.path.join(dir_, "requirements.txt")) - - in_file = os.path.join(dir_, "README.rst.in") - session.run( - "python", _get_repo_root() + "/scripts/readme-gen/readme_gen.py", in_file - ) diff --git a/cloudbuild/snippets/noxfile_config.py b/cloudbuild/snippets/noxfile_config.py new file mode 100644 index 000000000000..adf61a1fa730 --- /dev/null +++ b/cloudbuild/snippets/noxfile_config.py @@ -0,0 +1,40 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Default TEST_CONFIG_OVERRIDE for python repos. + +# You can copy this file into your directory, then it will be imported from +# the noxfile.py. + +# The source of truth: +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/noxfile_config.py + +TEST_CONFIG_OVERRIDE = { + # You can opt out from the test for specific Python versions. + # NOTE: We currently only run the test in Python 3.8. + "ignored_versions": ["2.7"], + # Old samples are opted out of enforcing Python type hints + # All new samples should feature them + "enforce_type_hints": True, + # An envvar key for determining the project id to use. Change it + # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + "gcloud_project_env": "GOOGLE_CLOUD_PROJECT", + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + "envs": { + }, +} From e4501722ca346917eb796b65485e0e9e6dd3f1b4 Mon Sep 17 00:00:00 2001 From: Don McCasland Date: Tue, 8 Nov 2022 16:17:43 -0800 Subject: [PATCH 82/86] Adding CODEOWNERS and blunderbuss --- .github/CODEOWNERS | 1 + .github/blunderbuss.yml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6d84c22da6ae..29a429257c25 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -25,6 +25,7 @@ /billing/**/* @GoogleCloudPlatform/billing-samples-maintainers @GoogleCloudPlatform/python-samples-reviewers /blog/**/* @GoogleCloudPlatform/python-samples-reviewers /cdn/**/* @mpwarres @GoogleCloudPlatform/python-samples-reviewers +/cloudbuild/**/* @GoogleCloudPlatform/python-samples-reviewers /cloud-sql/**/* @GoogleCloudPlatform/infra-db-dpes @GoogleCloudPlatform/python-samples-reviewers /codelabs/**/* @GoogleCloudPlatform/python-samples-reviewers /composer/**/* @leahecole @rachael-ds @rafalbiegacz @GoogleCloudPlatform/python-samples-reviewers diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml index bc1059f6faa8..fd5bd30dd13b 100644 --- a/.github/blunderbuss.yml +++ b/.github/blunderbuss.yml @@ -33,6 +33,10 @@ assign_issues_by: - 'api: cloudbilling' to: - GoogleCloudPlatform/billing-samples-maintainers +- labels: + - 'api: cloudbuild' + to: + - GoogleCloudPlatform/python-samples-owners - labels: - 'api: cloudsql' to: From 01c20f04a389e74520ea730f6785f1e5b11aaaab Mon Sep 17 00:00:00 2001 From: Don McCasland Date: Tue, 8 Nov 2022 16:23:40 -0800 Subject: [PATCH 83/86] updating owners --- .github/CODEOWNERS | 2 +- .github/blunderbuss.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 29a429257c25..5eb62f6a48b8 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -25,7 +25,7 @@ /billing/**/* @GoogleCloudPlatform/billing-samples-maintainers @GoogleCloudPlatform/python-samples-reviewers /blog/**/* @GoogleCloudPlatform/python-samples-reviewers /cdn/**/* @mpwarres @GoogleCloudPlatform/python-samples-reviewers -/cloudbuild/**/* @GoogleCloudPlatform/python-samples-reviewers +/cloudbuild/**/* @GoogleCloudPlatform/torus-dpe @GoogleCloudPlatform/python-samples-reviewers /cloud-sql/**/* @GoogleCloudPlatform/infra-db-dpes @GoogleCloudPlatform/python-samples-reviewers /codelabs/**/* @GoogleCloudPlatform/python-samples-reviewers /composer/**/* @leahecole @rachael-ds @rafalbiegacz @GoogleCloudPlatform/python-samples-reviewers diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml index fd5bd30dd13b..97dd93b5f3f3 100644 --- a/.github/blunderbuss.yml +++ b/.github/blunderbuss.yml @@ -36,7 +36,7 @@ assign_issues_by: - labels: - 'api: cloudbuild' to: - - GoogleCloudPlatform/python-samples-owners + - GoogleCloudPlatform/torus-dpe - labels: - 'api: cloudsql' to: From 67c7cd83ee93d22629e92cb4aff55484d1ba382f Mon Sep 17 00:00:00 2001 From: Don McCasland Date: Tue, 8 Nov 2022 16:31:26 -0800 Subject: [PATCH 84/86] Update cloudbuild/snippets/quickstart.py Co-authored-by: Dan Lee <71398022+dandhlee@users.noreply.github.com> --- cloudbuild/snippets/quickstart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/quickstart.py b/cloudbuild/snippets/quickstart.py index 9885a445eb6a..e57c9bc59370 100644 --- a/cloudbuild/snippets/quickstart.py +++ b/cloudbuild/snippets/quickstart.py @@ -18,7 +18,7 @@ from google.cloud.devtools import cloudbuild_v1 -def quickstart(): +def quickstart() -> None: """Create and execute a simple Google Cloud Build configuration, print the in-progress status and print the completed status.""" From 3cf33483195dff2dffd085a61709d525636fef09 Mon Sep 17 00:00:00 2001 From: Don McCasland Date: Tue, 8 Nov 2022 16:31:36 -0800 Subject: [PATCH 85/86] Update cloudbuild/snippets/quickstart_test.py Co-authored-by: Dan Lee <71398022+dandhlee@users.noreply.github.com> --- cloudbuild/snippets/quickstart_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/snippets/quickstart_test.py b/cloudbuild/snippets/quickstart_test.py index 2d23530f7e6b..d719556eae05 100644 --- a/cloudbuild/snippets/quickstart_test.py +++ b/cloudbuild/snippets/quickstart_test.py @@ -16,7 +16,7 @@ import quickstart -def test_quickstart(capsys): +def test_quickstart(capsys: pytest.CaptureFixture) -> None: quickstart.quickstart() out, _ = capsys.readouterr() # Prints in-progress message From c278ce9c3c37f6d77c254b741026933f1f955669 Mon Sep 17 00:00:00 2001 From: Don McCasland Date: Tue, 8 Nov 2022 16:31:43 -0800 Subject: [PATCH 86/86] Update cloudbuild/snippets/quickstart_test.py Co-authored-by: Dan Lee <71398022+dandhlee@users.noreply.github.com> --- cloudbuild/snippets/quickstart_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cloudbuild/snippets/quickstart_test.py b/cloudbuild/snippets/quickstart_test.py index d719556eae05..ad846a533e01 100644 --- a/cloudbuild/snippets/quickstart_test.py +++ b/cloudbuild/snippets/quickstart_test.py @@ -13,6 +13,8 @@ # limitations under the License. +import pytest + import quickstart