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

Commit

Permalink
chore: use gapic-generator-python 0.53.4 (#54)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

docs: list oneofs in docstring
fix(deps): require google-api-core >= 1.28.0
fix(deps): drop packaging dependency

committer: busunkim96@
PiperOrigin-RevId: 406468269

Source-Link: googleapis/googleapis@83d81b0

Source-Link: googleapis/googleapis-gen@2ff001f
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZmMDAxZmJhY2I5ZTc3ZTcxZDczNGRlNWY5NTVjMDVmZGFlODUyNiJ9
  • Loading branch information
gcf-owl-bot[bot] committed Nov 1, 2021
1 parent d21896b commit 3364a46
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 130 deletions.
Expand Up @@ -19,13 +19,15 @@
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources

import google.api_core.client_options as ClientOptions # type: ignore
from google.api_core.client_options import ClientOptions # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.lifesciences_v2beta.types import workflows
Expand Down Expand Up @@ -167,9 +169,9 @@ def __init__(

async def run_pipeline(
self,
request: workflows.RunPipelineRequest = None,
request: Union[workflows.RunPipelineRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
Expand All @@ -193,7 +195,7 @@ async def run_pipeline(
- ``lifesciences.workflows.run``
Args:
request (:class:`google.cloud.lifesciences_v2beta.types.RunPipelineRequest`):
request (Union[google.cloud.lifesciences_v2beta.types.RunPipelineRequest, dict]):
The request object. The arguments to the `RunPipeline`
method. The requesting user must have the
`iam.serviceAccounts.actAs` permission for the Cloud
Expand Down
Expand Up @@ -30,6 +30,8 @@
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.lifesciences_v2beta.types import workflows
Expand Down Expand Up @@ -340,7 +342,7 @@ def run_pipeline(
self,
request: Union[workflows.RunPipelineRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down
Expand Up @@ -15,7 +15,6 @@
#
import abc
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
import packaging.version
import pkg_resources

import google.auth # type: ignore
Expand All @@ -39,15 +38,6 @@
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()

try:
# google.auth.__version__ was added in 1.26.0
_GOOGLE_AUTH_VERSION = google.auth.__version__
except AttributeError:
try: # try pkg_resources if it is available
_GOOGLE_AUTH_VERSION = pkg_resources.get_distribution("google-auth").version
except pkg_resources.DistributionNotFound: # pragma: NO COVER
_GOOGLE_AUTH_VERSION = None


class WorkflowsServiceV2BetaTransport(abc.ABC):
"""Abstract transport class for WorkflowsServiceV2Beta."""
Expand Down Expand Up @@ -97,7 +87,7 @@ def __init__(
host += ":443"
self._host = host

scopes_kwargs = self._get_scopes_kwargs(self._host, scopes)
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
Expand Down Expand Up @@ -130,29 +120,6 @@ def __init__(
# Save the credentials.
self._credentials = credentials

# TODO(busunkim): This method is in the base transport
# to avoid duplicating code across the transport classes. These functions
# should be deleted once the minimum required versions of google-auth is increased.

# TODO: Remove this function once google-auth >= 1.25.0 is required
@classmethod
def _get_scopes_kwargs(
cls, host: str, scopes: Optional[Sequence[str]]
) -> Dict[str, Optional[Sequence[str]]]:
"""Returns scopes kwargs to pass to google-auth methods depending on the google-auth version"""

scopes_kwargs = {}

if _GOOGLE_AUTH_VERSION and (
packaging.version.parse(_GOOGLE_AUTH_VERSION)
>= packaging.version.parse("1.25.0")
):
scopes_kwargs = {"scopes": scopes, "default_scopes": cls.AUTH_SCOPES}
else:
scopes_kwargs = {"scopes": scopes or cls.AUTH_SCOPES}

return scopes_kwargs

def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
Expand All @@ -171,7 +138,7 @@ def close(self):
raise NotImplementedError()

@property
def operations_client(self) -> operations_v1.OperationsClient:
def operations_client(self):
"""Return the client designed to process long-running operations."""
raise NotImplementedError()

Expand Down
Expand Up @@ -113,7 +113,7 @@ def __init__(
self._grpc_channel = None
self._ssl_channel_credentials = ssl_channel_credentials
self._stubs: Dict[str, Callable] = {}
self._operations_client = None
self._operations_client: Optional[operations_v1.OperationsClient] = None

if api_mtls_endpoint:
warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
Expand Down
Expand Up @@ -21,7 +21,6 @@
from google.api_core import operations_v1 # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
import packaging.version

import grpc # type: ignore
from grpc.experimental import aio # type: ignore
Expand Down Expand Up @@ -160,7 +159,7 @@ def __init__(
self._grpc_channel = None
self._ssl_channel_credentials = ssl_channel_credentials
self._stubs: Dict[str, Callable] = {}
self._operations_client = None
self._operations_client: Optional[operations_v1.OperationsAsyncClient] = None

if api_mtls_endpoint:
warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
Expand Down
27 changes: 27 additions & 0 deletions google/cloud/lifesciences_v2beta/types/workflows.py
Expand Up @@ -629,6 +629,13 @@ class Volume(proto.Message):
Specify either [``Volume``][google.cloud.lifesciences.v2beta.Volume]
or [``Disk``][google.cloud.lifesciences.v2beta.Disk], but not both.
This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
volume (str):
A user-supplied name for the volume. Used when mounting the
Expand All @@ -638,10 +645,13 @@ class Volume(proto.Message):
characters and hyphens and cannot start with a hyphen.
persistent_disk (google.cloud.lifesciences_v2beta.types.PersistentDisk):
Configuration for a persistent disk.
This field is a member of `oneof`_ ``storage``.
existing_disk (google.cloud.lifesciences_v2beta.types.ExistingDisk):
Configuration for a existing disk.
This field is a member of `oneof`_ ``storage``.
nfs_mount (google.cloud.lifesciences_v2beta.types.NFSMount):
Configuration for an NFS mount.
This field is a member of `oneof`_ ``storage``.
"""

volume = proto.Field(proto.STRING, number=1,)
Expand Down Expand Up @@ -762,6 +772,13 @@ class Event(proto.Message):
r"""Carries information about events that occur during pipeline
execution.
This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
timestamp (google.protobuf.timestamp_pb2.Timestamp):
The time at which the event occurred.
Expand All @@ -773,33 +790,43 @@ class Event(proto.Message):
delayed (google.cloud.lifesciences_v2beta.types.DelayedEvent):
See
[google.cloud.lifesciences.v2beta.DelayedEvent][google.cloud.lifesciences.v2beta.DelayedEvent].
This field is a member of `oneof`_ ``details``.
worker_assigned (google.cloud.lifesciences_v2beta.types.WorkerAssignedEvent):
See
[google.cloud.lifesciences.v2beta.WorkerAssignedEvent][google.cloud.lifesciences.v2beta.WorkerAssignedEvent].
This field is a member of `oneof`_ ``details``.
worker_released (google.cloud.lifesciences_v2beta.types.WorkerReleasedEvent):
See
[google.cloud.lifesciences.v2beta.WorkerReleasedEvent][google.cloud.lifesciences.v2beta.WorkerReleasedEvent].
This field is a member of `oneof`_ ``details``.
pull_started (google.cloud.lifesciences_v2beta.types.PullStartedEvent):
See
[google.cloud.lifesciences.v2beta.PullStartedEvent][google.cloud.lifesciences.v2beta.PullStartedEvent].
This field is a member of `oneof`_ ``details``.
pull_stopped (google.cloud.lifesciences_v2beta.types.PullStoppedEvent):
See
[google.cloud.lifesciences.v2beta.PullStoppedEvent][google.cloud.lifesciences.v2beta.PullStoppedEvent].
This field is a member of `oneof`_ ``details``.
container_started (google.cloud.lifesciences_v2beta.types.ContainerStartedEvent):
See
[google.cloud.lifesciences.v2beta.ContainerStartedEvent][google.cloud.lifesciences.v2beta.ContainerStartedEvent].
This field is a member of `oneof`_ ``details``.
container_stopped (google.cloud.lifesciences_v2beta.types.ContainerStoppedEvent):
See
[google.cloud.lifesciences.v2beta.ContainerStoppedEvent][google.cloud.lifesciences.v2beta.ContainerStoppedEvent].
This field is a member of `oneof`_ ``details``.
container_killed (google.cloud.lifesciences_v2beta.types.ContainerKilledEvent):
See
[google.cloud.lifesciences.v2beta.ContainerKilledEvent][google.cloud.lifesciences.v2beta.ContainerKilledEvent].
This field is a member of `oneof`_ ``details``.
unexpected_exit_status (google.cloud.lifesciences_v2beta.types.UnexpectedExitStatusEvent):
See
[google.cloud.lifesciences.v2beta.UnexpectedExitStatusEvent][google.cloud.lifesciences.v2beta.UnexpectedExitStatusEvent].
This field is a member of `oneof`_ ``details``.
failed (google.cloud.lifesciences_v2beta.types.FailedEvent):
See
[google.cloud.lifesciences.v2beta.FailedEvent][google.cloud.lifesciences.v2beta.FailedEvent].
This field is a member of `oneof`_ ``details``.
"""

timestamp = proto.Field(proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp,)
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Expand Up @@ -29,9 +29,8 @@
# NOTE: Maintainers, please do not require google-api-core>=2.x.x
# Until this issue is closed
# https://github.com/googleapis/google-cloud-python/issues/10566
"google-api-core[grpc] >= 1.26.0, <3.0.0dev",
"google-api-core[grpc] >= 1.28.0, <3.0.0dev",
"proto-plus >= 1.15.0",
"packaging >= 14.3",
]

package_root = os.path.abspath(os.path.dirname(__file__))
Expand Down
4 changes: 1 addition & 3 deletions testing/constraints-3.6.txt
Expand Up @@ -4,7 +4,5 @@
# 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.26.0
google-api-core==1.28.0
proto-plus==1.15.0
packaging==14.3
google-auth==1.24.0 # TODO: remove when google-auth>=1.25.0 si transitively required through google-api-core

0 comments on commit 3364a46

Please sign in to comment.