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

Commit ec1f84c

Browse files
feat: add support for google.cloud.apigeeconnect.__version__ (#153)
- [ ] 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
1 parent 30faa27 commit ec1f84c

File tree

15 files changed

+169
-21
lines changed

15 files changed

+169
-21
lines changed

.github/release-please.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
releaseType: python
22
handleGHRelease: true
3+
manifest: true
34
# NOTE: this section is generated by synthtool.languages.python
45
# See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py
56
branches:

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.4.3"
3+
}

google/cloud/apigeeconnect/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from google.cloud.apigeeconnect import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
19+
1620

1721
from google.cloud.apigeeconnect_v1.services.connection_service.async_client import (
1822
ConnectionServiceAsyncClient,
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
__version__ = "1.4.3" # {x-release-please-version}

google/cloud/apigeeconnect_v1/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from google.cloud.apigeeconnect import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
19+
1620

1721
from .services.connection_service import (
1822
ConnectionServiceAsyncClient,

google/cloud/apigeeconnect_v1/services/connection_service/client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from collections import OrderedDict
1717
import os
1818
import re
19-
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
19+
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union, cast
2020

2121
from google.api_core import client_options as client_options_lib
2222
from google.api_core import exceptions as core_exceptions
@@ -331,7 +331,7 @@ def __init__(
331331
*,
332332
credentials: Optional[ga_credentials.Credentials] = None,
333333
transport: Union[str, ConnectionServiceTransport, None] = None,
334-
client_options: Optional[client_options_lib.ClientOptions] = None,
334+
client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
335335
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
336336
) -> None:
337337
"""Instantiates the connection service client.
@@ -345,7 +345,7 @@ def __init__(
345345
transport (Union[str, ConnectionServiceTransport]): The
346346
transport to use. If set to None, a transport is chosen
347347
automatically.
348-
client_options (google.api_core.client_options.ClientOptions): Custom options for the
348+
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the
349349
client. It won't take effect if a ``transport`` instance is provided.
350350
(1) The ``api_endpoint`` property can be used to override the
351351
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
@@ -375,6 +375,7 @@ def __init__(
375375
client_options = client_options_lib.from_dict(client_options)
376376
if client_options is None:
377377
client_options = client_options_lib.ClientOptions()
378+
client_options = cast(client_options_lib.ClientOptions, client_options)
378379

379380
api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source(
380381
client_options

google/cloud/apigeeconnect_v1/services/tether/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
Tuple,
2727
Type,
2828
Union,
29+
cast,
2930
)
3031

3132
from google.api_core import client_options as client_options_lib
@@ -325,7 +326,7 @@ def __init__(
325326
*,
326327
credentials: Optional[ga_credentials.Credentials] = None,
327328
transport: Union[str, TetherTransport, None] = None,
328-
client_options: Optional[client_options_lib.ClientOptions] = None,
329+
client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
329330
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
330331
) -> None:
331332
"""Instantiates the tether client.
@@ -339,7 +340,7 @@ def __init__(
339340
transport (Union[str, TetherTransport]): The
340341
transport to use. If set to None, a transport is chosen
341342
automatically.
342-
client_options (google.api_core.client_options.ClientOptions): Custom options for the
343+
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the
343344
client. It won't take effect if a ``transport`` instance is provided.
344345
(1) The ``api_endpoint`` property can be used to override the
345346
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
@@ -369,6 +370,7 @@ def __init__(
369370
client_options = client_options_lib.from_dict(client_options)
370371
if client_options is None:
371372
client_options = client_options_lib.ClientOptions()
373+
client_options = cast(client_options_lib.ClientOptions, client_options)
372374

373375
api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source(
374376
client_options

owlbot.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import json
16+
from pathlib import Path
17+
import shutil
18+
19+
import synthtool as s
20+
import synthtool.gcp as gcp
21+
from synthtool.languages import python
22+
23+
# ----------------------------------------------------------------------------
24+
# Copy the generated client from the owl-bot staging directory
25+
# ----------------------------------------------------------------------------
26+
27+
clean_up_generated_samples = True
28+
29+
# Load the default version defined in .repo-metadata.json.
30+
default_version = json.load(open(".repo-metadata.json", "rt")).get(
31+
"default_version"
32+
)
33+
34+
for library in s.get_staging_dirs(default_version):
35+
if clean_up_generated_samples:
36+
shutil.rmtree("samples/generated_samples", ignore_errors=True)
37+
clean_up_generated_samples = False
38+
s.move([library], excludes=["**/gapic_version.py"])
39+
s.remove_staging_dirs()
40+
41+
# ----------------------------------------------------------------------------
42+
# Add templated files
43+
# ----------------------------------------------------------------------------
44+
45+
templated_files = gcp.CommonTemplates().py_library(
46+
cov_level=100,
47+
microgenerator=True,
48+
versions=gcp.common.detect_versions(path="./google", default_first=True),
49+
)
50+
s.move(templated_files, excludes=[".coveragerc", ".github/release-please.yml"])
51+
52+
python.py_samples(skip_readmes=True)
53+
54+
# run format session for all directories which have a noxfile
55+
for noxfile in Path(".").glob("**/noxfile.py"):
56+
s.shell.run(["nox", "-s", "format"], cwd=noxfile.parent, hide_output=False)

release-please-config.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"packages": {
4+
".": {
5+
"release-type": "python",
6+
"extra-files": [
7+
"google/cloud/apigeeconnect/gapic_version.py",
8+
{
9+
"type": "json",
10+
"path": "samples/generated_samples/snippet_metadata_apigeeconnect_v1.json",
11+
"jsonpath": "$.clientLibrary.version"
12+
}
13+
]
14+
}
15+
},
16+
"release-type": "python",
17+
"plugins": [
18+
{
19+
"type": "sentence-case"
20+
}
21+
],
22+
"initial-version": "0.1.0"
23+
}

setup.py

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,48 @@
11
# -*- coding: utf-8 -*-
2-
#
3-
# Copyright 2020 Google LLC
2+
# Copyright 2022 Google LLC
43
#
54
# Licensed under the Apache License, Version 2.0 (the "License");
65
# you may not use this file except in compliance with the License.
76
# You may obtain a copy of the License at
87
#
9-
# https://www.apache.org/licenses/LICENSE-2.0
8+
# http://www.apache.org/licenses/LICENSE-2.0
109
#
1110
# Unless required by applicable law or agreed to in writing, software
1211
# distributed under the License is distributed on an "AS IS" BASIS,
1312
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1413
# See the License for the specific language governing permissions and
1514
# limitations under the License.
16-
15+
#
1716
import io
1817
import os
1918

20-
import setuptools
19+
import setuptools # type: ignore
20+
21+
package_root = os.path.abspath(os.path.dirname(__file__))
2122

2223
name = "google-cloud-apigee-connect"
23-
description = "Apigee Connect API client library"
24-
version = "1.4.3"
25-
release_status = "Development Status :: 5 - Production/Stable"
26-
url = "https://github.com/googleapis/python-apigee-connect"
24+
25+
26+
description = "Google Cloud Apigee Connect API client library"
27+
28+
version = {}
29+
with open(
30+
os.path.join(package_root, "google/cloud/apigeeconnect/gapic_version.py")
31+
) as fp:
32+
exec(fp.read(), version)
33+
version = version["__version__"]
34+
35+
if version[0] == "0":
36+
release_status = "Development Status :: 4 - Beta"
37+
else:
38+
release_status = "Development Status :: 5 - Production/Stable"
39+
2740
dependencies = [
28-
"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.*",
41+
"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.*",
2942
"proto-plus >= 1.22.0, <2.0.0dev",
3043
"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",
3144
]
45+
url = "https://github.com/googleapis/python-apigee-connect"
3246

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

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

49-
5063
setuptools.setup(
5164
name=name,
5265
version=version,

0 commit comments

Comments
 (0)