From 53e4043851dc6692afd91c8fe01f62d311605f3d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 23 Mar 2022 11:36:13 -0600 Subject: [PATCH 01/13] chore(python): configure release-please on previous major versions (#69) Source-Link: https://github.com/googleapis/synthtool/commit/c1dd87e9287f8de99930d3046dd555c4d03384c6 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .github/release-please.yml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 44c78f7..8807627 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:4e1991042fe54b991db9ca17c8fb386e61b22fe4d1472a568bf0fcac85dcf5d3 + digest: sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba diff --git a/.github/release-please.yml b/.github/release-please.yml index 466597e..6def37a 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,2 +1,8 @@ releaseType: python handleGHRelease: true +# NOTE: this section is generated by synthtool.languages.python +# See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py +branches: +- branch: v0 + handleGHRelease: true + releaseType: python From 59faa81464355eba722c63647efb05a28605de2c 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:04:26 +0000 Subject: [PATCH 02/13] chore(python): use black==22.3.0 (#70) Source-Link: https://github.com/googleapis/synthtool/commit/6fab84af09f2cf89a031fd8671d1def6b2931b11 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe --- .github/.OwlBot.lock.yaml | 2 +- docs/conf.py | 5 +- .../source_context_v1/types/source_context.py | 146 ++++++++++++++---- noxfile.py | 9 +- 4 files changed, 130 insertions(+), 32 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 8807627..87dd006 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba + digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe diff --git a/docs/conf.py b/docs/conf.py index dad92cf..5b66a25 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -361,7 +361,10 @@ intersphinx_mapping = { "python": ("https://python.readthedocs.org/en/latest/", None), "google-auth": ("https://googleapis.dev/python/google-auth/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,), + "google.api_core": ( + "https://googleapis.dev/python/google-api-core/latest/", + None, + ), "grpc": ("https://grpc.github.io/grpc/python/", None), "proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None), "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), diff --git a/google/cloud/source_context_v1/types/source_context.py b/google/cloud/source_context_v1/types/source_context.py index 42523d4..f653051 100644 --- a/google/cloud/source_context_v1/types/source_context.py +++ b/google/cloud/source_context_v1/types/source_context.py @@ -69,16 +69,28 @@ class SourceContext(proto.Message): """ cloud_repo = proto.Field( - proto.MESSAGE, number=1, oneof="context", message="CloudRepoSourceContext", + proto.MESSAGE, + number=1, + oneof="context", + message="CloudRepoSourceContext", ) cloud_workspace = proto.Field( - proto.MESSAGE, number=2, oneof="context", message="CloudWorkspaceSourceContext", + proto.MESSAGE, + number=2, + oneof="context", + message="CloudWorkspaceSourceContext", ) gerrit = proto.Field( - proto.MESSAGE, number=3, oneof="context", message="GerritSourceContext", + proto.MESSAGE, + number=3, + oneof="context", + message="GerritSourceContext", ) git = proto.Field( - proto.MESSAGE, number=6, oneof="context", message="GitSourceContext", + proto.MESSAGE, + number=6, + oneof="context", + message="GitSourceContext", ) @@ -93,8 +105,16 @@ class ExtendedSourceContext(proto.Message): Labels with user defined metadata. """ - context = proto.Field(proto.MESSAGE, number=1, message="SourceContext",) - labels = proto.MapField(proto.STRING, proto.STRING, number=2,) + context = proto.Field( + proto.MESSAGE, + number=1, + message="SourceContext", + ) + labels = proto.MapField( + proto.STRING, + proto.STRING, + number=2, + ) class AliasContext(proto.Message): @@ -114,8 +134,15 @@ class Kind(proto.Enum): MOVABLE = 2 OTHER = 4 - kind = proto.Field(proto.ENUM, number=1, enum=Kind,) - name = proto.Field(proto.STRING, number=2,) + kind = proto.Field( + proto.ENUM, + number=1, + enum=Kind, + ) + name = proto.Field( + proto.STRING, + number=2, + ) class CloudRepoSourceContext(proto.Message): @@ -146,11 +173,26 @@ class CloudRepoSourceContext(proto.Message): This field is a member of `oneof`_ ``revision``. """ - repo_id = proto.Field(proto.MESSAGE, number=1, message="RepoId",) - revision_id = proto.Field(proto.STRING, number=2, oneof="revision",) - alias_name = proto.Field(proto.STRING, number=3, oneof="revision",) + repo_id = proto.Field( + proto.MESSAGE, + number=1, + message="RepoId", + ) + revision_id = proto.Field( + proto.STRING, + number=2, + oneof="revision", + ) + alias_name = proto.Field( + proto.STRING, + number=3, + oneof="revision", + ) alias_context = proto.Field( - proto.MESSAGE, number=4, oneof="revision", message="AliasContext", + proto.MESSAGE, + number=4, + oneof="revision", + message="AliasContext", ) @@ -166,8 +208,15 @@ class CloudWorkspaceSourceContext(proto.Message): most recent snapshot. """ - workspace_id = proto.Field(proto.MESSAGE, number=1, message="CloudWorkspaceId",) - snapshot_id = proto.Field(proto.STRING, number=2,) + workspace_id = proto.Field( + proto.MESSAGE, + number=1, + message="CloudWorkspaceId", + ) + snapshot_id = proto.Field( + proto.STRING, + number=2, + ) class GerritSourceContext(proto.Message): @@ -202,12 +251,29 @@ class GerritSourceContext(proto.Message): This field is a member of `oneof`_ ``revision``. """ - host_uri = proto.Field(proto.STRING, number=1,) - gerrit_project = proto.Field(proto.STRING, number=2,) - revision_id = proto.Field(proto.STRING, number=3, oneof="revision",) - alias_name = proto.Field(proto.STRING, number=4, oneof="revision",) + host_uri = proto.Field( + proto.STRING, + number=1, + ) + gerrit_project = proto.Field( + proto.STRING, + number=2, + ) + revision_id = proto.Field( + proto.STRING, + number=3, + oneof="revision", + ) + alias_name = proto.Field( + proto.STRING, + number=4, + oneof="revision", + ) alias_context = proto.Field( - proto.MESSAGE, number=5, oneof="revision", message="AliasContext", + proto.MESSAGE, + number=5, + oneof="revision", + message="AliasContext", ) @@ -223,8 +289,14 @@ class GitSourceContext(proto.Message): required. """ - url = proto.Field(proto.STRING, number=1,) - revision_id = proto.Field(proto.STRING, number=2,) + url = proto.Field( + proto.STRING, + number=1, + ) + revision_id = proto.Field( + proto.STRING, + number=2, + ) class RepoId(proto.Message): @@ -251,9 +323,16 @@ class RepoId(proto.Message): """ project_repo_id = proto.Field( - proto.MESSAGE, number=1, oneof="id", message="ProjectRepoId", + proto.MESSAGE, + number=1, + oneof="id", + message="ProjectRepoId", + ) + uid = proto.Field( + proto.STRING, + number=2, + oneof="id", ) - uid = proto.Field(proto.STRING, number=2, oneof="id",) class ProjectRepoId(proto.Message): @@ -268,8 +347,14 @@ class ProjectRepoId(proto.Message): default repo. """ - project_id = proto.Field(proto.STRING, number=1,) - repo_name = proto.Field(proto.STRING, number=2,) + project_id = proto.Field( + proto.STRING, + number=1, + ) + repo_name = proto.Field( + proto.STRING, + number=2, + ) class CloudWorkspaceId(proto.Message): @@ -286,8 +371,15 @@ class CloudWorkspaceId(proto.Message): the Source API's CreateWorkspace method. """ - repo_id = proto.Field(proto.MESSAGE, number=1, message="RepoId",) - name = proto.Field(proto.STRING, number=2,) + repo_id = proto.Field( + proto.MESSAGE, + number=1, + message="RepoId", + ) + name = proto.Field( + proto.STRING, + number=2, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/noxfile.py b/noxfile.py index 2a2001c..3addb4e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -24,7 +24,7 @@ import nox -BLACK_VERSION = "black==19.10b0" +BLACK_VERSION = "black==22.3.0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" @@ -57,7 +57,9 @@ def lint(session): """ session.install("flake8", BLACK_VERSION) session.run( - "black", "--check", *BLACK_PATHS, + "black", + "--check", + *BLACK_PATHS, ) session.run("flake8", "google", "tests") @@ -67,7 +69,8 @@ def blacken(session): """Run black. Format code to uniform standard.""" session.install(BLACK_VERSION) session.run( - "black", *BLACK_PATHS, + "black", + *BLACK_PATHS, ) From 201aca88cf6273269c29ebfc686f3391d8d679ce Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 16:48:30 +0000 Subject: [PATCH 03/13] chore(python): add E231 to .flake8 ignore list (#71) Source-Link: https://github.com/googleapis/synthtool/commit/7ff4aad2ec5af0380e8bd6da1fa06eaadf24ec81 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:462782b0b492346b2d9099aaff52206dd30bc8e031ea97082e6facecc2373244 --- .flake8 | 2 +- .github/.OwlBot.lock.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.flake8 b/.flake8 index 29227d4..2e43874 100644 --- a/.flake8 +++ b/.flake8 @@ -16,7 +16,7 @@ # Generated by synthtool. DO NOT EDIT! [flake8] -ignore = E203, E266, E501, W503 +ignore = E203, E231, E266, E501, W503 exclude = # Exclude generated code. **/proto/** diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 87dd006..9e0a935 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe + digest: sha256:462782b0b492346b2d9099aaff52206dd30bc8e031ea97082e6facecc2373244 From 2c7f142ea83fd55b73122bceefbd5ea7352c1540 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 00:32:13 +0000 Subject: [PATCH 04/13] chore(python): update .pre-commit-config.yaml to use black==22.3.0 (#72) Source-Link: https://github.com/googleapis/synthtool/commit/7804ade3daae0d66649bee8df6c55484c6580b8d Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d --- .github/.OwlBot.lock.yaml | 3 ++- .pre-commit-config.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 9e0a935..22cc254 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:462782b0b492346b2d9099aaff52206dd30bc8e031ea97082e6facecc2373244 + digest: sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d +# created: 2022-03-30T23:44:26.560599165Z diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62eb5a7..46d2371 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - repo: https://github.com/psf/black - rev: 19.10b0 + rev: 22.3.0 hooks: - id: black - repo: https://gitlab.com/pycqa/flake8 From f5147fe3db026f060c308eab70449d400458cae9 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 02:14:23 +0000 Subject: [PATCH 05/13] chore(python): Enable size-label bot (#73) Source-Link: https://github.com/googleapis/synthtool/commit/06e82790dd719a165ad32b8a06f8f6ec3e3cae0f Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:b3500c053313dc34e07b1632ba9e4e589f4f77036a7cf39e1fe8906811ae0fce --- .github/.OwlBot.lock.yaml | 4 ++-- .github/auto-label.yaml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .github/auto-label.yaml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 22cc254..58a0b15 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d -# created: 2022-03-30T23:44:26.560599165Z + digest: sha256:b3500c053313dc34e07b1632ba9e4e589f4f77036a7cf39e1fe8906811ae0fce +# created: 2022-04-01T01:42:03.609279246Z diff --git a/.github/auto-label.yaml b/.github/auto-label.yaml new file mode 100644 index 0000000..09c8d73 --- /dev/null +++ b/.github/auto-label.yaml @@ -0,0 +1,2 @@ +requestsize: + enabled: true From 8411b54dfc37b7bd3d510b9eb767f2474ad6532c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 15:33:26 -0400 Subject: [PATCH 06/13] chore(python): refactor unit / system test dependency install (#74) Source-Link: https://github.com/googleapis/synthtool/commit/993985f0fc4b37152e588f0549bcbdaf34666023 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:1894490910e891a385484514b22eb5133578897eb5b3c380e6d8ad475c6647cd Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 +- noxfile.py | 105 ++++++++++++++++++++++++++++++-------- 2 files changed, 87 insertions(+), 22 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 58a0b15..fa57622 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:b3500c053313dc34e07b1632ba9e4e589f4f77036a7cf39e1fe8906811ae0fce -# created: 2022-04-01T01:42:03.609279246Z + digest: sha256:1894490910e891a385484514b22eb5133578897eb5b3c380e6d8ad475c6647cd +# created: 2022-04-01T15:48:07.524222836Z diff --git a/noxfile.py b/noxfile.py index 3addb4e..6ee5e8a 100644 --- a/noxfile.py +++ b/noxfile.py @@ -20,16 +20,40 @@ import os import pathlib import shutil +import warnings import nox - BLACK_VERSION = "black==22.3.0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" -SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] + UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"] +UNIT_TEST_STANDARD_DEPENDENCIES = [ + "mock", + "asyncmock", + "pytest", + "pytest-cov", + "pytest-asyncio", +] +UNIT_TEST_EXTERNAL_DEPENDENCIES = [] +UNIT_TEST_LOCAL_DEPENDENCIES = [] +UNIT_TEST_DEPENDENCIES = [] +UNIT_TEST_EXTRAS = [] +UNIT_TEST_EXTRAS_BY_PYTHON = {} + +SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] +SYSTEM_TEST_STANDARD_DEPENDENCIES = [ + "mock", + "pytest", + "google-cloud-testutils", +] +SYSTEM_TEST_EXTERNAL_DEPENDENCIES = [] +SYSTEM_TEST_LOCAL_DEPENDENCIES = [] +SYSTEM_TEST_DEPENDENCIES = [] +SYSTEM_TEST_EXTRAS = [] +SYSTEM_TEST_EXTRAS_BY_PYTHON = {} CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -81,23 +105,41 @@ def lint_setup_py(session): session.run("python", "setup.py", "check", "--restructuredtext", "--strict") +def install_unittest_dependencies(session, *constraints): + standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES + session.install(*standard_deps, *constraints) + + if UNIT_TEST_EXTERNAL_DEPENDENCIES: + warnings.warn( + "'unit_test_external_dependencies' is deprecated. Instead, please " + "use 'unit_test_dependencies' or 'unit_test_local_dependencies'.", + DeprecationWarning, + ) + session.install(*UNIT_TEST_EXTERNAL_DEPENDENCIES, *constraints) + + if UNIT_TEST_LOCAL_DEPENDENCIES: + session.install(*UNIT_TEST_LOCAL_DEPENDENCIES, *constraints) + + if UNIT_TEST_EXTRAS_BY_PYTHON: + extras = UNIT_TEST_EXTRAS_BY_PYTHON.get(session.python, []) + elif UNIT_TEST_EXTRAS: + extras = UNIT_TEST_EXTRAS + else: + extras = [] + + if extras: + session.install("-e", f".[{','.join(extras)}]", *constraints) + else: + session.install("-e", ".", *constraints) + + def default(session): # Install all test dependencies, then install this package in-place. constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) - session.install( - "mock", - "asyncmock", - "pytest", - "pytest-cov", - "pytest-asyncio", - "-c", - constraints_path, - ) - - session.install("-e", ".", "-c", constraints_path) + install_unittest_dependencies(session, "-c", constraints_path) # Run py.test against the unit tests. session.run( @@ -121,6 +163,35 @@ def unit(session): default(session) +def install_systemtest_dependencies(session, *constraints): + + # Use pre-release gRPC for system tests. + session.install("--pre", "grpcio") + + session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_EXTERNAL_DEPENDENCIES: + session.install(*SYSTEM_TEST_EXTERNAL_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_LOCAL_DEPENDENCIES: + session.install("-e", *SYSTEM_TEST_LOCAL_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_DEPENDENCIES: + session.install("-e", *SYSTEM_TEST_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_EXTRAS_BY_PYTHON: + extras = SYSTEM_TEST_EXTRAS_BY_PYTHON.get(session.python, []) + elif SYSTEM_TEST_EXTRAS: + extras = SYSTEM_TEST_EXTRAS + else: + extras = [] + + if extras: + session.install("-e", f".[{','.join(extras)}]", *constraints) + else: + session.install("-e", ".", *constraints) + + @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) def system(session): """Run the system test suite.""" @@ -143,13 +214,7 @@ def system(session): if not system_test_exists and not system_test_folder_exists: session.skip("System tests were not found") - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest", "google-cloud-testutils", "-c", constraints_path) - session.install("-e", ".", "-c", constraints_path) + install_systemtest_dependencies(session, "-c", constraints_path) # Run py.test against the system tests. if system_test_exists: From 63f9f940779469fe90b2f01150e1bf4679df7d78 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 6 Apr 2022 06:58:33 -0400 Subject: [PATCH 07/13] chore(python): add license header to auto-label.yaml (#75) Source-Link: https://github.com/googleapis/synthtool/commit/eb78c980b52c7c6746d2edb77d9cf7aaa99a2aab Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- .github/auto-label.yaml | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index fa57622..bc893c9 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:1894490910e891a385484514b22eb5133578897eb5b3c380e6d8ad475c6647cd -# created: 2022-04-01T15:48:07.524222836Z + digest: sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 +# created: 2022-04-06T10:30:21.687684602Z diff --git a/.github/auto-label.yaml b/.github/auto-label.yaml index 09c8d73..41bff0b 100644 --- a/.github/auto-label.yaml +++ b/.github/auto-label.yaml @@ -1,2 +1,15 @@ +# Copyright 2022 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. requestsize: enabled: true From 614c640a224c6fcf0c1fd4656d871b3799508314 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 22:06:13 +0000 Subject: [PATCH 08/13] chore: Use gapic-generator-python 0.65.0 (#78) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 440970084 Source-Link: https://github.com/googleapis/googleapis/commit/5e0a3d57254ab9857ccac77fc6ffade7b69a2dc7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b0c628a3fade768f225d76992791ea1ba2a881be Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjBjNjI4YTNmYWRlNzY4ZjIyNWQ3Njk5Mjc5MWVhMWJhMmE4ODFiZSJ9 docs: fix docstring for map fields --- google/cloud/source_context_v1/types/source_context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/cloud/source_context_v1/types/source_context.py b/google/cloud/source_context_v1/types/source_context.py index f653051..ff49f11 100644 --- a/google/cloud/source_context_v1/types/source_context.py +++ b/google/cloud/source_context_v1/types/source_context.py @@ -101,7 +101,7 @@ class ExtendedSourceContext(proto.Message): Attributes: context (google.cloud.source_context_v1.types.SourceContext): Any source context. - labels (Sequence[google.cloud.source_context_v1.types.ExtendedSourceContext.LabelsEntry]): + labels (Mapping[str, str]): Labels with user defined metadata. """ From 72c5b1d619bd6da740fa6015c99c053635a671df 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 21:03:33 -0400 Subject: [PATCH 09/13] chore(python): add nox session to sort python imports (#80) 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 --- .github/.OwlBot.lock.yaml | 4 +-- docs/conf.py | 2 +- google/cloud/source_context/__init__.py | 18 ++++++------ google/cloud/source_context_v1/__init__.py | 22 ++++++++------- .../source_context_v1/types/source_context.py | 1 - noxfile.py | 28 +++++++++++++++++-- setup.py | 1 - 7 files changed, 49 insertions(+), 27 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index bc893c9..7c454ab 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 -# created: 2022-04-06T10:30:21.687684602Z + digest: sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 +# created: 2022-04-20T23:42:53.970438194Z diff --git a/docs/conf.py b/docs/conf.py index 5b66a25..15d82e6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,9 +24,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys import os import shlex +import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the diff --git a/google/cloud/source_context/__init__.py b/google/cloud/source_context/__init__.py index 3d3e9a0..aa00e35 100644 --- a/google/cloud/source_context/__init__.py +++ b/google/cloud/source_context/__init__.py @@ -15,18 +15,18 @@ # -from google.cloud.source_context_v1.types.source_context import AliasContext -from google.cloud.source_context_v1.types.source_context import CloudRepoSourceContext -from google.cloud.source_context_v1.types.source_context import CloudWorkspaceId from google.cloud.source_context_v1.types.source_context import ( + AliasContext, + CloudRepoSourceContext, + CloudWorkspaceId, CloudWorkspaceSourceContext, + ExtendedSourceContext, + GerritSourceContext, + GitSourceContext, + ProjectRepoId, + RepoId, + SourceContext, ) -from google.cloud.source_context_v1.types.source_context import ExtendedSourceContext -from google.cloud.source_context_v1.types.source_context import GerritSourceContext -from google.cloud.source_context_v1.types.source_context import GitSourceContext -from google.cloud.source_context_v1.types.source_context import ProjectRepoId -from google.cloud.source_context_v1.types.source_context import RepoId -from google.cloud.source_context_v1.types.source_context import SourceContext __all__ = ( "AliasContext", diff --git a/google/cloud/source_context_v1/__init__.py b/google/cloud/source_context_v1/__init__.py index d57f6a5..1deb918 100644 --- a/google/cloud/source_context_v1/__init__.py +++ b/google/cloud/source_context_v1/__init__.py @@ -15,16 +15,18 @@ # -from .types.source_context import AliasContext -from .types.source_context import CloudRepoSourceContext -from .types.source_context import CloudWorkspaceId -from .types.source_context import CloudWorkspaceSourceContext -from .types.source_context import ExtendedSourceContext -from .types.source_context import GerritSourceContext -from .types.source_context import GitSourceContext -from .types.source_context import ProjectRepoId -from .types.source_context import RepoId -from .types.source_context import SourceContext +from .types.source_context import ( + AliasContext, + CloudRepoSourceContext, + CloudWorkspaceId, + CloudWorkspaceSourceContext, + ExtendedSourceContext, + GerritSourceContext, + GitSourceContext, + ProjectRepoId, + RepoId, + SourceContext, +) __all__ = ( "AliasContext", diff --git a/google/cloud/source_context_v1/types/source_context.py b/google/cloud/source_context_v1/types/source_context.py index ff49f11..495b559 100644 --- a/google/cloud/source_context_v1/types/source_context.py +++ b/google/cloud/source_context_v1/types/source_context.py @@ -15,7 +15,6 @@ # import proto # type: ignore - __protobuf__ = proto.module( package="google.devtools.source.v1", manifest={ diff --git a/noxfile.py b/noxfile.py index 6ee5e8a..7c1742d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -17,6 +17,7 @@ # Generated by synthtool. DO NOT EDIT! from __future__ import absolute_import + import os import pathlib import shutil @@ -25,7 +26,8 @@ import nox BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] +ISORT_VERSION = "isort==5.10.1" +LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" @@ -83,7 +85,7 @@ def lint(session): session.run( "black", "--check", - *BLACK_PATHS, + *LINT_PATHS, ) session.run("flake8", "google", "tests") @@ -94,7 +96,27 @@ def blacken(session): session.install(BLACK_VERSION) session.run( "black", - *BLACK_PATHS, + *LINT_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def format(session): + """ + Run isort to sort imports. Then run black + to format code to uniform standard. + """ + session.install(BLACK_VERSION, ISORT_VERSION) + # 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", + *LINT_PATHS, + ) + session.run( + "black", + *LINT_PATHS, ) diff --git a/setup.py b/setup.py index 3d7cbc8..196312e 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,6 @@ import setuptools - name = "google-cloud-source-context" description = "Python client for Source Context" version = "1.2.2" From 90c1e25682df2b5a05d1a2e4223d9204aeb781dc Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 12:16:13 -0400 Subject: [PATCH 10/13] chore(python): use ubuntu 22.04 in docs image (#82) Source-Link: https://github.com/googleapis/synthtool/commit/f15cc72fb401b4861cedebb10af74afe428fb1f8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- .kokoro/docker/docs/Dockerfile | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 7c454ab..64f82d6 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 -# created: 2022-04-20T23:42:53.970438194Z + digest: sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd +# created: 2022-04-21T15:43:16.246106921Z diff --git a/.kokoro/docker/docs/Dockerfile b/.kokoro/docker/docs/Dockerfile index 4e1b1fb..238b87b 100644 --- a/.kokoro/docker/docs/Dockerfile +++ b/.kokoro/docker/docs/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ubuntu:20.04 +from ubuntu:22.04 ENV DEBIAN_FRONTEND noninteractive @@ -60,8 +60,24 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && rm -f /var/cache/apt/archives/*.deb +###################### Install python 3.8.11 + +# Download python 3.8.11 +RUN wget https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tgz + +# Extract files +RUN tar -xvf Python-3.8.11.tgz + +# Install python 3.8.11 +RUN ./Python-3.8.11/configure --enable-optimizations +RUN make altinstall + +###################### Install pip RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3.8 /tmp/get-pip.py \ + && python3 /tmp/get-pip.py \ && rm /tmp/get-pip.py +# Test pip +RUN python3 -m pip + CMD ["python3.8"] From 7025e095b6560d54a127181414046ef42146b97f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 12:23:14 -0400 Subject: [PATCH 11/13] chore: [autoapprove] update readme_gen.py to include autoescape True (#83) Source-Link: https://github.com/googleapis/synthtool/commit/6b4d5a6407d740beb4158b302194a62a4108a8a6 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- scripts/readme-gen/readme_gen.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 64f82d6..b631901 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd -# created: 2022-04-21T15:43:16.246106921Z + digest: sha256:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 +# created: 2022-05-05T15:17:27.599381182Z diff --git a/scripts/readme-gen/readme_gen.py b/scripts/readme-gen/readme_gen.py index d309d6e..91b5967 100644 --- a/scripts/readme-gen/readme_gen.py +++ b/scripts/readme-gen/readme_gen.py @@ -28,7 +28,10 @@ jinja_env = jinja2.Environment( trim_blocks=True, loader=jinja2.FileSystemLoader( - os.path.abspath(os.path.join(os.path.dirname(__file__), 'templates')))) + os.path.abspath(os.path.join(os.path.dirname(__file__), "templates")) + ), + autoescape=True, +) README_TMPL = jinja_env.get_template('README.tmpl.rst') From d2ecc987f13d884288ce80e533eca80f2827b886 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 23:40:12 +0000 Subject: [PATCH 12/13] chore(python): auto approve template changes (#85) Source-Link: https://github.com/googleapis/synthtool/commit/453a5d9c9a55d1969240a37d36cec626d20a9024 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 --- .github/.OwlBot.lock.yaml | 4 ++-- .github/auto-approve.yml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .github/auto-approve.yml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index b631901..757c9dc 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 -# created: 2022-05-05T15:17:27.599381182Z + digest: sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 +# created: 2022-05-05T22:08:23.383410683Z diff --git a/.github/auto-approve.yml b/.github/auto-approve.yml new file mode 100644 index 0000000..311ebbb --- /dev/null +++ b/.github/auto-approve.yml @@ -0,0 +1,3 @@ +# https://github.com/googleapis/repo-automation-bots/tree/main/packages/auto-approve +processes: + - "OwlBotTemplateChanges" From b6cc52dfb3039b530bd6b3d1249730bbaabe01e8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 19 May 2022 08:34:11 -0400 Subject: [PATCH 13/13] chore(main): release 1.2.3 (#79) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b50a6b5..73b95f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.2.3](https://github.com/googleapis/python-source-context/compare/v1.2.2...v1.2.3) (2022-05-05) + + +### Documentation + +* fix docstring for map fields ([614c640](https://github.com/googleapis/python-source-context/commit/614c640a224c6fcf0c1fd4656d871b3799508314)) + ### [1.2.2](https://github.com/googleapis/python-source-context/compare/v1.2.1...v1.2.2) (2022-03-05) diff --git a/setup.py b/setup.py index 196312e..ee26467 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ name = "google-cloud-source-context" description = "Python client for Source Context" -version = "1.2.2" +version = "1.2.3" release_status = "Development Status :: 5 - Production/Stable" url = "https://github.com/googleapis/python-source-context" dependencies = [