Skip to content

Commit b718d1f

Browse files
committed
feat: generate libraries
1 parent 636a536 commit b718d1f

File tree

207 files changed

+1792
-554
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+1792
-554
lines changed

.librarian/state.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-li
22
libraries:
33
- id: google-cloud-bigtable
44
version: 2.34.0
5-
last_generated_commit: a17b84add8318f780fcc8a027815d5fee644b9f7
5+
last_generated_commit: 4eccddb5094aadc369f349cd468222adc5d01a91
66
apis:
77
- path: google/bigtable/v2
88
service_config: bigtable_v2.yaml

docs/admin_client/bigtable_instance_admin.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# DO NOT EDIT THIS FILE OUTSIDE OF `.librarian/generator-input`
2+
# The source of truth for this file is `.librarian/generator-input`
3+
14
BigtableInstanceAdmin
25
---------------------------------------
36

docs/admin_client/bigtable_table_admin.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# DO NOT EDIT THIS FILE OUTSIDE OF `.librarian/generator-input`
2+
# The source of truth for this file is `.librarian/generator-input`
3+
14
BigtableTableAdmin
25
------------------------------------
36

docs/admin_client/services_.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# DO NOT EDIT THIS FILE OUTSIDE OF `.librarian/generator-input`
2+
# The source of truth for this file is `.librarian/generator-input`
3+
14
Services for Google Cloud Bigtable Admin v2 API
25
===============================================
36
.. toctree::

docs/admin_client/types_.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# DO NOT EDIT THIS FILE OUTSIDE OF `.librarian/generator-input`
2+
# The source of truth for this file is `.librarian/generator-input`
3+
14
Types for Google Cloud Bigtable Admin v2 API
25
============================================
36

google/cloud/bigtable_admin/__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+
17+
# DO NOT EDIT THIS FILE OUTSIDE OF `.librarian/generator-input`
18+
# The source of truth for this file is `.librarian/generator-input`
19+
1620
from google.cloud.bigtable_admin import gapic_version as package_version
1721

1822
__version__ = package_version.__version__

google/cloud/bigtable_admin/gapic_version.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
17+
# DO NOT EDIT THIS FILE OUTSIDE OF `.librarian/generator-input`
18+
# The source of truth for this file is `.librarian/generator-input`
19+
1620
__version__ = "2.34.0" # {x-release-please-version}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
# Marker file for PEP 561.
22
# The google-cloud-bigtable-admin package uses inline types.
3+
4+
# DO NOT EDIT THIS FILE OUTSIDE OF `.librarian/generator-input`
5+
# The source of truth for this file is `.librarian/generator-input`
6+

google/cloud/bigtable_admin_v2/__init__.py

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,24 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
17+
# DO NOT EDIT THIS FILE OUTSIDE OF `.librarian/generator-input`
18+
# The source of truth for this file is `.librarian/generator-input`
19+
1620
from google.cloud.bigtable_admin_v2 import gapic_version as package_version
1721

22+
import google.api_core as api_core
23+
import sys
24+
1825
__version__ = package_version.__version__
1926

27+
if sys.version_info >= (3, 8): # pragma: NO COVER
28+
from importlib import metadata
29+
else: # pragma: NO COVER
30+
# TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
31+
# this code path once we drop support for Python 3.7
32+
import importlib_metadata as metadata
33+
2034

2135
from .services.bigtable_instance_admin import BigtableInstanceAdminClient
2236
from .services.bigtable_instance_admin import BigtableInstanceAdminAsyncClient
@@ -143,6 +157,100 @@
143157
from .types.table import RestoreSourceType
144158
from .types.types import Type
145159

