From ff8e0c3086bd917e2f29476f4e28aeefbaa0200b Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Tue, 22 Mar 2022 17:55:03 -0600 Subject: [PATCH 1/6] chore: set up CI on v1 branch (#249) * chore: add basic CI for v1 branch * chore: remove docfx, lower fail-under --- .github/workflows/docs.yml | 22 +++++++++++++ .github/workflows/lint.yml | 25 +++++++++++++++ .github/workflows/unittest.yml | 57 ++++++++++++++++++++++++++++++++++ .kokoro/release.sh | 4 +-- .kokoro/release/common.cfg | 34 +++----------------- 5 files changed, 111 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/unittest.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..b824108d --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,22 @@ +on: + pull_request: + branches: + - v1 +name: docs +jobs: + docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.8" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run docs + run: | + nox -s docs \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..bc3bfb53 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +on: + pull_request: + branches: + - v1 +name: lint +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.8" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run lint + run: | + nox -s lint + - name: Run lint_setup_py + run: | + nox -s lint_setup_py diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml new file mode 100644 index 00000000..8fba90d2 --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,57 @@ +on: + pull_request: + branches: + - v1 +name: unittest +jobs: + unit: + runs-on: ubuntu-latest + strategy: + matrix: + python: ['3.6', '3.7', '3.8'] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python }} + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run unit tests + env: + COVERAGE_FILE: .coverage-${{ matrix.python }} + run: | + nox -s unit-${{ matrix.python }} + - name: Upload coverage results + uses: actions/upload-artifact@v3 + with: + name: coverage-artifacts + path: .coverage-${{ matrix.python }} + + cover: + runs-on: ubuntu-latest + needs: + - unit + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.8" + - name: Install coverage + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install coverage + - name: Download coverage results + uses: actions/download-artifact@v3 + with: + name: coverage-artifacts + path: .coverage-results/ + - name: Report coverage results + run: | + coverage combine .coverage-results/.coverage* + coverage report --show-missing --fail-under=65 diff --git a/.kokoro/release.sh b/.kokoro/release.sh index e0fb9e49..17105357 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -26,7 +26,7 @@ python3 -m pip install --upgrade twine wheel setuptools export PYTHONUNBUFFERED=1 # Move into the package, build the distribution and upload. -TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google_cloud_pypi_password") +TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1") cd github/python-cloudbuild python3 setup.py sdist bdist_wheel -twine upload --username gcloudpypi --password "${TWINE_PASSWORD}" dist/* +twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/* diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index dfcae22e..1f35bece 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -23,42 +23,18 @@ env_vars: { value: "github/python-cloudbuild/.kokoro/release.sh" } -# Fetch the token needed for reporting release status to GitHub -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "yoshi-automation-github-key" - } - } -} - # Fetch PyPI password before_action { fetch_keystore { keystore_resource { keystore_config_id: 73713 - keyname: "google_cloud_pypi_password" + keyname: "google-cloud-pypi-token-keystore-1" } } } -# Fetch magictoken to use with Magic Github Proxy -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "releasetool-magictoken" - } - } -} - -# Fetch api key to use with Magic Github Proxy -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "magic-github-proxy-api-key" - } - } +# Tokens needed to report release status back to GitHub +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" } From d65eed3e041d306caf657b2235a72f774355af6f Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Thu, 24 Mar 2022 12:38:04 -0600 Subject: [PATCH 2/6] fix(deps): require google-api-core >= 1.31.5, >= 2.3.2 on v1 release (#245) * chore(deps): allow google-api-core v2 on v1 release * ci: run unittest/lint/docs as gh actions * ci: set coverage to 65% Co-authored-by: Anthonios Partheniou --- .github/workflows/docs.yml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b824108d..0ad1c7d2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -19,4 +19,4 @@ jobs: python -m pip install nox - name: Run docs run: | - nox -s docs \ No newline at end of file + nox -s docs diff --git a/setup.py b/setup.py index a28c17fc..91fc1a79 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ # 'Development Status :: 5 - Production/Stable' release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 1.14.0, < 2.0.0dev", + "google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0", 'enum34; python_version < "3.4"', ] From 961b3ea849a308abe7668ee56e42a4e57dd8298f Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Sun, 3 Apr 2022 17:56:31 -0600 Subject: [PATCH 3/6] chore: use newer black (#256) --- .gitignore | 1 + docs/conf.py | 17 ++- .../cloudbuild_v1/gapic/cloud_build_client.py | 70 ++++++--- .../cloudbuild_v1/proto/cloudbuild_pb2.py | 42 ++++-- .../proto/cloudbuild_pb2_grpc.py | 136 +++++++++--------- noxfile.py | 20 ++- 6 files changed, 176 insertions(+), 110 deletions(-) diff --git a/.gitignore b/.gitignore index b87e1ed5..d388728f 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ pip-log.txt .nox .cache .pytest_cache +*_sponge_log.xml # Mac diff --git a/docs/conf.py b/docs/conf.py index 2d0ebebb..99e23e6d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -62,9 +62,9 @@ master_doc = "index" # General information about the project. -project = u"google-cloud-build" -copyright = u"2019, Google" -author = u"Google APIs" +project = "google-cloud-build" +copyright = "2019, Google" +author = "Google APIs" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -258,7 +258,7 @@ ( master_doc, "google-cloud-build.tex", - u"google-cloud-build Documentation", + "google-cloud-build Documentation", author, "manual", ) @@ -293,7 +293,7 @@ ( master_doc, "google-cloud-build", - u"google-cloud-build Documentation", + "google-cloud-build Documentation", [author], 1, ) @@ -312,7 +312,7 @@ ( master_doc, "google-cloud-build", - u"google-cloud-build Documentation", + "google-cloud-build Documentation", author, "google-cloud-build", "google-cloud-build Library", @@ -337,7 +337,10 @@ intersphinx_mapping = { "python": ("http://python.readthedocs.org/en/latest/", None), "google-auth": ("https://google-auth.readthedocs.io/en/stable", 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.io/grpc/python/", None), } diff --git a/google/cloud/devtools/cloudbuild_v1/gapic/cloud_build_client.py b/google/cloud/devtools/cloudbuild_v1/gapic/cloud_build_client.py index 455bf095..9e2933ed 100644 --- a/google/cloud/devtools/cloudbuild_v1/gapic/cloud_build_client.py +++ b/google/cloud/devtools/cloudbuild_v1/gapic/cloud_build_client.py @@ -43,7 +43,9 @@ from google.protobuf import empty_pb2 -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-build",).version +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( + "google-cloud-build", +).version class CloudBuildClient(object): @@ -172,7 +174,9 @@ def __init__( self.transport = transport else: self.transport = cloud_build_grpc_transport.CloudBuildGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials, + address=api_endpoint, + channel=channel, + credentials=credentials, ) if client_info is None: @@ -277,7 +281,9 @@ def list_builds( ) request = cloudbuild_pb2.ListBuildsRequest( - project_id=project_id, page_size=page_size, filter=filter_, + project_id=project_id, + page_size=page_size, + filter=filter_, ) if metadata is None: metadata = [] @@ -364,7 +370,8 @@ def delete_build_trigger( ) request = cloudbuild_pb2.DeleteBuildTriggerRequest( - project_id=project_id, trigger_id=trigger_id, + project_id=project_id, + trigger_id=trigger_id, ) self._inner_api_calls["delete_build_trigger"]( request, retry=retry, timeout=timeout, metadata=metadata @@ -443,7 +450,10 @@ def create_build( client_info=self._client_info, ) - request = cloudbuild_pb2.CreateBuildRequest(project_id=project_id, build=build,) + request = cloudbuild_pb2.CreateBuildRequest( + project_id=project_id, + build=build, + ) if metadata is None: metadata = [] metadata = list(metadata) @@ -527,7 +537,10 @@ def get_build( client_info=self._client_info, ) - request = cloudbuild_pb2.GetBuildRequest(project_id=project_id, id=id_,) + request = cloudbuild_pb2.GetBuildRequest( + project_id=project_id, + id=id_, + ) return self._inner_api_calls["get_build"]( request, retry=retry, timeout=timeout, metadata=metadata ) @@ -589,7 +602,10 @@ def cancel_build( client_info=self._client_info, ) - request = cloudbuild_pb2.CancelBuildRequest(project_id=project_id, id=id_,) + request = cloudbuild_pb2.CancelBuildRequest( + project_id=project_id, + id=id_, + ) return self._inner_api_calls["cancel_build"]( request, retry=retry, timeout=timeout, metadata=metadata ) @@ -687,7 +703,10 @@ def retry_build( client_info=self._client_info, ) - request = cloudbuild_pb2.RetryBuildRequest(project_id=project_id, id=id_,) + request = cloudbuild_pb2.RetryBuildRequest( + project_id=project_id, + id=id_, + ) operation = self._inner_api_calls["retry_build"]( request, retry=retry, timeout=timeout, metadata=metadata ) @@ -761,7 +780,8 @@ def create_build_trigger( ) request = cloudbuild_pb2.CreateBuildTriggerRequest( - project_id=project_id, trigger=trigger, + project_id=project_id, + trigger=trigger, ) if metadata is None: metadata = [] @@ -841,7 +861,8 @@ def get_build_trigger( ) request = cloudbuild_pb2.GetBuildTriggerRequest( - project_id=project_id, trigger_id=trigger_id, + project_id=project_id, + trigger_id=trigger_id, ) return self._inner_api_calls["get_build_trigger"]( request, retry=retry, timeout=timeout, metadata=metadata @@ -923,7 +944,8 @@ def list_build_triggers( ) request = cloudbuild_pb2.ListBuildTriggersRequest( - project_id=project_id, page_size=page_size, + project_id=project_id, + page_size=page_size, ) if metadata is None: metadata = [] @@ -1021,7 +1043,9 @@ def update_build_trigger( ) request = cloudbuild_pb2.UpdateBuildTriggerRequest( - project_id=project_id, trigger_id=trigger_id, trigger=trigger, + project_id=project_id, + trigger_id=trigger_id, + trigger=trigger, ) return self._inner_api_calls["update_build_trigger"]( request, retry=retry, timeout=timeout, metadata=metadata @@ -1102,7 +1126,9 @@ def run_build_trigger( ) request = cloudbuild_pb2.RunBuildTriggerRequest( - project_id=project_id, trigger_id=trigger_id, source=source, + project_id=project_id, + trigger_id=trigger_id, + source=source, ) operation = self._inner_api_calls["run_build_trigger"]( request, retry=retry, timeout=timeout, metadata=metadata @@ -1172,7 +1198,8 @@ def create_worker_pool( ) request = cloudbuild_pb2.CreateWorkerPoolRequest( - parent=parent, worker_pool=worker_pool, + parent=parent, + worker_pool=worker_pool, ) return self._inner_api_calls["create_worker_pool"]( request, retry=retry, timeout=timeout, metadata=metadata @@ -1230,7 +1257,9 @@ def get_worker_pool( client_info=self._client_info, ) - request = cloudbuild_pb2.GetWorkerPoolRequest(name=name,) + request = cloudbuild_pb2.GetWorkerPoolRequest( + name=name, + ) return self._inner_api_calls["get_worker_pool"]( request, retry=retry, timeout=timeout, metadata=metadata ) @@ -1284,7 +1313,9 @@ def delete_worker_pool( client_info=self._client_info, ) - request = cloudbuild_pb2.DeleteWorkerPoolRequest(name=name,) + request = cloudbuild_pb2.DeleteWorkerPoolRequest( + name=name, + ) self._inner_api_calls["delete_worker_pool"]( request, retry=retry, timeout=timeout, metadata=metadata ) @@ -1347,7 +1378,8 @@ def update_worker_pool( ) request = cloudbuild_pb2.UpdateWorkerPoolRequest( - name=name, worker_pool=worker_pool, + name=name, + worker_pool=worker_pool, ) return self._inner_api_calls["update_worker_pool"]( request, retry=retry, timeout=timeout, metadata=metadata @@ -1404,7 +1436,9 @@ def list_worker_pools( client_info=self._client_info, ) - request = cloudbuild_pb2.ListWorkerPoolsRequest(parent=parent,) + request = cloudbuild_pb2.ListWorkerPoolsRequest( + parent=parent, + ) return self._inner_api_calls["list_worker_pools"]( request, retry=retry, timeout=timeout, metadata=metadata ) diff --git a/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2.py b/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2.py index 573dd9a1..b194706d 100644 --- a/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2.py +++ b/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2.py @@ -928,7 +928,9 @@ ), ], extensions=[], - nested_types=[_REPOSOURCE_SUBSTITUTIONSENTRY,], + nested_types=[ + _REPOSOURCE_SUBSTITUTIONSENTRY, + ], enum_types=[], serialized_options=None, is_extendable=False, @@ -2187,8 +2189,13 @@ ), ], extensions=[], - nested_types=[_BUILD_SUBSTITUTIONSENTRY, _BUILD_TIMINGENTRY,], - enum_types=[_BUILD_STATUS,], + nested_types=[ + _BUILD_SUBSTITUTIONSENTRY, + _BUILD_TIMINGENTRY, + ], + enum_types=[ + _BUILD_STATUS, + ], serialized_options=None, is_extendable=False, syntax="proto3", @@ -2325,7 +2332,9 @@ ), ], extensions=[], - nested_types=[_ARTIFACTS_ARTIFACTOBJECTS,], + nested_types=[ + _ARTIFACTS_ARTIFACTOBJECTS, + ], enum_types=[], serialized_options=None, is_extendable=False, @@ -2564,7 +2573,9 @@ ), ], extensions=[], - nested_types=[_SOURCEPROVENANCE_FILEHASHESENTRY,], + nested_types=[ + _SOURCEPROVENANCE_FILEHASHESENTRY, + ], enum_types=[], serialized_options=None, is_extendable=False, @@ -2666,7 +2677,9 @@ ], extensions=[], nested_types=[], - enum_types=[_HASH_HASHTYPE,], + enum_types=[ + _HASH_HASHTYPE, + ], serialized_options=None, is_extendable=False, syntax="proto3", @@ -2784,7 +2797,9 @@ ), ], extensions=[], - nested_types=[_SECRET_SECRETENVENTRY,], + nested_types=[ + _SECRET_SECRETENVENTRY, + ], enum_types=[], serialized_options=None, is_extendable=False, @@ -3450,7 +3465,9 @@ ), ], extensions=[], - nested_types=[_BUILDTRIGGER_SUBSTITUTIONSENTRY,], + nested_types=[ + _BUILDTRIGGER_SUBSTITUTIONSENTRY, + ], enum_types=[], serialized_options=None, is_extendable=False, @@ -3665,7 +3682,9 @@ ], extensions=[], nested_types=[], - enum_types=[_PULLREQUESTFILTER_COMMENTCONTROL,], + enum_types=[ + _PULLREQUESTFILTER_COMMENTCONTROL, + ], serialized_options=None, is_extendable=False, syntax="proto3", @@ -4609,7 +4628,10 @@ ], extensions=[], nested_types=[], - enum_types=[_WORKERPOOL_REGION, _WORKERPOOL_STATUS,], + enum_types=[ + _WORKERPOOL_REGION, + _WORKERPOOL_STATUS, + ], serialized_options=None, is_extendable=False, syntax="proto3", diff --git a/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2_grpc.py b/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2_grpc.py index 215b18c9..ff493547 100644 --- a/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2_grpc.py +++ b/google/cloud/devtools/cloudbuild_v1/proto/cloudbuild_pb2_grpc.py @@ -13,20 +13,20 @@ class CloudBuildStub(object): """Creates and manages builds on Google Cloud Platform. - The main concept used by this API is a `Build`, which describes the location - of the source to build, how to build the source, and where to store the - built artifacts, if any. + The main concept used by this API is a `Build`, which describes the location + of the source to build, how to build the source, and where to store the + built artifacts, if any. - A user can list previously-requested builds or get builds by their ID to - determine the status of the build. - """ + A user can list previously-requested builds or get builds by their ID to + determine the status of the build. + """ def __init__(self, channel): """Constructor. - Args: - channel: A grpc.Channel. - """ + Args: + channel: A grpc.Channel. + """ self.CreateBuild = channel.unary_unary( "/google.devtools.cloudbuild.v1.CloudBuild/CreateBuild", request_serializer=google_dot_cloud_dot_devtools_dot_cloudbuild__v1_dot_proto_dot_cloudbuild__pb2.CreateBuildRequest.SerializeToString, @@ -112,21 +112,21 @@ def __init__(self, channel): class CloudBuildServicer(object): """Creates and manages builds on Google Cloud Platform. - The main concept used by this API is a `Build`, which describes the location - of the source to build, how to build the source, and where to store the - built artifacts, if any. + The main concept used by this API is a `Build`, which describes the location + of the source to build, how to build the source, and where to store the + built artifacts, if any. - A user can list previously-requested builds or get builds by their ID to - determine the status of the build. - """ + A user can list previously-requested builds or get builds by their ID to + determine the status of the build. + """ def CreateBuild(self, request, context): """Starts a build with the specified configuration. - This method returns a long-running `Operation`, which includes the build - ID. Pass the build ID to `GetBuild` to determine the build status (such as - `SUCCESS` or `FAILURE`). - """ + This method returns a long-running `Operation`, which includes the build + ID. Pass the build ID to `GetBuild` to determine the build status (such as + `SUCCESS` or `FAILURE`). + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") @@ -134,9 +134,9 @@ def CreateBuild(self, request, context): def GetBuild(self, request, context): """Returns information about a previously requested build. - The `Build` that is returned includes its status (such as `SUCCESS`, - `FAILURE`, or `WORKING`), and timing information. - """ + The `Build` that is returned includes its status (such as `SUCCESS`, + `FAILURE`, or `WORKING`), and timing information. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") @@ -144,16 +144,15 @@ def GetBuild(self, request, context): def ListBuilds(self, request, context): """Lists previously requested builds. - Previously requested builds may still be in-progress, or may have finished - successfully or unsuccessfully. - """ + Previously requested builds may still be in-progress, or may have finished + successfully or unsuccessfully. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def CancelBuild(self, request, context): - """Cancels a build in progress. - """ + """Cancels a build in progress.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") @@ -161,32 +160,32 @@ def CancelBuild(self, request, context): def RetryBuild(self, request, context): """Creates a new build based on the specified build. - This method creates a new build using the original build request, which may - or may not result in an identical build. + This method creates a new build using the original build request, which may + or may not result in an identical build. - For triggered builds: + For triggered builds: - * Triggered builds resolve to a precise revision; therefore a retry of a - triggered build will result in a build that uses the same revision. + * Triggered builds resolve to a precise revision; therefore a retry of a + triggered build will result in a build that uses the same revision. - For non-triggered builds that specify `RepoSource`: + For non-triggered builds that specify `RepoSource`: - * If the original build built from the tip of a branch, the retried build - will build from the tip of that branch, which may not be the same revision - as the original build. - * If the original build specified a commit sha or revision ID, the retried - build will use the identical source. + * If the original build built from the tip of a branch, the retried build + will build from the tip of that branch, which may not be the same revision + as the original build. + * If the original build specified a commit sha or revision ID, the retried + build will use the identical source. - For builds that specify `StorageSource`: + For builds that specify `StorageSource`: - * If the original build pulled source from Google Cloud Storage without - specifying the generation of the object, the new build will use the current - object, which may be different from the original build source. - * If the original build pulled source from Cloud Storage and specified the - generation of the object, the new build will attempt to use the same - object, which may or may not be available depending on the bucket's - lifecycle management settings. - """ + * If the original build pulled source from Google Cloud Storage without + specifying the generation of the object, the new build will use the current + object, which may be different from the original build source. + * If the original build pulled source from Cloud Storage and specified the + generation of the object, the new build will attempt to use the same + object, which may or may not be available depending on the bucket's + lifecycle management settings. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") @@ -194,8 +193,8 @@ def RetryBuild(self, request, context): def CreateBuildTrigger(self, request, context): """Creates a new `BuildTrigger`. - This API is experimental. - """ + This API is experimental. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") @@ -203,8 +202,8 @@ def CreateBuildTrigger(self, request, context): def GetBuildTrigger(self, request, context): """Returns information about a `BuildTrigger`. - This API is experimental. - """ + This API is experimental. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") @@ -212,8 +211,8 @@ def GetBuildTrigger(self, request, context): def ListBuildTriggers(self, request, context): """Lists existing `BuildTrigger`s. - This API is experimental. - """ + This API is experimental. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") @@ -221,8 +220,8 @@ def ListBuildTriggers(self, request, context): def DeleteBuildTrigger(self, request, context): """Deletes a `BuildTrigger` by its project ID and trigger ID. - This API is experimental. - """ + This API is experimental. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") @@ -230,15 +229,14 @@ def DeleteBuildTrigger(self, request, context): def UpdateBuildTrigger(self, request, context): """Updates a `BuildTrigger` by its project ID and trigger ID. - This API is experimental. - """ + This API is experimental. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def RunBuildTrigger(self, request, context): - """Runs a `BuildTrigger` at a particular source revision. - """ + """Runs a `BuildTrigger` at a particular source revision.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") @@ -246,8 +244,8 @@ def RunBuildTrigger(self, request, context): def CreateWorkerPool(self, request, context): """Creates a `WorkerPool` to run the builds, and returns the new worker pool. - This API is experimental. - """ + This API is experimental. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") @@ -255,8 +253,8 @@ def CreateWorkerPool(self, request, context): def GetWorkerPool(self, request, context): """Returns information about a `WorkerPool`. - This API is experimental. - """ + This API is experimental. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") @@ -264,8 +262,8 @@ def GetWorkerPool(self, request, context): def DeleteWorkerPool(self, request, context): """Deletes a `WorkerPool` by its project ID and WorkerPool name. - This API is experimental. - """ + This API is experimental. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") @@ -273,8 +271,8 @@ def DeleteWorkerPool(self, request, context): def UpdateWorkerPool(self, request, context): """Update a `WorkerPool`. - This API is experimental. - """ + This API is experimental. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") @@ -282,8 +280,8 @@ def UpdateWorkerPool(self, request, context): def ListWorkerPools(self, request, context): """List project's `WorkerPool`s. - This API is experimental. - """ + This API is experimental. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") diff --git a/noxfile.py b/noxfile.py index 348438e0..ad96fbad 100644 --- a/noxfile.py +++ b/noxfile.py @@ -23,13 +23,16 @@ 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" SYSTEM_TEST_PYTHON_VERSIONS = ["2.7", "3.8"] UNIT_TEST_PYTHON_VERSIONS = ["2.7", "3.5", "3.6", "3.7", "3.8"] +# Error if a python version is missing +nox.options.error_on_missing_interpreters = True + @nox.session(python=DEFAULT_PYTHON_VERSION) def lint(session): @@ -40,12 +43,14 @@ def lint(session): """ session.install("flake8", BLACK_VERSION) session.run( - "black", "--check", *BLACK_PATHS, + "black", + "--check", + *BLACK_PATHS, ) session.run("flake8", "google", "tests") -@nox.session(python="3.6") +@nox.session(python=DEFAULT_PYTHON_VERSION) def blacken(session): """Run black. @@ -57,7 +62,8 @@ def blacken(session): """ session.install(BLACK_VERSION) session.run( - "black", *BLACK_PATHS, + "black", + *BLACK_PATHS, ) @@ -116,7 +122,9 @@ def system(session): # Install all test dependencies, then install this package into the # virtualenv's dist-packages. session.install( - "mock", "pytest", "google-cloud-testutils", + "mock", + "pytest", + "google-cloud-testutils", ) session.install("-e", ".") @@ -145,7 +153,7 @@ def docs(session): """Build the docs for this library.""" session.install("-e", ".") - session.install("sphinx<3.0.0", "alabaster", "recommonmark") + session.install("sphinx<3.0.0", "alabaster", "recommonmark", "Jinja2<3.1") shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( From 780b662bae01c56756a1bfc692408b9e416a1522 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 4 Apr 2022 09:17:40 -0600 Subject: [PATCH 4/6] chore(v1): release 1.1.1 (#257) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75772907..8f920c35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-build/#history +### [1.1.1](https://github.com/googleapis/python-cloudbuild/compare/v1.1.0...v1.1.1) (2022-04-04) + + +### Bug Fixes + +* **deps:** require google-api-core >= 1.31.5, >= 2.3.2 on v1 release ([#245](https://github.com/googleapis/python-cloudbuild/issues/245)) ([d65eed3](https://github.com/googleapis/python-cloudbuild/commit/d65eed3e041d306caf657b2235a72f774355af6f)) + ## [1.1.0](https://www.github.com/googleapis/python-cloudbuild/compare/v1.0.0...v1.1.0) (2020-06-30) diff --git a/setup.py b/setup.py index 91fc1a79..2b10d50a 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ name = "google-cloud-build" description = "Google Cloud Build API client library" -version = "1.1.0" +version = "1.1.1" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta' From 04808730c87b54cb93a848810b60c82d90b1a8eb Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Tue, 7 Jun 2022 19:14:02 -0400 Subject: [PATCH 5/6] fix(deps): require protobuf<4.0.0 on v1 branch (#298) --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 2b10d50a..a69cb8c4 100644 --- a/setup.py +++ b/setup.py @@ -30,6 +30,7 @@ dependencies = [ "google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0", 'enum34; python_version < "3.4"', + "protobuf<4.0.0dev", ] package_root = os.path.abspath(os.path.dirname(__file__)) From 518a2b1affcd85da5c3a386b40c6b60427eadadd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 9 Jun 2022 10:41:35 -0400 Subject: [PATCH 6/6] chore(v1): release 1.1.2 (#301) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f920c35..7b56cde6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-build/#history +## [1.1.2](https://github.com/googleapis/python-cloudbuild/compare/v1.1.1...v1.1.2) (2022-06-07) + + +### Bug Fixes + +* **deps:** require protobuf<4.0.0 on v1 branch ([#298](https://github.com/googleapis/python-cloudbuild/issues/298)) ([0480873](https://github.com/googleapis/python-cloudbuild/commit/04808730c87b54cb93a848810b60c82d90b1a8eb)) + ### [1.1.1](https://github.com/googleapis/python-cloudbuild/compare/v1.1.0...v1.1.1) (2022-04-04) diff --git a/setup.py b/setup.py index a69cb8c4..8fac63e3 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ name = "google-cloud-build" description = "Google Cloud Build API client library" -version = "1.1.1" +version = "1.1.2" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta'