Skip to content

Commit

Permalink
chore(python): use black==22.3.0 (#96)
Browse files Browse the repository at this point in the history
Source-Link: googleapis/synthtool@6fab84a
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe
  • Loading branch information
gcf-owl-bot[bot] committed Mar 29, 2022
1 parent 995a2fb commit 5e2104d
Show file tree
Hide file tree
Showing 15 changed files with 535 additions and 160 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion packages/google-cloud-apigee-connect/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ def sample_list_connections():
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.ServiceUnavailable, core_exceptions.Unknown,
core_exceptions.ServiceUnavailable,
core_exceptions.Unknown,
),
deadline=60.0,
),
Expand All @@ -304,12 +305,20 @@ def sample_list_connections():
)

# Send the request.
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# This method is paged; wrap the response in a pager, which provides
# an `__aiter__` convenience method.
response = pagers.ListConnectionsAsyncPager(
method=rpc, request=request, response=response, metadata=metadata,
method=rpc,
request=request,
response=response,
metadata=metadata,
)

# Done; return the response.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class ConnectionServiceClientMeta(type):
_transport_registry["grpc_asyncio"] = ConnectionServiceGrpcAsyncIOTransport

def get_transport_class(
cls, label: str = None,
cls,
label: str = None,
) -> Type[ConnectionServiceTransport]:
"""Returns an appropriate transport class.
Expand Down Expand Up @@ -164,10 +165,14 @@ def transport(self) -> ConnectionServiceTransport:
return self._transport

@staticmethod
def endpoint_path(project: str, endpoint: str,) -> str:
def endpoint_path(
project: str,
endpoint: str,
) -> str:
"""Returns a fully-qualified endpoint string."""
return "projects/{project}/endpoints/{endpoint}".format(
project=project, endpoint=endpoint,
project=project,
endpoint=endpoint,
)

@staticmethod
Expand All @@ -177,7 +182,9 @@ def parse_endpoint_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_billing_account_path(billing_account: str,) -> str:
def common_billing_account_path(
billing_account: str,
) -> str:
"""Returns a fully-qualified billing_account string."""
return "billingAccounts/{billing_account}".format(
billing_account=billing_account,
Expand All @@ -190,9 +197,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_folder_path(folder: str,) -> str:
def common_folder_path(
folder: str,
) -> str:
"""Returns a fully-qualified folder string."""
return "folders/{folder}".format(folder=folder,)
return "folders/{folder}".format(
folder=folder,
)

@staticmethod
def parse_common_folder_path(path: str) -> Dict[str, str]:
Expand All @@ -201,9 +212,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_organization_path(organization: str,) -> str:
def common_organization_path(
organization: str,
) -> str:
"""Returns a fully-qualified organization string."""
return "organizations/{organization}".format(organization=organization,)
return "organizations/{organization}".format(
organization=organization,
)

@staticmethod
def parse_common_organization_path(path: str) -> Dict[str, str]:
Expand All @@ -212,9 +227,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_project_path(project: str,) -> str:
def common_project_path(
project: str,
) -> str:
"""Returns a fully-qualified project string."""
return "projects/{project}".format(project=project,)
return "projects/{project}".format(
project=project,
)

@staticmethod
def parse_common_project_path(path: str) -> Dict[str, str]:
Expand All @@ -223,10 +242,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_location_path(project: str, location: str,) -> str:
def common_location_path(
project: str,
location: str,
) -> str:
"""Returns a fully-qualified location string."""
return "projects/{project}/locations/{location}".format(
project=project, location=location,
project=project,
location=location,
)

@staticmethod
Expand Down Expand Up @@ -491,12 +514,20 @@ def sample_list_connections():
)

# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# This method is paged; wrap the response in a pager, which provides
# an `__iter__` convenience method.
response = pagers.ListConnectionsPager(
method=rpc, request=request, response=response, metadata=metadata,
method=rpc,
request=request,
response=response,
metadata=metadata,
)

# Done; return the response.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ def _prep_wrapped_messages(self, client_info):
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.ServiceUnavailable, core_exceptions.Unknown,
core_exceptions.ServiceUnavailable,
core_exceptions.Unknown,
),
deadline=60.0,
),
Expand All @@ -139,9 +140,9 @@ def _prep_wrapped_messages(self, client_info):
def close(self):
"""Closes resources associated with the transport.
.. warning::
Only call this method if the transport is NOT shared
with other clients - this may cause errors in other clients!
.. warning::
Only call this method if the transport is NOT shared
with other clients - this may cause errors in other clients!
"""
raise NotImplementedError()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ def create_channel(

@property
def grpc_channel(self) -> grpc.Channel:
"""Return the channel designed to connect to this service.
"""
"""Return the channel designed to connect to this service."""
return self._grpc_channel

@property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,12 @@ def request_generator():
)

# Send the request.
response = rpc(requests, retry=retry, timeout=timeout, metadata=metadata,)
response = rpc(
requests,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ class TetherClientMeta(type):
_transport_registry["grpc"] = TetherGrpcTransport
_transport_registry["grpc_asyncio"] = TetherGrpcAsyncIOTransport

def get_transport_class(cls, label: str = None,) -> Type[TetherTransport]:
def get_transport_class(
cls,
label: str = None,
) -> Type[TetherTransport]:
"""Returns an appropriate transport class.
Args:
Expand Down Expand Up @@ -162,7 +165,9 @@ def transport(self) -> TetherTransport:
return self._transport

