Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
chore(python): allow client documentation to be customized in README (#3
Browse files Browse the repository at this point in the history
)

Source-Link: googleapis/synthtool@95d9289
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
  • Loading branch information
gcf-owl-bot[bot] committed Jul 20, 2022
1 parent fba35f5 commit 1608753
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 54 deletions.
6 changes: 3 additions & 3 deletions .github/.OwlBot.lock.yaml
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/unittest.yml
Expand Up @@ -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
10 changes: 7 additions & 3 deletions README.rst
Expand Up @@ -15,7 +15,7 @@ Python Client for BeyondCorp AppGateways API
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-beyondcorp-appgateways.svg
:target: https://pypi.org/project/google-cloud-beyondcorp-appgateways/
.. _BeyondCorp AppGateways 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/beyondcorpappgateways/latest
.. _Product Documentation: https://cloud.google.com/beyondcorp/

Quick Start
Expand Down Expand Up @@ -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
^^^^^^^^^
Expand Down
Expand Up @@ -47,16 +47,10 @@


class AppGatewaysServiceAsyncClient:
"""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 AppGatewaysService exposes the following resources:
Data Model: The AppGatewaysService exposes the following resources:
- AppGateways, named as follows:
``projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}``.
Expand Down Expand Up @@ -955,9 +949,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": [
{
Expand All @@ -981,8 +976,11 @@ async def set_iam_policy(
}
]
}
**YAML Example**
::
bindings:
- members:
- user:mike@example.com
Expand All @@ -997,6 +995,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 <https://cloud.google.com/iam/docs>`__.
Expand Down Expand Up @@ -1069,9 +1068,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": [
{
Expand All @@ -1095,8 +1095,11 @@ async def get_iam_policy(
}
]
}
**YAML Example**
::
bindings:
- members:
- user:mike@example.com
Expand All @@ -1111,6 +1114,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 <https://cloud.google.com/iam/docs>`__.
Expand Down
Expand Up @@ -86,16 +86,10 @@ def get_transport_class(


class AppGatewaysServiceClient(metaclass=AppGatewaysServiceClientMeta):
"""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 AppGatewaysService exposes the following resources:
Data Model: The AppGatewaysService exposes the following resources:
- AppGateways, named as follows:
``projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}``.
Expand Down Expand Up @@ -1192,9 +1186,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": [
{
Expand All @@ -1218,8 +1213,11 @@ def set_iam_policy(
}
]
}
**YAML Example**
::
bindings:
- members:
- user:mike@example.com
Expand All @@ -1234,6 +1232,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 <https://cloud.google.com/iam/docs>`__.
Expand Down Expand Up @@ -1306,9 +1305,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": [
{
Expand All @@ -1332,8 +1332,11 @@ def get_iam_policy(
}
]
}
**YAML Example**
::
bindings:
- members:
- user:mike@example.com
Expand All @@ -1348,6 +1351,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 <https://cloud.google.com/iam/docs>`__.
Expand Down
Expand Up @@ -37,16 +37,10 @@
class AppGatewaysServiceGrpcTransport(AppGatewaysServiceTransport):
"""gRPC backend transport for AppGatewaysService.
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 AppGatewaysService exposes the following resources:
Data Model: The AppGatewaysService exposes the following resources:
- AppGateways, named as follows:
``projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}``.
Expand Down
Expand Up @@ -38,16 +38,10 @@
class AppGatewaysServiceGrpcAsyncIOTransport(AppGatewaysServiceTransport):
"""gRPC AsyncIO backend transport for AppGatewaysService.
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 AppGatewaysService exposes the following resources:
Data Model: The AppGatewaysService exposes the following resources:
- AppGateways, named as follows:
``projects/{project_id}/locations/{location_id}/appGateways/{app_gateway_id}``.
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Expand Up @@ -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")

Expand Down
29 changes: 29 additions & 0 deletions owlbot.py
Expand Up @@ -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_appgateways", "setup.py"])
s.remove_staging_dirs()

Expand All @@ -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),
)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion testing/constraints-3.7.txt
Expand Up @@ -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

0 comments on commit 1608753

Please sign in to comment.