Skip to content

Commit 200b0d3

Browse files
authored
fix: require Python 3.10+ (googleapis#17245)
chore: enable generation / release for bigtable Fixes b/510022189, b/507893758, b/507889482, b/503326310
1 parent c5da564 commit 200b0d3

251 files changed

Lines changed: 3505 additions & 2367 deletions

File tree

Some content is hidden

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

.librarian/config.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ libraries:
2323
# Allow release for google-crc32c once this bug is fixed.
2424
- id: "google-crc32c"
2525
release_blocked: true
26-
# TODO(b/501132869): Disabling automatic releases until resolved.
27-
- id: "google-cloud-bigtable"
28-
release_blocked: true
2926
# TODO(https://github.com/googleapis/google-cloud-python/issues/16962):
3027
# Disable automatic releases until tests stabilize.
3128
- id: "pandas-gbq"

.librarian/generator-input/client-post-processing/bigtable-integration.yaml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,24 @@ replacements:
198198
\]
199199
after: |
200200
"protobuf >= 4.25.8, < 8.0.0",
201-
"google-cloud-core >= 1.4.4, <3.0.0",
202-
"grpc-google-iam-v1 >= 0.12.4, <1.0.0",
203-
"google-crc32c>=1.5.0, <2.0.0dev",
201+
"google-cloud-core >= 2.0.0, <3.0.0",
202+
"grpc-google-iam-v1 >= 0.14.0, <1.0.0",
203+
"google-crc32c>=1.6.0, <2.0.0dev",
204204
]
205205
count: 1
206+
- paths: [
207+
packages/google-cloud-bigtable/testing/constraints-3.10.txt,
208+
]
209+
before: |
210+
google-api-core==2.17.1
211+
google-auth==2.14.1
212+
after: |
213+
google-api-core==2.17.1
214+
google-cloud-core==2.0.0
215+
grpc-google-iam-v1==0.14.0
216+
google-crc32c==1.6.0
217+
google-auth==2.14.1
218+
count: 1
206219
- paths: [
207220
packages/google-cloud-bigtable/google/cloud/bigtable_v2/services/bigtable/async_client.py,
208221
packages/google-cloud-bigtable/google/cloud/bigtable_v2/services/bigtable/client.py,
@@ -408,13 +421,11 @@ replacements:
408421
import nox
409422
410423
RUFF_VERSION = "ruff==0.14.14"
411-
BLACK_VERSION = "black[jupyter]==23.7.0"
412424
LINT_PATHS = ["google", "samples", "tests", "noxfile.py", "setup.py"]
413425
414426
DEFAULT_PYTHON_VERSION = "3.14"
415427
416428
ALL_PYTHON = [
417-
"3.9",
418429
"3.10",
419430
"3.11",
420431
"3.12",
@@ -428,8 +439,7 @@ replacements:
428439
"pytest",
429440
"pytest-cov",
430441
"pytest-asyncio",
431-
BLACK_VERSION,
432-
"autoflake",
442+
RUFF_VERSION,
433443
]
434444
UNIT_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
435445
UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = []
@@ -445,7 +455,7 @@ replacements:
445455
]
446456
SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = [
447457
"pytest-asyncio==0.21.2",
448-
BLACK_VERSION,
458+
RUFF_VERSION,
449459
"pyyaml==6.0.2",
450460
]
451461
SYSTEM_TEST_LOCAL_DEPENDENCIES: List[str] = []
@@ -607,9 +617,6 @@ replacements:
607617
["python", "upb", "cpp"],
608618
)
609619
def unit(session, protobuf_implementation):
610-
if session.python in ("3.7"):
611-
session.skip("Python 3.7 is no longer supported")
612-
613620
# Install all test dependencies, then install this package in-place.
614621
py_version = tuple([int(v) for v in session.python.split(".")])
615622
if protobuf_implementation == "cpp" and py_version >= (3, 11):
@@ -646,10 +653,7 @@ replacements:
646653
647654
648655
def install_systemtest_dependencies(session, *constraints):
649-
# Use pre-release gRPC for system tests.
650-
# Exclude version 1.52.0rc1 which has a known issue.
651-
# See https://github.com/grpc/grpc/issues/32163
652-
session.install("--pre", "grpcio!=1.52.0rc1")
656+
session.install("--pre", "grpcio")
653657
654658
session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES, *constraints)
655659
@@ -944,8 +948,7 @@ replacements:
944948
"""
945949
Re-generate sync files for the library from CrossSync-annotated async source
946950
"""
947-
session.install(BLACK_VERSION)
948-
session.install("autoflake")
951+
session.install(RUFF_VERSION)
949952
session.run("python", ".cross_sync/generate.py", ".")
950953
951954

