From 5ee54e0728cb5a745f2dafe0981384b38925f515 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 25 Oct 2021 20:37:01 -0400 Subject: [PATCH 1/3] chore(python): push cloud library docs to staging bucket for Cloud RAD (#4) Source-Link: https://github.com/googleapis/synthtool/commit/7fd61f8efae782a7cfcecc599faf52f9737fe584 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:4ee57a76a176ede9087c14330c625a71553cf9c72828b2c0ca12f5338171ba60 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 16 +--------------- .kokoro/docs/common.cfg | 1 + noxfile.py | 2 +- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 42695f9..108063d 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,17 +1,3 @@ -# Copyright 2021 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. - docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:58f73ba196b5414782605236dd0712a73541b44ff2ff4d3a36ec41092dd6fa5b + digest: sha256:4ee57a76a176ede9087c14330c625a71553cf9c72828b2c0ca12f5338171ba60 diff --git a/.kokoro/docs/common.cfg b/.kokoro/docs/common.cfg index 91ee824..ea19cc6 100644 --- a/.kokoro/docs/common.cfg +++ b/.kokoro/docs/common.cfg @@ -30,6 +30,7 @@ env_vars: { env_vars: { key: "V2_STAGING_BUCKET" + # Push google cloud library docs to the Cloud RAD bucket `docs-staging-v2` value: "docs-staging-v2" } diff --git a/noxfile.py b/noxfile.py index 2bb4cf7..2a2001c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -101,7 +101,7 @@ def default(session): "py.test", "--quiet", f"--junitxml=unit_{session.python}_sponge_log.xml", - "--cov=google/cloud", + "--cov=google", "--cov=tests/unit", "--cov-append", "--cov-config=.coveragerc", From 9feb499955b72a236e6ef2c7041bb3d413888bc3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 1 Nov 2021 00:14:12 +0000 Subject: [PATCH 2/3] chore: use gapic-generator-python 0.53.4 (#9) - [ ] 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: https://github.com/googleapis/googleapis/commit/83d81b0c8fc22291a13398d6d77f02dc97a5b6f4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/2ff001fbacb9e77e71d734de5f955c05fdae8526 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZmMDAxZmJhY2I5ZTc3ZTcxZDczNGRlNWY5NTVjMDVmZGFlODUyNiJ9 --- .../services/metrics_scopes/async_client.py | 30 ++--- .../services/metrics_scopes/client.py | 10 +- .../metrics_scopes/transports/base.py | 37 +----- .../metrics_scopes/transports/grpc.py | 2 +- .../metrics_scopes/transports/grpc_asyncio.py | 3 +- setup.py | 3 +- testing/constraints-3.6.txt | 6 +- .../test_metrics_scopes.py | 106 ++---------------- 8 files changed, 38 insertions(+), 159 deletions(-) diff --git a/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/async_client.py b/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/async_client.py index 41fff59..88edd99 100644 --- a/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/async_client.py +++ b/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/async_client.py @@ -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.monitoring_metrics_scope_v1.types import metrics_scope @@ -175,17 +177,17 @@ def __init__( async def get_metrics_scope( self, - request: metrics_scopes.GetMetricsScopeRequest = None, + request: Union[metrics_scopes.GetMetricsScopeRequest, dict] = None, *, name: str = None, - retry: retries.Retry = gapic_v1.method.DEFAULT, + retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> metrics_scope.MetricsScope: r"""Returns a specific ``Metrics Scope``. Args: - request (:class:`google.cloud.monitoring_metrics_scope_v1.types.GetMetricsScopeRequest`): + request (Union[google.cloud.monitoring_metrics_scope_v1.types.GetMetricsScopeRequest, dict]): The request object. Request for the `GetMetricsScope` method. name (:class:`str`): @@ -250,9 +252,11 @@ async def get_metrics_scope( async def list_metrics_scopes_by_monitored_project( self, - request: metrics_scopes.ListMetricsScopesByMonitoredProjectRequest = None, + request: Union[ + metrics_scopes.ListMetricsScopesByMonitoredProjectRequest, dict + ] = None, *, - retry: retries.Retry = gapic_v1.method.DEFAULT, + retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> metrics_scopes.ListMetricsScopesByMonitoredProjectResponse: @@ -262,7 +266,7 @@ async def list_metrics_scopes_by_monitored_project( first entry in the response. Args: - request (:class:`google.cloud.monitoring_metrics_scope_v1.types.ListMetricsScopesByMonitoredProjectRequest`): + request (Union[google.cloud.monitoring_metrics_scope_v1.types.ListMetricsScopesByMonitoredProjectRequest, dict]): The request object. Request for the `ListMetricsScopesByMonitoredProject` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -296,11 +300,11 @@ async def list_metrics_scopes_by_monitored_project( async def create_monitored_project( self, - request: metrics_scopes.CreateMonitoredProjectRequest = None, + request: Union[metrics_scopes.CreateMonitoredProjectRequest, dict] = None, *, parent: str = None, monitored_project: metrics_scope.MonitoredProject = 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: @@ -308,7 +312,7 @@ async def create_monitored_project( specified ``Metrics Scope``. Args: - request (:class:`google.cloud.monitoring_metrics_scope_v1.types.CreateMonitoredProjectRequest`): + request (Union[google.cloud.monitoring_metrics_scope_v1.types.CreateMonitoredProjectRequest, dict]): The request object. Request for the `CreateMonitoredProject` method. parent (:class:`str`): @@ -395,10 +399,10 @@ async def create_monitored_project( async def delete_monitored_project( self, - request: metrics_scopes.DeleteMonitoredProjectRequest = None, + request: Union[metrics_scopes.DeleteMonitoredProjectRequest, dict] = None, *, name: str = 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: @@ -406,7 +410,7 @@ async def delete_monitored_project( ``Metrics Scope``. Args: - request (:class:`google.cloud.monitoring_metrics_scope_v1.types.DeleteMonitoredProjectRequest`): + request (Union[google.cloud.monitoring_metrics_scope_v1.types.DeleteMonitoredProjectRequest, dict]): The request object. Request for the `DeleteMonitoredProject` method. name (:class:`str`): diff --git a/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/client.py b/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/client.py index bac8f22..9e2722c 100644 --- a/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/client.py +++ b/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/client.py @@ -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.monitoring_metrics_scope_v1.types import metrics_scope @@ -369,7 +371,7 @@ def get_metrics_scope( request: Union[metrics_scopes.GetMetricsScopeRequest, dict] = None, *, name: str = None, - retry: retries.Retry = gapic_v1.method.DEFAULT, + retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> metrics_scope.MetricsScope: @@ -445,7 +447,7 @@ def list_metrics_scopes_by_monitored_project( metrics_scopes.ListMetricsScopesByMonitoredProjectRequest, dict ] = None, *, - retry: retries.Retry = gapic_v1.method.DEFAULT, + retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> metrics_scopes.ListMetricsScopesByMonitoredProjectResponse: @@ -498,7 +500,7 @@ def create_monitored_project( *, parent: str = None, monitored_project: metrics_scope.MonitoredProject = None, - retry: retries.Retry = gapic_v1.method.DEFAULT, + retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: @@ -596,7 +598,7 @@ def delete_monitored_project( request: Union[metrics_scopes.DeleteMonitoredProjectRequest, dict] = None, *, name: str = None, - retry: retries.Retry = gapic_v1.method.DEFAULT, + retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: diff --git a/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/transports/base.py b/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/transports/base.py index 878ce07..b773f4e 100644 --- a/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/transports/base.py +++ b/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/transports/base.py @@ -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 @@ -40,15 +39,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 MetricsScopesTransport(abc.ABC): """Abstract transport class for MetricsScopes.""" @@ -103,7 +93,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 @@ -136,29 +126,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 = { @@ -192,7 +159,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() diff --git a/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/transports/grpc.py b/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/transports/grpc.py index eabc791..72f41fc 100644 --- a/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/transports/grpc.py +++ b/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/transports/grpc.py @@ -114,7 +114,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) diff --git a/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/transports/grpc_asyncio.py b/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/transports/grpc_asyncio.py index 1fede59..b23b35e 100644 --- a/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/transports/grpc_asyncio.py +++ b/google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/transports/grpc_asyncio.py @@ -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 @@ -161,7 +160,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) diff --git a/setup.py b/setup.py index cd23c60..56a8147 100644 --- a/setup.py +++ b/setup.py @@ -39,9 +39,8 @@ platforms="Posix; MacOS X; Windows", include_package_data=True, install_requires=( - "google-api-core[grpc] >= 1.27.0, < 3.0.0dev", + "google-api-core[grpc] >= 1.28.0, < 3.0.0dev", "proto-plus >= 1.15.0", - "packaging >= 14.3", ), python_requires=">=3.6", classifiers=[ diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt index 489858c..aff6bee 100644 --- a/testing/constraints-3.6.txt +++ b/testing/constraints-3.6.txt @@ -5,9 +5,5 @@ # # e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", # Then this file should have foo==1.14.0 -google-api-core==1.27.0 +google-api-core==1.28.0 proto-plus==1.15.0 -packaging==14.3 -# TODO: remove when google-auth>=1.25.0 is required transitively through -# google-api-core >= 1.28.0 -google-auth==1.24.0 \ No newline at end of file diff --git a/tests/unit/gapic/monitoring_metrics_scope_v1/test_metrics_scopes.py b/tests/unit/gapic/monitoring_metrics_scope_v1/test_metrics_scopes.py index a27a583..713b960 100644 --- a/tests/unit/gapic/monitoring_metrics_scope_v1/test_metrics_scopes.py +++ b/tests/unit/gapic/monitoring_metrics_scope_v1/test_metrics_scopes.py @@ -15,7 +15,6 @@ # import os import mock -import packaging.version import grpc from grpc.experimental import aio @@ -42,9 +41,6 @@ MetricsScopesClient, ) from google.cloud.monitoring_metrics_scope_v1.services.metrics_scopes import transports -from google.cloud.monitoring_metrics_scope_v1.services.metrics_scopes.transports.base import ( - _GOOGLE_AUTH_VERSION, -) from google.cloud.monitoring_metrics_scope_v1.types import metrics_scope from google.cloud.monitoring_metrics_scope_v1.types import metrics_scopes from google.longrunning import operations_pb2 @@ -53,20 +49,6 @@ import google.auth -# TODO(busunkim): Once google-auth >= 1.25.0 is required transitively -# through google-api-core: -# - Delete the auth "less than" test cases -# - Delete these pytest markers (Make the "greater than or equal to" tests the default). -requires_google_auth_lt_1_25_0 = pytest.mark.skipif( - packaging.version.parse(_GOOGLE_AUTH_VERSION) >= packaging.version.parse("1.25.0"), - reason="This test requires google-auth < 1.25.0", -) -requires_google_auth_gte_1_25_0 = pytest.mark.skipif( - packaging.version.parse(_GOOGLE_AUTH_VERSION) < packaging.version.parse("1.25.0"), - reason="This test requires google-auth >= 1.25.0", -) - - def client_cert_source_callback(): return b"cert bytes", b"key bytes" @@ -223,7 +205,7 @@ def test_metrics_scopes_client_client_options( options = client_options.ClientOptions(api_endpoint="squid.clam.whelk") with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(client_options=options) + client = client_class(transport=transport_name, client_options=options) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -240,7 +222,7 @@ def test_metrics_scopes_client_client_options( with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class() + client = client_class(transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -257,7 +239,7 @@ def test_metrics_scopes_client_client_options( with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class() + client = client_class(transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -286,7 +268,7 @@ def test_metrics_scopes_client_client_options( options = client_options.ClientOptions(quota_project_id="octopus") with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(client_options=options) + client = client_class(transport=transport_name, client_options=options) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -345,7 +327,7 @@ def test_metrics_scopes_client_mtls_env_auto( ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(client_options=options) + client = client_class(transport=transport_name, client_options=options) if use_client_cert_env == "false": expected_client_cert_source = None @@ -387,7 +369,7 @@ def test_metrics_scopes_client_mtls_env_auto( expected_client_cert_source = client_cert_source_callback patched.return_value = None - client = client_class() + client = client_class(transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -409,7 +391,7 @@ def test_metrics_scopes_client_mtls_env_auto( return_value=False, ): patched.return_value = None - client = client_class() + client = client_class(transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -440,7 +422,7 @@ def test_metrics_scopes_client_client_options_scopes( options = client_options.ClientOptions(scopes=["1", "2"],) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(client_options=options) + client = client_class(transport=transport_name, client_options=options) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -471,7 +453,7 @@ def test_metrics_scopes_client_client_options_credentials_file( options = client_options.ClientOptions(credentials_file="credentials.json") with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(client_options=options) + client = client_class(transport=transport_name, client_options=options) patched.assert_called_once_with( credentials=None, credentials_file="credentials.json", @@ -1372,7 +1354,6 @@ def test_metrics_scopes_base_transport(): transport.operations_client -@requires_google_auth_gte_1_25_0 def test_metrics_scopes_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file with mock.patch.object( @@ -1398,31 +1379,6 @@ def test_metrics_scopes_base_transport_with_credentials_file(): ) -@requires_google_auth_lt_1_25_0 -def test_metrics_scopes_base_transport_with_credentials_file_old_google_auth(): - # Instantiate the base transport with a credentials file - with mock.patch.object( - google.auth, "load_credentials_from_file", autospec=True - ) as load_creds, mock.patch( - "google.cloud.monitoring_metrics_scope_v1.services.metrics_scopes.transports.MetricsScopesTransport._prep_wrapped_messages" - ) as Transport: - Transport.return_value = None - load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) - transport = transports.MetricsScopesTransport( - credentials_file="credentials.json", quota_project_id="octopus", - ) - load_creds.assert_called_once_with( - "credentials.json", - scopes=( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/monitoring", - "https://www.googleapis.com/auth/monitoring.read", - "https://www.googleapis.com/auth/monitoring.write", - ), - quota_project_id="octopus", - ) - - def test_metrics_scopes_base_transport_with_adc(): # Test the default credentials are used if credentials and credentials_file are None. with mock.patch.object(google.auth, "default", autospec=True) as adc, mock.patch( @@ -1434,7 +1390,6 @@ def test_metrics_scopes_base_transport_with_adc(): adc.assert_called_once() -@requires_google_auth_gte_1_25_0 def test_metrics_scopes_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: @@ -1452,23 +1407,6 @@ def test_metrics_scopes_auth_adc(): ) -@requires_google_auth_lt_1_25_0 -def test_metrics_scopes_auth_adc_old_google_auth(): - # If no credentials are provided, we should use ADC credentials. - with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (ga_credentials.AnonymousCredentials(), None) - MetricsScopesClient() - adc.assert_called_once_with( - scopes=( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/monitoring", - "https://www.googleapis.com/auth/monitoring.read", - "https://www.googleapis.com/auth/monitoring.write", - ), - quota_project_id=None, - ) - - @pytest.mark.parametrize( "transport_class", [ @@ -1476,7 +1414,6 @@ def test_metrics_scopes_auth_adc_old_google_auth(): transports.MetricsScopesGrpcAsyncIOTransport, ], ) -@requires_google_auth_gte_1_25_0 def test_metrics_scopes_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. @@ -1495,31 +1432,6 @@ def test_metrics_scopes_transport_auth_adc(transport_class): ) -@pytest.mark.parametrize( - "transport_class", - [ - transports.MetricsScopesGrpcTransport, - transports.MetricsScopesGrpcAsyncIOTransport, - ], -) -@requires_google_auth_lt_1_25_0 -def test_metrics_scopes_transport_auth_adc_old_google_auth(transport_class): - # If credentials and host are not provided, the transport class should use - # ADC credentials. - with mock.patch.object(google.auth, "default", autospec=True) as adc: - adc.return_value = (ga_credentials.AnonymousCredentials(), None) - transport_class(quota_project_id="octopus") - adc.assert_called_once_with( - scopes=( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/monitoring", - "https://www.googleapis.com/auth/monitoring.read", - "https://www.googleapis.com/auth/monitoring.write", - ), - quota_project_id="octopus", - ) - - @pytest.mark.parametrize( "transport_class,grpc_helpers", [ From 8568b9e5d3d91278dd8914aa9ea9bdcd4b12a48b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 2 Nov 2021 17:50:25 +0000 Subject: [PATCH 3/3] chore: release 0.1.1 (#10) :robot: I have created a release \*beep\* \*boop\* --- ### [0.1.1](https://www.github.com/googleapis/python-monitoring-metrics-scopes/compare/v0.1.0...v0.1.1) (2021-11-01) ### Bug Fixes * **deps:** drop packaging dependency ([9feb499](https://www.github.com/googleapis/python-monitoring-metrics-scopes/commit/9feb499955b72a236e6ef2c7041bb3d413888bc3)) * **deps:** require google-api-core >= 1.28.0 ([9feb499](https://www.github.com/googleapis/python-monitoring-metrics-scopes/commit/9feb499955b72a236e6ef2c7041bb3d413888bc3)) ### Documentation * list oneofs in docstring ([9feb499](https://www.github.com/googleapis/python-monitoring-metrics-scopes/commit/9feb499955b72a236e6ef2c7041bb3d413888bc3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 13 +++++++++++++ setup.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c717de9..aa2222e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +### [0.1.1](https://www.github.com/googleapis/python-monitoring-metrics-scopes/compare/v0.1.0...v0.1.1) (2021-11-01) + + +### Bug Fixes + +* **deps:** drop packaging dependency ([9feb499](https://www.github.com/googleapis/python-monitoring-metrics-scopes/commit/9feb499955b72a236e6ef2c7041bb3d413888bc3)) +* **deps:** require google-api-core >= 1.28.0 ([9feb499](https://www.github.com/googleapis/python-monitoring-metrics-scopes/commit/9feb499955b72a236e6ef2c7041bb3d413888bc3)) + + +### Documentation + +* list oneofs in docstring ([9feb499](https://www.github.com/googleapis/python-monitoring-metrics-scopes/commit/9feb499955b72a236e6ef2c7041bb3d413888bc3)) + ## 0.1.0 (2021-10-25) diff --git a/setup.py b/setup.py index 56a8147..55772d5 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ import os import setuptools # type: ignore -version = "0.1.0" +version = "0.1.1" package_root = os.path.abspath(os.path.dirname(__file__))