Skip to content

Commit

Permalink
chore: use gapic-generator-python 0.56.2 (#136)
Browse files Browse the repository at this point in the history
* chore(python): Update iam/credentials BUILD.bazel package name to google-cloud-iam chore(python): Update iam/credentials namespace to google.cloud.iam_credentials

PiperOrigin-RevId: 408717007

Source-Link: googleapis/googleapis@171d777

Source-Link: googleapis/googleapis-gen@a0ada0e
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTBhZGEwZTRlZThmMDBjODlmMGFmYjhiMjRmYTU1NTMzYTQ5NzMyNyJ9

* 🦉 Updates from OwlBot

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

* remove obsolete files

* delete owlbot.py

* run owlbot cli locally

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people committed Nov 10, 2021
1 parent 599fb09 commit beab363
Show file tree
Hide file tree
Showing 21 changed files with 2,119 additions and 147 deletions.
21 changes: 2 additions & 19 deletions packages/google-cloud-iam/.coveragerc
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
# -*- coding: utf-8 -*-
#
# Copyright 2020 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
#
# https://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.

# Generated by synthtool. DO NOT EDIT!
[run]
branch = True

[report]
fail_under = 100
show_missing = True
omit = google/cloud/iam_credentials_v1/__init__.py
omit =
google/cloud/iam_credentials/__init__.py
exclude_lines =
# Re-enable the standard pragma
pragma: NO COVER
Expand Down
6 changes: 0 additions & 6 deletions packages/google-cloud-iam/docs/credentials_v1/services.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Services for Google Cloud Iam Credentials v1 API
================================================
.. toctree::
:maxdepth: 2

iam_credentials
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Types for Google Iam Credentials v1 API
=======================================
Types for Google Cloud Iam Credentials v1 API
=============================================

.. automodule:: google.cloud.iam_credentials_v1.types
:members:
Expand Down
16 changes: 8 additions & 8 deletions packages/google-cloud-iam/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
API Reference
-------------
.. toctree::
:maxdepth: 2
:maxdepth: 2

credentials_v1/services
credentials_v1/types
iam_credentials_v1/services
iam_credentials_v1/types


Migration Guide
---------------

See the guide below for instructions on migrating to the 2.x release of this library.
See the guide below for instructions on migrating to the latest version.

.. toctree::
:maxdepth: 2
:maxdepth: 2

UPGRADING
 UPGRADING


Changelog
Expand All @@ -29,6 +29,6 @@ Changelog
For a list of all ``google-cloud-iam`` releases:

.. toctree::
:maxdepth: 2
:maxdepth: 2

changelog
changelog
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Marker file for PEP 561.
# The google-iam-credentials package uses inline types.
# The google-cloud-iam package uses inline types.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"comment": "This file maps proto services/RPCs to the corresponding library clients/methods",
"language": "python",
"libraryPackage": "google.iam.credentials_v1",
"libraryPackage": "google.cloud.iam_credentials_v1",
"protoPackage": "google.iam.credentials.v1",
"schema": "1.0",
"services": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Marker file for PEP 561.
# The google-iam-credentials package uses inline types.
# The google-cloud-iam package uses inline types.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources

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.api_core.client_options import ClientOptions
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]
try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore

from google.cloud.iam_credentials_v1.types import common
from google.protobuf import duration_pb2 # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,25 @@
# limitations under the License.
#
from collections import OrderedDict
from distutils import util
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core import client_options as client_options_lib # 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.api_core import client_options as client_options_lib
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport import mtls # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]
try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore

from google.cloud.iam_credentials_v1.types import common
from google.protobuf import duration_pb2 # type: ignore
Expand Down Expand Up @@ -294,8 +296,15 @@ def __init__(
client_options = client_options_lib.ClientOptions()

# Create SSL credentials for mutual TLS if needed.
use_client_cert = bool(
util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"))
if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") not in (
"true",
"false",
):
raise ValueError(
"Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`"
)
use_client_cert = (
os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true"
)

client_cert_source_func = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
import pkg_resources

import google.auth # type: ignore
import google.api_core # 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
import google.api_core
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union

from google.api_core import grpc_helpers # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import grpc_helpers
from google.api_core import gapic_v1
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import warnings
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union

from google.api_core import gapic_v1 # type: ignore
from google.api_core import grpc_helpers_async # type: ignore
from google.api_core import gapic_v1
from google.api_core import grpc_helpers_async
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore

Expand Down
3 changes: 3 additions & 0 deletions packages/google-cloud-iam/mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[mypy]
python_version = 3.6
namespace_packages = True
2 changes: 1 addition & 1 deletion packages/google-cloud-iam/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,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=99")
session.run("coverage", "report", "--show-missing", "--fail-under=100")

session.run("coverage", "erase")

Expand Down
83 changes: 0 additions & 83 deletions packages/google-cloud-iam/owlbot.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def partition(
return results[1], results[0]


class credentialsCallTransformer(cst.CSTTransformer):
class iam_credentialsCallTransformer(cst.CSTTransformer):
CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata')
METHOD_TO_PARAMS: Dict[str, Tuple[str]] = {
'generate_access_token': ('name', 'scope', 'delegates', 'lifetime', ),
Expand Down Expand Up @@ -91,7 +91,7 @@ def fix_files(
in_dir: pathlib.Path,
out_dir: pathlib.Path,
*,
transformer=credentialsCallTransformer(),
transformer=iam_credentialsCallTransformer(),
):
"""Duplicate the input dir to the output dir, fixing file method calls.
Expand Down Expand Up @@ -124,7 +124,7 @@ def fix_files(

if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="""Fix up source that uses the credentials client library.
description="""Fix up source that uses the iam_credentials client library.
The existing sources are NOT overwritten but are copied to output_dir with changes made.
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-iam/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
install_requires=dependencies,
extras_require={"fixup": ["libcst >= 0.2.5"]},
python_requires=">=3.6",
scripts=["scripts/fixup_credentials_v1_keywords.py"],
scripts=["scripts/fixup_iam_credentials_v1_keywords.py"],
include_package_data=True,
zip_safe=False,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# Copyright 2020 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.
#
Loading

0 comments on commit beab363

Please sign in to comment.