librarian.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
language: python
15-
version: v0.15.0
15+
version: v0.15.1-0.20260528141105-567c9bf1faa7
1616
repo: googleapis/google-cloud-python
1717
sources:
1818
googleapis:
@@ -607,8 +607,6 @@ libraries:
607607
apis:
608608
- path: google/bigtable/v2
609609
- path: google/bigtable/admin/v2
610-
skip_generate: true
611-
skip_release: true
612610
python:
613611
library_type: GAPIC_COMBO
614612
opt_args_by_api:

packages/google-cloud-bigtable/.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
Lines changed: 12 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,16 @@
11
{
2-
"name": "bigtable",
3-
"name_pretty": "Google Cloud Bigtable",
4-
"api_description": "is Google's NoSQL Big Data database service. It's the\nsame database that powers many core Google services, including Search,\nAnalytics, Maps, and Gmail.",
5-
"product_documentation": "https://cloud.google.com/bigtable",
2+
"api_description": "API for reading and writing the contents of Bigtable tables associated with\na Google Cloud project.",
3+
"api_id": "bigtable.googleapis.com",
4+
"api_shortname": "bigtable",
65
"client_documentation": "https://cloud.google.com/python/docs/reference/bigtable/latest",
7-
"issue_tracker": "https://issuetracker.google.com/savedsearches/559777",
8-
"release_level": "stable",
6+
"default_version": "v2",
7+
"distribution_name": "google-cloud-bigtable",
8+
"issue_tracker": "https://issuetracker.google.com/issues/new?component=187206\u0026template=0",
99
"language": "python",
1010
"library_type": "GAPIC_COMBO",
11-
"repo": "googleapis/google-cloud-python",
12-
"distribution_name": "google-cloud-bigtable",
13-
"api_id": "bigtable.googleapis.com",
14-
"requires_billing": true,
15-
"samples": [
16-
{
17-
"name": "Hello World in Cloud Bigtable",
18-
"description": "Demonstrates how to connect to Cloud Bigtable and run some basic operations. More information available at: https://cloud.google.com/bigtable/docs/samples-python-hello",
19-
"file": "main.py",
20-
"runnable": true,
21-
"custom_content": "<pre>usage: main.py [-h] [--table TABLE] project_id instance_id<br>Demonstrates how to connect to Cloud Bigtable and run some basic operations.<br>Prerequisites: - Create a Cloud Bigtable cluster.<br>https://cloud.google.com/bigtable/docs/creating-cluster - Set your Google<br>Application Default Credentials.<br>https://developers.google.com/identity/protocols/application-default-<br>credentials<br><br><br>positional arguments:<br>&nbsp; project_id &nbsp; &nbsp; Your Cloud Platform project ID.<br>&nbsp; instance_id &nbsp; &nbsp;ID of the Cloud Bigtable instance to connect to.<br><br><br>optional arguments:<br>&nbsp; -h, --help &nbsp; &nbsp; show this help message and exit<br>&nbsp; --table TABLE &nbsp;Table to create and destroy. (default: Hello-Bigtable)</pre>",
22-
"override_path": "hello"
23-
},
24-
{
25-
"name": "Hello World using HappyBase",
26-
"description": "This sample demonstrates using the Google Cloud Client Library HappyBase package, an implementation of the HappyBase API to connect to and interact with Cloud Bigtable. More information available at: https://cloud.google.com/bigtable/docs/samples-python-hello-happybase",
27-
"file": "main.py",
28-
"runnable": true,
29-
"custom_content": "<pre>usage: main.py [-h] [--table TABLE] project_id instance_id<br>Demonstrates how to connect to Cloud Bigtable and run some basic operations.<br>Prerequisites: - Create a Cloud Bigtable cluster.<br>https://cloud.google.com/bigtable/docs/creating-cluster - Set your Google<br>Application Default Credentials.<br>https://developers.google.com/identity/protocols/application-default-<br>credentials<br><br><br>positional arguments:<br>&nbsp; project_id &nbsp; &nbsp; Your Cloud Platform project ID.<br>&nbsp; instance_id &nbsp; &nbsp;ID of the Cloud Bigtable instance to connect to.<br><br><br>optional arguments:<br>&nbsp; -h, --help &nbsp; &nbsp; show this help message and exit<br>&nbsp; --table TABLE &nbsp;Table to create and destroy. (default: Hello-Bigtable)</pre>",
30-
"override_path": "hello_happybase"
31-
},
32-
{
33-
"name": "cbt Command Demonstration",
34-
"description": "This page explains how to use the cbt command to connect to a Cloud Bigtable instance, perform basic administrative tasks, and read and write data in a table. More information about this quickstart is available at https://cloud.google.com/bigtable/docs/quickstart-cbt",
35-
"file": "instanceadmin.py",
36-
"runnable": true,
37-
"custom_content": "<pre>usage: instanceadmin.py [-h] [run] [dev-instance] [del-instance] [add-cluster] [del-cluster] project_id instance_id cluster_id<br>Demonstrates how to connect to Cloud Bigtable and run some basic operations.<br>Prerequisites: - Create a Cloud Bigtable cluster.<br>https://cloud.google.com/bigtable/docs/creating-cluster - Set your Google<br>Application Default Credentials.<br>https://developers.google.com/identity/protocols/application-default-<br>credentials<br><br><br>positional arguments:<br>&nbsp; project_id &nbsp; &nbsp; Your Cloud Platform project ID.<br>&nbsp; instance_id &nbsp; &nbsp;ID of the Cloud Bigtable instance to connect to.<br><br><br>optional arguments:<br>&nbsp; -h, --help &nbsp; &nbsp; show this help message and exit<br>&nbsp; --table TABLE &nbsp;Table to create and destroy. (default: Hello-Bigtable)</pre>",
38-
"override_path": "instanceadmin"
39-
},
40-
{
41-
"name": "Metric Scaler",
42-
"description": "This sample demonstrates how to use Stackdriver Monitoring to scale Cloud Bigtable based on CPU usage.",
43-
"file": "metricscaler.py",
44-
"runnable": true,
45-
"custom_content": "<pre>usage: metricscaler.py [-h] [--high_cpu_threshold HIGH_CPU_THRESHOLD] [--low_cpu_threshold LOW_CPU_THRESHOLD] [--short_sleep SHORT_SLEEP] [--long_sleep LONG_SLEEP] bigtable_instance bigtable_cluster<br>usage: metricscaler.py [-h] [--high_cpu_threshold HIGH_CPU_THRESHOLD] <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[--low_cpu_threshold LOW_CPU_THRESHOLD] <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[--short_sleep SHORT_SLEEP] [--long_sleep LONG_SLEEP] <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bigtable_instance bigtable_cluster <br><br> <br>Scales Cloud Bigtable clusters based on CPU usage. <br><br> <br>positional arguments: <br>&nbsp; bigtable_instance &nbsp; &nbsp; ID of the Cloud Bigtable instance to connect to. <br>&nbsp; bigtable_cluster &nbsp; &nbsp; &nbsp;ID of the Cloud Bigtable cluster to connect to. <br><br> <br>optional arguments: <br>&nbsp; -h, --help &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;show this help message and exit <br>&nbsp; --high_cpu_threshold HIGH_CPU_THRESHOLD <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If Cloud Bigtable CPU usage is above this threshold, <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scale up <br>&nbsp; --low_cpu_threshold LOW_CPU_THRESHOLD <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If Cloud Bigtable CPU usage is below this threshold, <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scale down <br>&nbsp; --short_sleep SHORT_SLEEP <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; How long to sleep in seconds between checking metrics <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; after no scale operation <br>&nbsp; --long_sleep LONG_SLEEP <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; How long to sleep in seconds between checking metrics <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; after a scaling operation</pre>",
46-
"override_path": "metricscaler"
47-
},
48-
{
49-
"name": "Quickstart",
50-
"description": "Demonstrates of Cloud Bigtable. This sample creates a Bigtable client, connects to an instance and then to a table, then closes the connection.",
51-
"file": "main.py",
52-
"runnable": true,
53-
"custom_content": "<pre>usage: main.py [-h] [--table TABLE] project_id instance_id <br><br> <br>positional arguments: <br>&nbsp; project_id &nbsp; &nbsp; Your Cloud Platform project ID. <br>&nbsp; instance_id &nbsp; &nbsp;ID of the Cloud Bigtable instance to connect to. <br><br> <br>optional arguments: <br>&nbsp; -h, --help &nbsp; &nbsp; show this help message and exit <br>&nbsp; --table TABLE &nbsp;Existing table used in the quickstart. (default: my-table)</pre>",
54-
"override_path": "quickstart"
55-
},
56-
{
57-
"name": "Quickstart using HappyBase",
58-
"description": "Demonstrates of Cloud Bigtable using HappyBase. This sample creates a Bigtable client, connects to an instance and then to a table, then closes the connection.",
59-
"file": "main.py",
60-
"runnable": true,
61-
"custom_content": "<pre>usage: main.py [-h] [--table TABLE] project_id instance_id<br>usage: main.py [-h] [--table TABLE] project_id instance_id <br><br> <br>positional arguments: <br>&nbsp; project_id &nbsp; &nbsp; Your Cloud Platform project ID. <br>&nbsp; instance_id &nbsp; &nbsp;ID of the Cloud Bigtable instance to connect to. <br><br> <br>optional arguments: <br>&nbsp; -h, --help &nbsp; &nbsp; show this help message and exit <br>&nbsp; --table TABLE &nbsp;Existing table used in the quickstart. (default: my-table)</pre>",
62-
"override_path": "quickstart_happybase"
63-
},
64-
{
65-
"name": "Snippets",
66-
"description": "This folder contains snippets for Python Cloud Bigtable.",
67-
"override_path": "snippets"
68-
},
69-
{
70-
"name": "Table Admin",
71-
"description": "Demonstrates how to connect to Cloud Bigtable and run some basic operations.",
72-
"file": "tableadmin.py",
73-
"runnable": true,
74-
"custom_content": "<pre>usage: tableadmin.py [-h] [run] [delete] [--table TABLE] project_id instance_id <br><br> <br>Demonstrates how to connect to Cloud Bigtable and run some basic operations. <br>Prerequisites: - Create a Cloud Bigtable cluster. <br>https://cloud.google.com/bigtable/docs/creating-cluster - Set your Google <br>Application Default Credentials. <br>https://developers.google.com/identity/protocols/application-default- <br>credentials <br><br> <br>positional arguments: <br>&nbsp; project_id &nbsp; &nbsp; Your Cloud Platform project ID. <br>&nbsp; instance_id &nbsp; &nbsp;ID of the Cloud Bigtable instance to connect to. <br><br> <br>optional arguments: <br>&nbsp; -h, --help &nbsp; &nbsp; show this help message and exit <br>&nbsp; --table TABLE &nbsp;Table to create and destroy. (default: Hello-Bigtable)</pre>",
75-
"override_path": "tableadmin"
76-
}
77-
],
78-
"default_version": "v2",
79-
"codeowner_team": "@googleapis/api-bigtable @googleapis/api-bigtable-partners",
80-
"api_shortname": "bigtable"
81-
}
11+
"name": "bigtable",
12+
"name_pretty": "Cloud Bigtable",
13+
"product_documentation": "https://cloud.google.com/bigtable/docs",
14+
"release_level": "stable",
15+
"repo": "googleapis/google-cloud-python"
16+
}