@staticmethod
def common_billing_account_path(billing_account: str,) -> str:
def common_billing_account_path(
billing_account: str,
) -> str:
"""Returns a fully-qualified billing_account string."""
return "billingAccounts/{billing_account}".format(
billing_account=billing_account,
Expand All @@ -175,9 +180,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_folder_path(folder: str,) -> str:
def common_folder_path(
folder: str,
) -> str:
"""Returns a fully-qualified folder string."""
return "folders/{folder}".format(folder=folder,)
return "folders/{folder}".format(
folder=folder,
)

@staticmethod
def parse_common_folder_path(path: str) -> Dict[str, str]:
Expand All @@ -186,9 +195,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_organization_path(organization: str,) -> str:
def common_organization_path(
organization: str,
) -> str:
"""Returns a fully-qualified organization string."""
return "organizations/{organization}".format(organization=organization,)
return "organizations/{organization}".format(
organization=organization,
)

@staticmethod
def parse_common_organization_path(path: str) -> Dict[str, str]:
Expand All @@ -197,9 +210,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_project_path(project: str,) -> str:
def common_project_path(
project: str,
) -> str:
"""Returns a fully-qualified project string."""
return "projects/{project}".format(project=project,)
return "projects/{project}".format(
project=project,
)

@staticmethod
def parse_common_project_path(path: str) -> Dict[str, str]:
Expand All @@ -208,10 +225,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_location_path(project: str, location: str,) -> str:
def common_location_path(
project: str,
location: str,
) -> str:
"""Returns a fully-qualified location string."""
return "projects/{project}/locations/{location}".format(
project=project, location=location,
project=project,
location=location,
)

@staticmethod
Expand Down Expand Up @@ -452,7 +473,12 @@ def request_generator():
rpc = self._transport._wrapped_methods[self._transport.egress]

# Send the request.
response = rpc(requests, retry=retry, timeout=timeout, metadata=metadata,)
response = rpc(
requests,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,18 @@ def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
self.egress: gapic_v1.method.wrap_method(
self.egress, default_timeout=None, client_info=client_info,
self.egress,
default_timeout=None,
client_info=client_info,
),
}

def close(self):
"""Closes resources associated with the transport.
.. warning::
Only call this method if the transport is NOT shared
with other clients - this may cause errors in other clients!
.. warning::
Only call this method if the transport is NOT shared
with other clients - this may cause errors in other clients!
"""
raise NotImplementedError()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ def create_channel(

@property
def grpc_channel(self) -> grpc.Channel:
"""Return the channel designed to connect to this service.
"""
"""Return the channel designed to connect to this service."""
return self._grpc_channel

@property
Expand Down
Loading

0 comments on commit 5e2104d

Please sign in to comment.