160+
if hasattr(api_core, "check_python_version") and hasattr(
161+
api_core, "check_dependency_versions"
162+
): # pragma: NO COVER
163+
api_core.check_python_version("google.cloud.bigtable_admin_v2") # type: ignore
164+
api_core.check_dependency_versions("google.cloud.bigtable_admin_v2") # type: ignore
165+
else: # pragma: NO COVER
166+
# An older version of api_core is installed which does not define the
167+
# functions above. We do equivalent checks manually.
168+
try:
169+
import warnings
170+
import sys
171+
172+
_py_version_str = sys.version.split()[0]
173+
_package_label = "google.cloud.bigtable_admin_v2"
174+
if sys.version_info < (3, 9):
175+
warnings.warn(
176+
"You are using a non-supported Python version "
177+
+ f"({_py_version_str}). Google will not post any further "
178+
+ f"updates to {_package_label} supporting this Python version. "
179+
+ "Please upgrade to the latest Python version, or at "
180+
+ f"least to Python 3.9, and then update {_package_label}.",
181+
FutureWarning,
182+
)
183+
if sys.version_info[:2] == (3, 9):
184+
warnings.warn(
185+
f"You are using a Python version ({_py_version_str}) "
186+
+ f"which Google will stop supporting in {_package_label} in "
187+
+ "January 2026. Please "
188+
+ "upgrade to the latest Python version, or at "
189+
+ "least to Python 3.10, before then, and "
190+
+ f"then update {_package_label}.",
191+
FutureWarning,
192+
)
193+
194+
def parse_version_to_tuple(version_string: str):
195+
"""Safely converts a semantic version string to a comparable tuple of integers.
196+
Example: "4.25.8" -> (4, 25, 8)
197+
Ignores non-numeric parts and handles common version formats.
198+
Args:
199+
version_string: Version string in the format "x.y.z" or "x.y.z<suffix>"
200+
Returns:
201+
Tuple of integers for the parsed version string.
202+
"""
203+
parts = []
204+
for part in version_string.split("."):
205+
try:
206+
parts.append(int(part))
207+
except ValueError:
208+
# If it's a non-numeric part (e.g., '1.0.0b1' -> 'b1'), stop here.
209+
# This is a simplification compared to 'packaging.parse_version', but sufficient
210+
# for comparing strictly numeric semantic versions.
211+
break
212+
return tuple(parts)
213+
214+
def _get_version(dependency_name):
215+
try:
216+
version_string: str = metadata.version(dependency_name)
217+
parsed_version = parse_version_to_tuple(version_string)
218+
return (parsed_version, version_string)
219+
except Exception:
220+
# Catch exceptions from metadata.version() (e.g., PackageNotFoundError)
221+
# or errors during parse_version_to_tuple
222+
return (None, "--")
223+
224+
_dependency_package = "google.protobuf"
225+
_next_supported_version = "4.25.8"
226+
_next_supported_version_tuple = (4, 25, 8)
227+
_recommendation = " (we recommend 6.x)"
228+
(_version_used, _version_used_string) = _get_version(_dependency_package)
229+
if _version_used and _version_used < _next_supported_version_tuple:
230+
warnings.warn(
231+
f"Package {_package_label} depends on "
232+
+ f"{_dependency_package}, currently installed at version "
233+
+ f"{_version_used_string}. Future updates to "
234+
+ f"{_package_label} will require {_dependency_package} at "
235+
+ f"version {_next_supported_version} or higher{_recommendation}."
236+
+ " Please ensure "
237+
+ "that either (a) your Python environment doesn't pin the "
238+
+ f"version of {_dependency_package}, so that updates to "
239+
+ f"{_package_label} can require the higher version, or "
240+
+ "(b) you manually update your Python environment to use at "
241+
+ f"least version {_next_supported_version} of "
242+
+ f"{_dependency_package}.",
243+
FutureWarning,
244+
)
245+
except Exception:
246+
warnings.warn(
247+
"Could not determine the version of Python "
248+
+ "currently being used. To continue receiving "
249+
+ "updates for {_package_label}, ensure you are "
250+
+ "using a supported version of Python; see "
251+
+ "https://devguide.python.org/versions/"
252+
)
253+
146254
__all__ = (
147255
"BaseBigtableTableAdminAsyncClient",
148256
"BigtableInstanceAdminAsyncClient",

google/cloud/bigtable_admin_v2/gapic_version.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
17+
# DO NOT EDIT THIS FILE OUTSIDE OF `.librarian/generator-input`
18+
# The source of truth for this file is `.librarian/generator-input`
19+
1620
__version__ = "2.34.0" # {x-release-please-version}

0 commit comments

Comments
 (0)