From 29348e84fea9b598c4bfa172f3888bde983cc6e0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 27 Apr 2022 15:36:34 +0200 Subject: [PATCH 1/9] chore(deps): update dependency google-cloud-optimization to v1 (#35) --- samples/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index 764b6dd..20d7a05 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-optimization==0.1.1 +google-cloud-optimization==1.0.0 google-cloud-storage==2.3.0 From cfe32238a2983f3c38ad1cf9d4531af1477112f6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 28 Apr 2022 08:11:41 -0400 Subject: [PATCH 2/9] chore: use gapic-generator-python 0.65.2 (#34) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 0.65.2 PiperOrigin-RevId: 444333013 Source-Link: https://github.com/googleapis/googleapis/commit/f91b6cf82e929280f6562f6110957c654bd9e2e6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/16eb36095c294e712c74a1bf23550817b42174e5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTZlYjM2MDk1YzI5NGU3MTJjNzRhMWJmMjM1NTA4MTdiNDIxNzRlNSJ9 * 🦉 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 --- .../services/fleet_routing/async_client.py | 12 ++++++------ .../gapic/optimization_v1/test_fleet_routing.py | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/google/cloud/optimization_v1/services/fleet_routing/async_client.py b/google/cloud/optimization_v1/services/fleet_routing/async_client.py index 9733d84..02c0e5b 100644 --- a/google/cloud/optimization_v1/services/fleet_routing/async_client.py +++ b/google/cloud/optimization_v1/services/fleet_routing/async_client.py @@ -250,9 +250,9 @@ async def optimize_tours( from google.cloud import optimization_v1 - def sample_optimize_tours(): + async def sample_optimize_tours(): # Create a client - client = optimization_v1.FleetRoutingClient() + client = optimization_v1.FleetRoutingAsyncClient() # Initialize request argument(s) request = optimization_v1.OptimizeToursRequest( @@ -260,7 +260,7 @@ def sample_optimize_tours(): ) # Make the request - response = client.optimize_tours(request=request) + response = await client.optimize_tours(request=request) # Handle the response print(response) @@ -346,9 +346,9 @@ async def batch_optimize_tours( from google.cloud import optimization_v1 - def sample_batch_optimize_tours(): + async def sample_batch_optimize_tours(): # Create a client - client = optimization_v1.FleetRoutingClient() + client = optimization_v1.FleetRoutingAsyncClient() # Initialize request argument(s) model_configs = optimization_v1.AsyncModelConfig() @@ -365,7 +365,7 @@ def sample_batch_optimize_tours(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/tests/unit/gapic/optimization_v1/test_fleet_routing.py b/tests/unit/gapic/optimization_v1/test_fleet_routing.py index cc06eb2..095676b 100644 --- a/tests/unit/gapic/optimization_v1/test_fleet_routing.py +++ b/tests/unit/gapic/optimization_v1/test_fleet_routing.py @@ -742,7 +742,7 @@ def test_optimize_tours_field_headers(): # a field header. Set these to a non-empty value. request = fleet_routing.OptimizeToursRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.optimize_tours), "__call__") as call: @@ -758,7 +758,7 @@ def test_optimize_tours_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -772,7 +772,7 @@ async def test_optimize_tours_field_headers_async(): # a field header. Set these to a non-empty value. request = fleet_routing.OptimizeToursRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.optimize_tours), "__call__") as call: @@ -790,7 +790,7 @@ async def test_optimize_tours_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -893,7 +893,7 @@ def test_batch_optimize_tours_field_headers(): # a field header. Set these to a non-empty value. request = fleet_routing.BatchOptimizeToursRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -911,7 +911,7 @@ def test_batch_optimize_tours_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -925,7 +925,7 @@ async def test_batch_optimize_tours_field_headers_async(): # a field header. Set these to a non-empty value. request = fleet_routing.BatchOptimizeToursRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -945,7 +945,7 @@ async def test_batch_optimize_tours_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] From eef41429da6ec655b6afd3fe447673148d203738 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 11:58:19 -0400 Subject: [PATCH 3/9] chore: [autoapprove] update readme_gen.py to include autoescape True (#36) 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 94955feeb513fb5d6dfcf139a495ec4cc958f7e6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 6 May 2022 00:00:19 +0000 Subject: [PATCH 4/9] chore(python): auto approve template changes (#38) 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 fa362acbff15cf1de9b3a8844e1442012238f3c4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 30 May 2022 17:46:26 +0000 Subject: [PATCH 5/9] chore: use gapic-generator-python 1.0.0 (#39) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 451250442 Source-Link: https://github.com/googleapis/googleapis/commit/cca5e8181f6442b134e8d4d206fbe9e0e74684ba Source-Link: https://github.com/googleapis/googleapis-gen/commit/0b219da161a8bdcc3c6f7b2efcd82105182a30ca Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGIyMTlkYTE2MWE4YmRjYzNjNmY3YjJlZmNkODIxMDUxODJhMzBjYSJ9 --- tests/unit/gapic/optimization_v1/test_fleet_routing.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/unit/gapic/optimization_v1/test_fleet_routing.py b/tests/unit/gapic/optimization_v1/test_fleet_routing.py index 095676b..185935f 100644 --- a/tests/unit/gapic/optimization_v1/test_fleet_routing.py +++ b/tests/unit/gapic/optimization_v1/test_fleet_routing.py @@ -14,7 +14,13 @@ # limitations under the License. # import os -import mock + +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock import grpc from grpc.experimental import aio From 443a8302dbfbb9785d1072d1e1c223677842b6dc Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 3 Jun 2022 09:56:53 -0400 Subject: [PATCH 6/9] chore: test minimum dependencies in python 3.7 (#41) --- testing/constraints-3.7.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt index e69de29..be5a64f 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -0,0 +1,8 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file. +# Pin the version to the lower bound. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.31.5 +proto-plus==1.15.0 From d1feb935cbe4ed15588adf165988cc74fcdb0a73 Mon Sep 17 00:00:00 2001 From: Dan Lee <71398022+dandhlee@users.noreply.github.com> Date: Tue, 7 Jun 2022 08:40:24 -0400 Subject: [PATCH 7/9] docs: fix changelog header to consistent size (#40) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd22f6e..c5ed579 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ * bump release level to production/stable ([#31](https://github.com/googleapis/python-optimization/issues/31)) ([dd9377f](https://github.com/googleapis/python-optimization/commit/dd9377f24b3e1ffcaee7c23c72872696bbaa6a20)) -### [0.1.1](https://github.com/googleapis/python-optimization/compare/v0.1.0...v0.1.1) (2022-04-25) +## [0.1.1](https://github.com/googleapis/python-optimization/compare/v0.1.0...v0.1.1) (2022-04-25) ### Documentation From c141479451116a9667c73e4dc391e2933048da0c Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Tue, 7 Jun 2022 19:48:15 -0400 Subject: [PATCH 8/9] fix(deps): require protobuf>=3.19.0,<4.0.0 (#42) --- setup.py | 3 ++- testing/constraints-3.6.txt | 1 + testing/constraints-3.7.txt | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6339301..796afc6 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,8 @@ # Until this issue is closed # https://github.com/googleapis/google-cloud-python/issues/10566 "google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0", - "proto-plus >= 1.15.0", + "proto-plus >= 1.15.0, <2.0.0dev", + "protobuf >= 3.19.0, <4.0.0dev", ] package_root = os.path.abspath(os.path.dirname(__file__)) diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt index be5a64f..786e637 100644 --- a/testing/constraints-3.6.txt +++ b/testing/constraints-3.6.txt @@ -6,3 +6,4 @@ # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.31.5 proto-plus==1.15.0 +protobuf==3.19.0 diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt index be5a64f..786e637 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -6,3 +6,4 @@ # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.31.5 proto-plus==1.15.0 +protobuf==3.19.0 From 32eef03d44c49460b0f8a042be9917047d4a017a 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:30:44 -0400 Subject: [PATCH 9/9] chore(main): release 1.0.1 (#43) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 12 ++++++++++++ setup.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5ed579..4acc869 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [1.0.1](https://github.com/googleapis/python-optimization/compare/v1.0.0...v1.0.1) (2022-06-07) + + +### Bug Fixes + +* **deps:** require protobuf>=3.19.0,<4.0.0 ([#42](https://github.com/googleapis/python-optimization/issues/42)) ([c141479](https://github.com/googleapis/python-optimization/commit/c141479451116a9667c73e4dc391e2933048da0c)) + + +### Documentation + +* fix changelog header to consistent size ([#40](https://github.com/googleapis/python-optimization/issues/40)) ([d1feb93](https://github.com/googleapis/python-optimization/commit/d1feb935cbe4ed15588adf165988cc74fcdb0a73)) + ## [1.0.0](https://github.com/googleapis/python-optimization/compare/v0.1.1...v1.0.0) (2022-04-26) diff --git a/setup.py b/setup.py index 796afc6..319cbc4 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ name = "google-cloud-optimization" description = "Cloud Optimization API client library" -version = "1.0.0" +version = "1.0.1" release_status = "Development Status :: 5 - Production/Stable" url = "https://github.com/googleapis/python-optimization" dependencies = [