Skip to content

Commit

Permalink
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#8)
Browse files Browse the repository at this point in the history
* fix(deps): Require google-api-core >=1.34.0, >=2.11.0

fix: Drop usage of pkg_resources

fix: Fix timeout default values

docs(samples): Snippetgen should call await on the operation coroutine before calling result

PiperOrigin-RevId: 493260409

Source-Link: googleapis/googleapis@fea4387

Source-Link: googleapis/googleapis-gen@387b734
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* add gapic_version.py

* add gapic_version.py

* revert

* fix typo

* revert

* revert

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <[email protected]>
  • Loading branch information
3 people authored Dec 8, 2022
1 parent 755e290 commit 2009ee7
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 75 deletions.
5 changes: 0 additions & 5 deletions packages/google-cloud-gsuiteaddons/.coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,3 @@ exclude_lines =
pragma: NO COVER
# Ignore debug-only repr
def __repr__
# Ignore pkg_resources exceptions.
# This is added at the module level as a safeguard for if someone
# generates the code and tries to run it without pip installing. This
# makes it virtually impossible to test properly.
except pkg_resources.DistributionNotFound
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# 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
#
# 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.
#
__version__ = "0.1.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
from google.api_core.client_options import ClientOptions
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.gsuiteaddons_v1 import gapic_version as package_version

try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
Expand Down Expand Up @@ -251,7 +252,7 @@ async def get_authorization(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> gsuiteaddons.Authorization:
r"""Gets the authorization information for deployments in
Expand Down Expand Up @@ -358,7 +359,7 @@ async def create_deployment(
deployment: Optional[gsuiteaddons.Deployment] = None,
deployment_id: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> gsuiteaddons.Deployment:
r"""Creates a deployment with the specified name and
Expand Down Expand Up @@ -481,7 +482,7 @@ async def replace_deployment(
*,
deployment: Optional[gsuiteaddons.Deployment] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> gsuiteaddons.Deployment:
r"""Creates or replaces a deployment with the specified
Expand Down Expand Up @@ -583,7 +584,7 @@ async def get_deployment(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> gsuiteaddons.Deployment:
r"""Gets the deployment with the specified name.
Expand Down Expand Up @@ -685,7 +686,7 @@ async def list_deployments(
*,
parent: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListDeploymentsAsyncPager:
r"""Lists all deployments in a particular project.
Expand Down Expand Up @@ -801,7 +802,7 @@ async def delete_deployment(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Deletes the deployment with the given name.
Expand Down Expand Up @@ -894,7 +895,7 @@ async def install_deployment(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Installs a deployment in developer mode.
Expand Down Expand Up @@ -989,7 +990,7 @@ async def uninstall_deployment(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Uninstalls a developer mode deployment.
Expand Down Expand Up @@ -1084,7 +1085,7 @@ async def get_install_status(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> gsuiteaddons.InstallStatus:
r"""Fetches the install status of a developer mode
Expand Down Expand Up @@ -1190,14 +1191,9 @@ async def __aexit__(self, exc_type, exc, tb):
await self.transport.close()


try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-gsuiteaddons",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=package_version.__version__
)


__all__ = ("GSuiteAddOnsAsyncClient",)
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
from google.auth.transport import mtls # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.gsuiteaddons_v1 import gapic_version as package_version

try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
Expand Down Expand Up @@ -506,7 +507,7 @@ def get_authorization(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> gsuiteaddons.Authorization:
r"""Gets the authorization information for deployments in
Expand Down Expand Up @@ -613,7 +614,7 @@ def create_deployment(
deployment: Optional[gsuiteaddons.Deployment] = None,
deployment_id: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> gsuiteaddons.Deployment:
r"""Creates a deployment with the specified name and
Expand Down Expand Up @@ -736,7 +737,7 @@ def replace_deployment(
*,
deployment: Optional[gsuiteaddons.Deployment] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> gsuiteaddons.Deployment:
r"""Creates or replaces a deployment with the specified
Expand Down Expand Up @@ -838,7 +839,7 @@ def get_deployment(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> gsuiteaddons.Deployment:
r"""Gets the deployment with the specified name.
Expand Down Expand Up @@ -940,7 +941,7 @@ def list_deployments(
*,
parent: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListDeploymentsPager:
r"""Lists all deployments in a particular project.
Expand Down Expand Up @@ -1056,7 +1057,7 @@ def delete_deployment(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Deletes the deployment with the given name.
Expand Down Expand Up @@ -1149,7 +1150,7 @@ def install_deployment(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Installs a deployment in developer mode.
Expand Down Expand Up @@ -1244,7 +1245,7 @@ def uninstall_deployment(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Uninstalls a developer mode deployment.
Expand Down Expand Up @@ -1339,7 +1340,7 @@ def get_install_status(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> gsuiteaddons.InstallStatus:
r"""Fetches the install status of a developer mode
Expand Down Expand Up @@ -1452,14 +1453,9 @@ def __exit__(self, type, value, traceback):
self.transport.close()


try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-gsuiteaddons",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=package_version.__version__
)


__all__ = ("GSuiteAddOnsClient",)
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,13 @@
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore
from google.protobuf import empty_pb2 # type: ignore
import pkg_resources

from google.cloud.gsuiteaddons_v1 import gapic_version as package_version
from google.cloud.gsuiteaddons_v1.types import gsuiteaddons

try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-gsuiteaddons",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=package_version.__version__
)


class GSuiteAddOnsTransport(abc.ABC):
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-gsuiteaddons/owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
shutil.rmtree("samples/generated_samples", ignore_errors=True)
clean_up_generated_samples = False

s.move([library], excludes=["**/gapic_version.py"])
s.move([library], excludes=["**/gapic_version.py", "setup.py", "testing/constraints-3.7.txt"])
s.remove_staging_dirs()

# ----------------------------------------------------------------------------
Expand Down
42 changes: 21 additions & 21 deletions packages/google-cloud-gsuiteaddons/release-please-config.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"$schema":
"https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "python",
"extra-files": [
"google/cloud/gsuiteaddons/gapic_version.py",
{
"type": "json",
"path": "samples/generated_samples/snippet_metadata_google.cloud.gsuiteaddons.v1.json",
"jsonpath": "$.clientLibrary.version"
}
]
}
},
"release-type": "python",
"plugins": [
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "python",
"extra-files": [
"google/cloud/gsuiteaddons/gapic_version.py",
"google/cloud/gsuiteaddons_v1/gapic_version.py",
{
"type": "sentence-case"
"type": "json",
"path": "samples/generated_samples/snippet_metadata_google.cloud.gsuiteaddons.v1.json",
"jsonpath": "$.clientLibrary.version"
}
],
"initial-version": "0.1.0"
}
]
}
},
"release-type": "python",
"plugins": [
{
"type": "sentence-case"
}
],
"initial-version": "0.1.0"
}
2 changes: 1 addition & 1 deletion packages/google-cloud-gsuiteaddons/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
release_status = "Development Status :: 5 - Production/Stable"

dependencies = [
"google-api-core[grpc] >= 1.33.2, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*",
"google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
"proto-plus >= 1.22.0, <2.0.0dev",
"protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
"google-apps-script-type>=0.2.0, <1.0.0dev",
Expand Down
Original file line number Diff line number Diff line change
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==1.33.2
google-api-core==1.34.0
proto-plus==1.22.0
protobuf==3.19.5
google-apps-script-typ==0.2.0
google-apps-script-type==0.2.0

0 comments on commit 2009ee7

Please sign in to comment.