Skip to content

Commit 0842aa1

Browse files
fix: Allow protobuf 6.x (#2142)
* fix: Allow protobuf 6.x * update prerelease_deps nox session so that prerelease versions of protobuf are installed * ensure python-bigquery is installed from source * feat: add support for Python 3.13 * restore replacement * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix typo --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent d7f7685 commit 0842aa1

10 files changed

+76
-94
lines changed

.github/sync-repo-settings.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ branchProtectionRules:
1010
requiresStrictStatusChecks: true
1111
requiredStatusCheckContexts:
1212
- 'Kokoro'
13-
- 'Kokoro system-3.12'
14-
- 'Kokoro snippets-3.12'
13+
- 'Kokoro system-3.13'
14+
- 'Kokoro snippets-3.13'
1515
- 'cla/google'
1616
- 'Samples - Lint'
1717
- 'Samples - Python 3.9'
1818
- 'Samples - Python 3.10'
1919
- 'Samples - Python 3.11'
2020
- 'Samples - Python 3.12'
21+
- 'Samples - Python 3.13'
2122
- pattern: v2
2223
requiresLinearHistory: true
2324
requiresCodeOwnerReviews: true

.kokoro/continuous/prerelease-deps-3.12.cfg .kokoro/continuous/prerelease-deps-3.13.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# Only run this nox session.
44
env_vars: {
55
key: "NOX_SESSION"
6-
value: "prerelease_deps-3.12"
6+
value: "prerelease_deps-3.13"
77
}

.kokoro/presubmit/snippets-3.12.cfg .kokoro/presubmit/snippets-3.13.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# Only run this nox session.
44
env_vars: {
55
key: "NOX_SESSION"
6-
value: "snippets-3.12"
6+
value: "snippets-3.13"
77
}

.kokoro/presubmit/system-3.12.cfg .kokoro/presubmit/system-3.13.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# Only run this nox session.
44
env_vars: {
55
key: "NOX_SESSION"
6-
value: "system-3.12"
7-
}
6+
value: "system-3.13"
7+
}

.kokoro/presubmit/system-3.9.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
env_vars: {
55
key: "NOX_SESSION"
66
value: "system-3.9"
7-
}
7+
}

CONTRIBUTING.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,13 @@ 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.13 -- -k <name of test>
147147

148148

149149
.. note::
150150

151-
System tests are configured to run under Python 3.9, 3.11, 3.12.
151+
System tests are only configured to run under Python 3.9 and 3.13.
152+
For expediency, we do not run them in older versions of Python 3.
152153

153154
This alone will not run the tests. You'll need to change some local
154155
auth settings and change some configuration in your project to
@@ -238,7 +239,7 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
238239
.. _config: https://github.com/googleapis/python-bigquery/blob/main/noxfile.py
239240

240241

241-
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.9.
242243
Reasons for this include:
243244

244245
- Encouraging use of newest versions of Python 3

noxfile.py

+41-37
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
)
3939

4040
DEFAULT_PYTHON_VERSION = "3.9"
41-
SYSTEM_TEST_PYTHON_VERSIONS = ["3.9", "3.11", "3.12"]
42-
UNIT_TEST_PYTHON_VERSIONS = ["3.9", "3.11", "3.12"]
41+
SYSTEM_TEST_PYTHON_VERSIONS = ["3.9", "3.11", "3.12", "3.13"]
42+
UNIT_TEST_PYTHON_VERSIONS = ["3.9", "3.11", "3.12", "3.13"]
4343
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
4444

4545