packages/google-cloud-bigtable/CONTRIBUTING.rst

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In order to add a feature:
2222
documentation.
2323

2424
- The feature must work fully on the following CPython versions:
25-
3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows.
25+
3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows.
2626

2727
- The feature must not add unnecessary dependencies (where
2828
"unnecessary" is of course subjective, but new dependencies should
@@ -143,12 +143,12 @@ Running System Tests
143143
$ nox -s system
144144

145145
# Run a single system test
146-
$ nox -s system-3.9 -- -k <name of test>
146+
$ nox -s system-3.12 -- -k <name of test>
147147

148148

149149
.. note::
150150

151-
System tests are only configured to run under Python 3.9.
151+
System tests are only configured to run under Python 3.12.
152152
For expediency, we do not run them in older versions of Python 3.
153153

154154
This alone will not run the tests. You'll need to change some local
@@ -195,11 +195,11 @@ configure them just like the System Tests.
195195

196196
# Run all tests in a folder
197197
$ cd samples/snippets
198-
$ nox -s py-3.8
198+
$ nox -s py-3.14
199199

200200
# Run a single sample test
201201
$ cd samples/snippets
202-
$ nox -s py-3.8 -- -k <name of test>
202+
$ nox -s py-3.14 -- -k <name of test>
203203

204204
********************************************
205205
Note About ``README`` as it pertains to PyPI
@@ -221,18 +221,12 @@ Supported Python Versions
221221

222222
We support:
223223

224-
- `Python 3.7`_
225-
- `Python 3.8`_
226-
- `Python 3.9`_
227224
- `Python 3.10`_
228225
- `Python 3.11`_
229226
- `Python 3.12`_
230227
- `Python 3.13`_
231228
- `Python 3.14`_
232229

233-
.. _Python 3.7: https://docs.python.org/3.7/
234-
.. _Python 3.8: https://docs.python.org/3.8/
235-
.. _Python 3.9: https://docs.python.org/3.9/
236230
.. _Python 3.10: https://docs.python.org/3.10/
237231
.. _Python 3.11: https://docs.python.org/3.11/
238232
.. _Python 3.12: https://docs.python.org/3.12/
@@ -245,7 +239,7 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
245239
.. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/google-cloud-bigtable/noxfile.py
246240

247241

248-
We also explicitly decided to support Python 3 beginning with version 3.7.
242+
We also explicitly decided to support Python 3 beginning with version 3.10.
249243
Reasons for this include:
250244

251245
- Encouraging use of newest versions of Python 3

packages/google-cloud-bigtable/MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)