From 7c02a8ea57e48946878a418f5c44b43a6f0f97a9 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 20 Jul 2022 14:30:11 +0000 Subject: [PATCH] chore(python): allow client documentation to be customized in README (#3) Source-Link: https://github.com/googleapis/synthtool/commit/95d9289ac3dc1ca2edae06619c82fe7a24d555f1 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:c8878270182edaab99f2927969d4f700c3af265accd472c3425deedff2b7fd93 fix(deps): require google-api-core>=1.32.0,>=2.8.0 --- .github/.OwlBot.lock.yaml | 6 ++-- .github/workflows/unittest.yml | 2 +- README.rst | 10 ++++-- .../async_client.py | 32 +++++++++++-------- .../client.py | 32 +++++++++++-------- .../transports/grpc.py | 10 ++---- .../transports/grpc_asyncio.py | 10 ++---- noxfile.py | 2 +- owlbot.py | 29 +++++++++++++++++ setup.py | 2 +- testing/constraints-3.7.txt | 2 +- 11 files changed, 83 insertions(+), 54 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 23ced69..58fcbee 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -4,14 +4,14 @@ # 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 +# 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. - docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c + digest: sha256:c8878270182edaab99f2927969d4f700c3af265accd472c3425deedff2b7fd93 +# created: 2022-07-14T01:58:16.015625351Z diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 5531b01..f3d10f9 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -54,4 +54,4 @@ jobs: - name: Report coverage results run: | coverage combine .coverage-results/.coverage* - coverage report --show-missing --fail-under=100 + coverage report --show-missing --fail-under=98 diff --git a/README.rst b/README.rst index 4f5d918..513c0bc 100644 --- a/README.rst +++ b/README.rst @@ -15,7 +15,7 @@ Python Client for BeyondCorp ClientConnectorServices API .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-beyondcorp-clientconnectorservices.svg :target: https://pypi.org/project/google-cloud-beyondcorp-clientconnectorservices/ .. _BeyondCorp ClientConnectorServices API: https://cloud.google.com/beyondcorp/ -.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/beyondcorp/latest +.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/beyondcorpclientconnectorservices/latest .. _Product Documentation: https://cloud.google.com/beyondcorp/ Quick Start @@ -55,18 +55,22 @@ Code samples and snippets live in the `samples/` folder. Supported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^ -Our client libraries are compatible with all current [active](https://devguide.python.org/devcycle/#in-development-main-branch) and [maintenance](https://devguide.python.org/devcycle/#maintenance-branches) versions of +Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of Python. Python >= 3.7 +.. _active: https://devguide.python.org/devcycle/#in-development-main-branch +.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches + Unsupported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Python <= 3.6 -If you are using an [end-of-life](https://devguide.python.org/devcycle/#end-of-life-branches) +If you are using an `end-of-life`_ version of Python, we recommend that you update as soon as possible to an actively supported version. +.. _end-of-life: https://devguide.python.org/devcycle/#end-of-life-branches Mac/Linux ^^^^^^^^^ diff --git a/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/async_client.py b/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/async_client.py index d267f39..43ac3f4 100644 --- a/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/async_client.py +++ b/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/async_client.py @@ -55,16 +55,10 @@ class ClientConnectorServicesServiceAsyncClient: - """API Overview - ------------ - - The ``beyondcorp.googleapis.com`` service implements the Google + """API Overview: The ``beyondcorp.googleapis.com`` service implements the Google Cloud BeyondCorp API. - Data Model - ---------- - - The ClientConnectorServicesService exposes the following resources: + Data Model: The ClientConnectorServicesService exposes the following resources: - Client Connector Services, named as follows: ``projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}``. @@ -1119,9 +1113,10 @@ async def set_iam_policy( optionally specify a ``condition``, which is a logic expression that further constrains the role binding based on attributes about the request and/or target - resource. - **JSON Example** - :: + resource. JSON Example. + + .. code-block:: python + { "bindings": [ { @@ -1145,8 +1140,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1161,6 +1159,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1233,9 +1232,10 @@ async def get_iam_policy( optionally specify a ``condition``, which is a logic expression that further constrains the role binding based on attributes about the request and/or target - resource. - **JSON Example** - :: + resource. JSON Example. + + .. code-block:: python + { "bindings": [ { @@ -1259,8 +1259,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1275,6 +1278,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/client.py b/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/client.py index 2ac0f1e..b8fe125 100644 --- a/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/client.py +++ b/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/client.py @@ -98,16 +98,10 @@ def get_transport_class( class ClientConnectorServicesServiceClient( metaclass=ClientConnectorServicesServiceClientMeta ): - """API Overview - ------------ - - The ``beyondcorp.googleapis.com`` service implements the Google + """API Overview: The ``beyondcorp.googleapis.com`` service implements the Google Cloud BeyondCorp API. - Data Model - ---------- - - The ClientConnectorServicesService exposes the following resources: + Data Model: The ClientConnectorServicesService exposes the following resources: - Client Connector Services, named as follows: ``projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}``. @@ -1384,9 +1378,10 @@ def set_iam_policy( optionally specify a ``condition``, which is a logic expression that further constrains the role binding based on attributes about the request and/or target - resource. - **JSON Example** - :: + resource. JSON Example. + + .. code-block:: python + { "bindings": [ { @@ -1410,8 +1405,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1426,6 +1424,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1498,9 +1497,10 @@ def get_iam_policy( optionally specify a ``condition``, which is a logic expression that further constrains the role binding based on attributes about the request and/or target - resource. - **JSON Example** - :: + resource. JSON Example. + + .. code-block:: python + { "bindings": [ { @@ -1524,8 +1524,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1540,6 +1543,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/transports/grpc.py b/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/transports/grpc.py index 4af6445..488277e 100644 --- a/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/transports/grpc.py +++ b/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/transports/grpc.py @@ -41,16 +41,10 @@ class ClientConnectorServicesServiceGrpcTransport( ): """gRPC backend transport for ClientConnectorServicesService. - API Overview - ------------ - - The ``beyondcorp.googleapis.com`` service implements the Google + API Overview: The ``beyondcorp.googleapis.com`` service implements the Google Cloud BeyondCorp API. - Data Model - ---------- - - The ClientConnectorServicesService exposes the following resources: + Data Model: The ClientConnectorServicesService exposes the following resources: - Client Connector Services, named as follows: ``projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}``. diff --git a/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/transports/grpc_asyncio.py b/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/transports/grpc_asyncio.py index fb547dd..4b26a07 100644 --- a/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/transports/grpc_asyncio.py +++ b/google/cloud/beyondcorp_clientconnectorservices_v1/services/client_connector_services_service/transports/grpc_asyncio.py @@ -42,16 +42,10 @@ class ClientConnectorServicesServiceGrpcAsyncIOTransport( ): """gRPC AsyncIO backend transport for ClientConnectorServicesService. - API Overview - ------------ - - The ``beyondcorp.googleapis.com`` service implements the Google + API Overview: The ``beyondcorp.googleapis.com`` service implements the Google Cloud BeyondCorp API. - Data Model - ---------- - - The ClientConnectorServicesService exposes the following resources: + Data Model: The ClientConnectorServicesService exposes the following resources: - Client Connector Services, named as follows: ``projects/{project_id}/locations/{location_id}/client_connector_services/{client_connector_service_id}``. diff --git a/noxfile.py b/noxfile.py index 001ec73..8119cc4 100644 --- a/noxfile.py +++ b/noxfile.py @@ -265,7 +265,7 @@ def cover(session): test runs (not system test runs), and then erases coverage data. """ session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") + session.run("coverage", "report", "--show-missing", "--fail-under=98") session.run("coverage", "erase") diff --git a/owlbot.py b/owlbot.py index 1e7f546..87da18d 100644 --- a/owlbot.py +++ b/owlbot.py @@ -25,6 +25,34 @@ default_version = "v1" for library in s.get_staging_dirs(default_version): + # work around issues with docstrings + s.replace( + library / "google/cloud/**/*.py", + """resource. + \*\*JSON Example\*\* + ::""", + """resource. JSON Example. + + .. code-block:: python\n""", + ) + + s.replace( + library / "google/cloud/**/*.py", + """\*\*YAML Example\*\* + ::""", + """\n **YAML Example** + + ::\n""", + ) + + s.replace(library / "google/cloud/**/*.py", + """ For a description of IAM and its features, see the `IAM + developer's""", + """\n For a description of IAM and its features, see the `IAM + developer's""" + ) + s.replace(library / "google/cloud/**/*.py","\n ------------\n\n ",":") + s.replace(library / "google/cloud/**/*.py","\n ----------\n\n ",":") s.move(library, excludes=["google/cloud/beyondcorp_clientconnectorservices", "setup.py"]) s.remove_staging_dirs() @@ -33,6 +61,7 @@ # ---------------------------------------------------------------------------- templated_files = gcp.CommonTemplates().py_library( + cov_level=98, microgenerator=True, versions=gcp.common.detect_versions(path="./google", default_first=True), ) diff --git a/setup.py b/setup.py index b7b2c1b..c29c3bb 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ version = "0.1.0" release_status = "Development Status :: 4 - Beta" dependencies = [ - "google-api-core[grpc] >= 2.8.0, <3.0.0dev", + "google-api-core[grpc] >= 1.32.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*", "proto-plus >= 1.15.0, <2.0.0dev", "protobuf >= 3.19.0, <4.0.0dev", "grpc-google-iam-v1 >=0.12.4, <1.0.0dev", diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt index 3816dc9..1e04987 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -4,7 +4,7 @@ # 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==2.8.0 +google-api-core==1.32.0 proto-plus==1.15.0 protobuf==3.19.0 grpc-google-iam-v1==0.12.4