Skip to content

Commit

Permalink
feat: add support for google.cloud.apigeeconnect.__version__ (#153)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

BEGIN_COMMIT_OVERRIDE
feat: add support for `google.cloud.apigeeconnect.__version__`
fix: Add dict typing for client_options
chore: use autogenerated setup.py
chore: update to gapic-generator-python 1.5.0
fix(deps): require google-api-core >=1.33.2
END_COMMIT_OVERRIDE


PiperOrigin-RevId: 484665853

Source-Link: https://togithub.com/googleapis/googleapis/commit/8eb249a19db926c2fbc4ecf1dc09c0e521a88b22

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/c8aa327b5f478865fc3fd91e3c2768e54e26ad44
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzhhYTMyN2I1ZjQ3ODg2NWZjM2ZkOTFlM2MyNzY4ZTU0ZTI2YWQ0NCJ9
  • Loading branch information
gcf-owl-bot[bot] authored Nov 8, 2022
1 parent a2ab92b commit e7416f3
Show file tree
Hide file tree
Showing 15 changed files with 169 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
releaseType: python
handleGHRelease: true
manifest: true
# NOTE: this section is generated by synthtool.languages.python
# See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py
branches:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.4.3"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from google.cloud.apigeeconnect import gapic_version as package_version

__version__ = package_version.__version__


from google.cloud.apigeeconnect_v1.services.connection_service.async_client import (
ConnectionServiceAsyncClient,
Expand Down
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__ = "1.4.3" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from google.cloud.apigeeconnect import gapic_version as package_version

__version__ = package_version.__version__


from .services.connection_service import (
ConnectionServiceAsyncClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from collections import OrderedDict
import os
import re
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union, cast

from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as core_exceptions
Expand Down Expand Up @@ -331,7 +331,7 @@ def __init__(
*,
credentials: Optional[ga_credentials.Credentials] = None,
transport: Union[str, ConnectionServiceTransport, None] = None,
client_options: Optional[client_options_lib.ClientOptions] = None,
client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiates the connection service client.
Expand All @@ -345,7 +345,7 @@ def __init__(
transport (Union[str, ConnectionServiceTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
client_options (google.api_core.client_options.ClientOptions): Custom options for the
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
Expand Down Expand Up @@ -375,6 +375,7 @@ def __init__(
client_options = client_options_lib.from_dict(client_options)
if client_options is None:
client_options = client_options_lib.ClientOptions()
client_options = cast(client_options_lib.ClientOptions, client_options)

api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source(
client_options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
Tuple,
Type,
Union,
cast,
)

from google.api_core import client_options as client_options_lib
Expand Down Expand Up @@ -325,7 +326,7 @@ def __init__(
*,
credentials: Optional[ga_credentials.Credentials] = None,
transport: Union[str, TetherTransport, None] = None,
client_options: Optional[client_options_lib.ClientOptions] = None,
client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiates the tether client.
Expand All @@ -339,7 +340,7 @@ def __init__(
transport (Union[str, TetherTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
client_options (google.api_core.client_options.ClientOptions): Custom options for the
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
Expand Down Expand Up @@ -369,6 +370,7 @@ def __init__(
client_options = client_options_lib.from_dict(client_options)
if client_options is None:
client_options = client_options_lib.ClientOptions()
client_options = cast(client_options_lib.ClientOptions, client_options)

api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source(
client_options
Expand Down
56 changes: 56 additions & 0 deletions packages/google-cloud-apigee-connect/owlbot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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.

import json
from pathlib import Path
import shutil

import synthtool as s
import synthtool.gcp as gcp
from synthtool.languages import python

# ----------------------------------------------------------------------------
# Copy the generated client from the owl-bot staging directory
# ----------------------------------------------------------------------------

clean_up_generated_samples = True

# Load the default version defined in .repo-metadata.json.
default_version = json.load(open(".repo-metadata.json", "rt")).get(
"default_version"
)

for library in s.get_staging_dirs(default_version):
if clean_up_generated_samples:
shutil.rmtree("samples/generated_samples", ignore_errors=True)
clean_up_generated_samples = False
s.move([library], excludes=["**/gapic_version.py"])
s.remove_staging_dirs()

# ----------------------------------------------------------------------------
# Add templated files
# ----------------------------------------------------------------------------

templated_files = gcp.CommonTemplates().py_library(
cov_level=100,
microgenerator=True,
versions=gcp.common.detect_versions(path="./google", default_first=True),
)
s.move(templated_files, excludes=[".coveragerc", ".github/release-please.yml"])

python.py_samples(skip_readmes=True)

# run format session for all directories which have a noxfile
for noxfile in Path(".").glob("**/noxfile.py"):
s.shell.run(["nox", "-s", "format"], cwd=noxfile.parent, hide_output=False)
23 changes: 23 additions & 0 deletions packages/google-cloud-apigee-connect/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "python",
"extra-files": [
"google/cloud/apigeeconnect/gapic_version.py",
{
"type": "json",
"path": "samples/generated_samples/snippet_metadata_apigeeconnect_v1.json",
"jsonpath": "$.clientLibrary.version"
}
]
}
},
"release-type": "python",
"plugins": [
{
"type": "sentence-case"
}
],
"initial-version": "0.1.0"
}
35 changes: 24 additions & 11 deletions packages/google-cloud-apigee-connect/setup.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,48 @@
# -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
# 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.

#
import io
import os

import setuptools
import setuptools # type: ignore

package_root = os.path.abspath(os.path.dirname(__file__))

name = "google-cloud-apigee-connect"
description = "Apigee Connect API client library"
version = "1.4.3"
release_status = "Development Status :: 5 - Production/Stable"
url = "https://github.com/googleapis/python-apigee-connect"


description = "Google Cloud Apigee Connect API client library"

version = {}
with open(
os.path.join(package_root, "google/cloud/apigeeconnect/gapic_version.py")
) as fp:
exec(fp.read(), version)
version = version["__version__"]

if version[0] == "0":
release_status = "Development Status :: 4 - Beta"
else:
release_status = "Development Status :: 5 - Production/Stable"

dependencies = [
"google-api-core[grpc] >= 1.32.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*",
"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.*",
"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",
]
url = "https://github.com/googleapis/python-apigee-connect"

package_root = os.path.abspath(os.path.dirname(__file__))

Expand All @@ -46,7 +60,6 @@
if "google.cloud" in packages:
namespaces.append("google.cloud")


setuptools.setup(
name=name,
version=version,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# This constraints file is required for unit tests.
# List all library dependencies and extras in this file.
google-api-core
proto-plus
protobuf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# This constraints file is required for unit tests.
# List all library dependencies and extras in this file.
google-api-core
proto-plus
protobuf
11 changes: 6 additions & 5 deletions packages/google-cloud-apigee-connect/testing/constraints-3.7.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# This constraints file is used to check that lower bounds
# are correct in setup.py
# List *all* library dependencies and extras in this file.
# List all library dependencies and extras in this file.
# Pin the version to the lower bound.
#
# 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.32.0
# 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
# This file is intentionally left empty to test the
# latest versions of dependencies.
google-api-core==1.33.2
proto-plus==1.22.0
protobuf==3.19.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# This constraints file is required for unit tests.
# List all library dependencies and extras in this file.
google-api-core
proto-plus
protobuf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# This constraints file is required for unit tests.
# List all library dependencies and extras in this file.
google-api-core
proto-plus
protobuf

0 comments on commit e7416f3

Please sign in to comment.