@@ -362,6 +362,40 @@ def prerelease_deps(session):
362362
363363
https://github.com/googleapis/python-bigquery/issues/95
364364
"""
365+
# Because we test minimum dependency versions on the minimum Python
366+
# version, the first version we test with in the unit tests sessions has a
367+
# constraints file containing all dependencies and extras.
368+
with open(
369+
CURRENT_DIRECTORY
370+
/ "testing"
371+
/ f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt",
372+
encoding="utf-8",
373+
) as constraints_file:
374+
constraints_text = constraints_file.read()
375+
376+
# Ignore leading whitespace and comment lines.
377+
deps = [
378+
match.group(1)
379+
for match in re.finditer(
380+
r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE
381+
)
382+
]
383+
384+
session.install(*deps)
385+
386+
session.install(
387+
"--pre",
388+
"--upgrade",
389+
"freezegun",
390+
"google-cloud-datacatalog",
391+
"google-cloud-resource-manager",
392+
"google-cloud-storage",
393+
"google-cloud-testutils",
394+
"psutil",
395+
"pytest",
396+
"pytest-cov",
397+
)
398+
365399
# PyArrow prerelease packages are published to an alternative PyPI host.
366400
# https://arrow.apache.org/docs/python/install.html#installing-nightly-packages
367401
session.install(
@@ -386,48 +420,18 @@ def prerelease_deps(session):
386420
session.install(
387421
"--pre",
388422
"--upgrade",
423+
"--no-deps",
389424
"google-api-core",
390425
"google-cloud-bigquery-storage",
391426
"google-cloud-core",
392427
"google-resumable-media",
393428
"db-dtypes",
394-
# Exclude version 1.49.0rc1 which has a known issue. See https://github.com/grpc/grpc/pull/30642
395-
"grpcio!=1.49.0rc1",
396-
)
397-
session.install(
398-
"freezegun",
399-
"google-cloud-datacatalog",
400-
"google-cloud-resource-manager",
401-
"google-cloud-storage",
402-
"google-cloud-testutils",
403-
"psutil",
404-
"pytest",
405-
"pytest-cov",
429+
"grpcio",
430+
"protobuf",
406431
)
407432

408-
# Because we test minimum dependency versions on the minimum Python
409-
# version, the first version we test with in the unit tests sessions has a
410-
# constraints file containing all dependencies and extras.
411-
with open(
412-
CURRENT_DIRECTORY
413-
/ "testing"
414-
/ f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt",
415-
encoding="utf-8",
416-
) as constraints_file:
417-
constraints_text = constraints_file.read()
418-
419-
# Ignore leading whitespace and comment lines.
420-
deps = [
421-
match.group(1)
422-
for match in re.finditer(
423-
r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE
424-
)
425-
]
426-
427-
# We use --no-deps to ensure that pre-release versions aren't overwritten
428-
# by the version ranges in setup.py.
429-
session.install(*deps)
430-
session.install("--no-deps", "-e", ".[all]")
433+
# Ensure that this library is installed from source
434+
session.install("-e", ".", "--no-deps")
431435

432436
# Print out prerelease package versions.
433437
session.run("python", "-m", "pip", "freeze")

owlbot.py

+5-30
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
"geopandas": "https://geopandas.org/",
5656
"pandas": "https://pandas.pydata.org/pandas-docs/stable/",
5757
},
58+
system_test_python_versions=["3.9", "3.13"],
59+
unit_test_python_versions=["3.9", "3.10", "3.11", "3.12", "3.13"],
60+
default_python_version="3.9",
5861
)
5962

6063
# BigQuery has a custom multiprocessing note
@@ -86,41 +89,13 @@
8689
python3.9 -m pip install --upgrade --quiet nox virtualenv==20.26.6""",
8790
"python3.9 -m pip install --upgrade --quiet nox virtualenv",
8891
)
89-
s.replace(
90-
"CONTRIBUTING.rst",
91-
"3.7, 3.8, 3.9, 3.10, 3.11, 3.12 and 3.13 on both UNIX and Windows.",
92-
"3.9, 3.10, 3.11, 3.12 and 3.13 on both UNIX and Windows.",
93-
)
94-
s.replace(
95-
"CONTRIBUTING.rst",
96-
r" \$ nox -s system-3.8 -- -k <name of test>",
97-
r" $ nox -s system-3.9 -- -k <name of test>",
98-
)
99-
s.replace(
100-
"CONTRIBUTING.rst",
101-
r"""System tests are only configured to run under Python 3.8.
102-
For expediency, we do not run them in older versions of Python 3.""",
103-
r"System tests are configured to run under Python 3.9, 3.11, 3.12.",
104-
)
92+
10593
s.replace(
10694
"CONTRIBUTING.rst",
10795
r"\$ nox -s py-3.8",
10896
r"$ nox -s py-3.9",
10997
)
110-
s.replace(
111-
"CONTRIBUTING.rst",
112-
r"""- `Python 3.7`_
113-
- `Python 3.8`_
114-
""",
115-
r"",
116-
)
117-
s.replace(
118-
"CONTRIBUTING.rst",
119-
r""".. _Python 3.7: https://docs.python.org/3.7/
120-
.. _Python 3.8: https://docs.python.org/3.8/
121-
""",
122-
r"",
123-
)
98+
12499
s.replace(
125100
"scripts/readme-gen/templates/install_deps.tmpl.rst",
126101
r"Samples are compatible with Python 3.7",

pyproject.toml

+18-17
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,18 @@ classifiers = [
3737
"Programming Language :: Python :: 3.10",
3838
"Programming Language :: Python :: 3.11",
3939
"Programming Language :: Python :: 3.12",
40+
"Programming Language :: Python :: 3.13",
4041
"Operating System :: OS Independent",
4142
"Topic :: Internet",
4243
]
4344
dependencies = [
44-
"google-api-core[grpc] >= 2.11.1, < 3.0.0dev",
45-
"google-auth >= 2.14.1, < 3.0.0dev",
46-
"google-cloud-core >= 2.4.1, < 3.0.0dev",
47-
"google-resumable-media >= 2.0.0, < 3.0dev",
45+
"google-api-core[grpc] >= 2.11.1, < 3.0.0",
46+
"google-auth >= 2.14.1, < 3.0.0",
47+
"google-cloud-core >= 2.4.1, < 3.0.0",
48+
"google-resumable-media >= 2.0.0, < 3.0.0",
4849
"packaging >= 24.2.0",
49-
"python-dateutil >= 2.8.2, < 3.0dev",
50-
"requests >= 2.21.0, < 3.0.0dev",
50+
"python-dateutil >= 2.8.2, < 3.0.0",
51+
"requests >= 2.21.0, < 3.0.0",
5152
]
5253
dynamic = ["version"]
5354

@@ -59,37 +60,37 @@ Repository = "https://github.com/googleapis/python-bigquery"
5960
# moved back to optional due to bloat. See
6061
# https://github.com/googleapis/python-bigquery/issues/1196 for more background.
6162
bqstorage = [
62-
"google-cloud-bigquery-storage >= 2.18.0, < 3.0.0dev",
63+
"google-cloud-bigquery-storage >= 2.18.0, < 3.0.0",
6364
# Due to an issue in pip's dependency resolver, the `grpc` extra is not
6465
# installed, even though `google-cloud-bigquery-storage` specifies it
6566
# as `google-api-core[grpc]`. We thus need to explicitly specify it here.
6667
# See: https://github.com/googleapis/python-bigquery/issues/83 The
6768
# grpc.Channel.close() method isn't added until 1.32.0.
6869
# https://github.com/grpc/grpc/pull/15254
69-
"grpcio >= 1.47.0, < 2.0dev",
70-
"grpcio >= 1.49.1, < 2.0dev; python_version >= '3.11'",
70+
"grpcio >= 1.47.0, < 2.0.0",
71+
"grpcio >= 1.49.1, < 2.0.0; python_version >= '3.11'",
7172
"pyarrow >= 4.0.0",
7273
]
7374
pandas = [
7475
"pandas >= 1.1.4",
75-
"pandas-gbq >= 0.26.1; python_version >= '3.8'",
76-
"grpcio >= 1.47.0, < 2.0dev",
77-
"grpcio >= 1.49.1, < 2.0dev; python_version >= '3.11'",
76+
"pandas-gbq >= 0.26.1",
77+
"grpcio >= 1.47.0, < 2.0.0",
78+
"grpcio >= 1.49.1, < 2.0.0; python_version >= '3.11'",
7879
"pyarrow >= 3.0.0",
79-
"db-dtypes >= 1.0.4, < 2.0.0dev",
80+
"db-dtypes >= 1.0.4, < 2.0.0",
8081
]
8182
ipywidgets = ["ipywidgets >= 7.7.1", "ipykernel >= 6.2.0"]
82-
geopandas = ["geopandas >= 0.9.0, < 2.0dev", "Shapely >= 1.8.4, < 3.0.0dev"]
83+
geopandas = ["geopandas >= 0.9.0, < 2.0.0", "Shapely >= 1.8.4, < 3.0.0"]
8384
ipython = ["ipython >= 7.23.1", "bigquery-magics >= 0.6.0"]
84-
tqdm = ["tqdm >= 4.7.4, < 5.0.0dev"]
85+
tqdm = ["tqdm >= 4.7.4, < 5.0.0"]
8586
opentelemetry = [
8687
"opentelemetry-api >= 1.1.0",
8788
"opentelemetry-sdk >= 1.1.0",
8889
"opentelemetry-instrumentation >= 0.20b0",
8990
]
9091
bigquery_v2 = [
91-
"proto-plus >= 1.22.3, < 2.0.0dev",
92-
"protobuf >= 3.20.2, < 6.0.0dev, != 4.21.0, != 4.21.1, != 4.21.2, != 4.21.3, != 4.21.4, != 4.21.5", # For the legacy proto-based types.
92+
"proto-plus >= 1.22.3, < 2.0.0",
93+
"protobuf >= 3.20.2, < 7.0.0, != 4.21.0, != 4.21.1, != 4.21.2, != 4.21.3, != 4.21.4, != 4.21.5", # For the legacy proto-based types.
9394
]
9495
all = [
9596
"google-cloud-bigquery[bqstorage,pandas,ipywidgets,geopandas,ipython,tqdm,opentelemetry,bigquery_v2]",

testing/constraints-3.13.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)