Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ec9262c

Browse filesBrowse files
authored
fix: Allow Protobuf 7.x, require Python 3.9 (#16102)
fix: Require Python 3.9 Towards #16001 We will follow up with googleapis/gapic-generator-python#2595 once grpc/grpc#41933 is fixed.
1 parent cf50cea commit ec9262c
Copy full SHA for ec9262c

113 files changed

+307-1,043Lines changed: 307 additions & 1043 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/bigquery-magics/CONTRIBUTING.rst‎

Copy file name to clipboardExpand all lines: packages/bigquery-magics/CONTRIBUTING.rst
-23Lines changed: 0 additions & 23 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -177,29 +177,6 @@ Build the docs via:
177177

178178
$ nox -s docs
179179

180-
*************************
181-
Samples and code snippets
182-
*************************
183-
184-
Code samples and snippets live in the `samples/` catalogue. Feel free to
185-
provide more examples, but make sure to write tests for those examples.
186-
Each folder containing example code requires its own `noxfile.py` script
187-
which automates testing. If you decide to create a new folder, you can
188-
base it on the `samples/snippets` folder (providing `noxfile.py` and
189-
the requirements files).
190-
191-
The tests will run against a real Google Cloud Project, so you should
192-
configure them just like the System Tests.
193-
194-
- To run sample tests, you can execute::
195-
196-
# Run all tests in a folder
197-
$ cd samples/snippets
198-
$ nox -s py-3.8
199-
200-
# Run a single sample test
201-
$ cd samples/snippets
202-
$ nox -s py-3.8 -- -k <name of test>
203180

204181
********************************************
205182
Note About ``README`` as it pertains to PyPI
Collapse file

‎packages/bigquery-magics/mypy.ini‎

Copy file name to clipboard
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[mypy]
2-
python_version = 3.8
2+
python_version = 3.14
33
namespace_packages = True
Collapse file

‎packages/bigquery-magics/noxfile.py‎

Copy file name to clipboardExpand all lines: packages/bigquery-magics/noxfile.py
+7-57Lines changed: 7 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
DEFAULT_PYTHON_VERSION = "3.14"
3636

3737
UNIT_TEST_PYTHON_VERSIONS: List[str] = [
38-
"3.8",
3938
"3.9",
4039
"3.10",
4140
"3.11",
@@ -44,9 +43,6 @@
4443
"3.14",
4544
]
4645

47-
ALL_PYTHON = list(UNIT_TEST_PYTHON_VERSIONS)
48-
ALL_PYTHON.extend(["3.7"])
49-
5046
UNIT_TEST_STANDARD_DEPENDENCIES = [
5147
"mock",
5248
"asyncmock",
@@ -86,7 +82,7 @@
8682
],
8783
}
8884

89-
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON
85+
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = UNIT_TEST_PYTHON_VERSIONS
9086
SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [
9187
"mock",
9288
"pytest",
@@ -225,36 +221,15 @@ def install_unittest_dependencies(session, *constraints):
225221
session.install("-e", ".", *constraints)
226222

227223

228-
@nox.session(python=ALL_PYTHON)
229-
@nox.parametrize(
230-
"protobuf_implementation",
231-
["python", "upb", "cpp"],
232-
)
233-
def unit(session, protobuf_implementation):
224+
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
225+
def unit(session):
234226
# Install all test dependencies, then install this package in-place.
235227

236-
if session.python in ("3.7",):
237-
session.skip("Python 3.7 is no longer supported")
238-
239-
if protobuf_implementation == "cpp" and session.python in (
240-
"3.11",
241-
"3.12",
242-
"3.13",
243-
"3.14",
244-
):
245-
session.skip("cpp implementation is not supported in python 3.11+")
246-
247228
constraints_path = str(
248229
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
249230
)
250231
install_unittest_dependencies(session, "-c", constraints_path)
251232

252-
# TODO(https://github.com/googleapis/synthtool/issues/1976):
253-
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
254-
# The 'cpp' implementation requires Protobuf<4.
255-
if protobuf_implementation == "cpp":
256-
session.install("protobuf<4")
257-
258233
# Run py.test against the unit tests.
259234
session.run(
260235
"py.test",
@@ -268,9 +243,6 @@ def unit(session, protobuf_implementation):
268243
"--cov-fail-under=0",
269244
os.path.join("tests", "unit"),
270245
*session.posargs,
271-
env={
272-
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
273-
},
274246
)
275247

276248

@@ -444,21 +416,9 @@ def docfx(session):
444416

445417

446418
@nox.session(python=DEFAULT_PYTHON_VERSION)
447-
@nox.parametrize(
448-
"protobuf_implementation",
449-
["python", "upb", "cpp"],
450-
)
451-
def prerelease_deps(session, protobuf_implementation):
419+
def prerelease_deps(session):
452420
"""Run all tests with prerelease versions of dependencies installed."""
453421

454-
if protobuf_implementation == "cpp" and session.python in (
455-
"3.11",
456-
"3.12",
457-
"3.13",
458-
"3.14",
459-
):
460-
session.skip("cpp implementation is not supported in python 3.11+")
461-
462422
# Install all dependencies
463423
session.install("-e", ".[all, tests, tracing]")
464424
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
@@ -518,12 +478,11 @@ def prerelease_deps(session, protobuf_implementation):
518478
# from main to detect any potential breaking changes. For context, see:
519479
# https://github.com/googleapis/python-bigquery-pandas/issues/854
520480
session.install(
521-
"--pre",
522-
"--upgrade",
481+
"--ignore-installed",
523482
# TODO(https://github.com/googleapis/google-cloud-python/pull/126): Install this again when we relax the pin.
524483
# "https://github.com/cloudspannerecosystem/spanner-graph-notebook/archive/refs/heads/main.zip",
525-
"https://github.com/googleapis/python-bigquery/archive/main.zip",
526-
"https://github.com/googleapis/google-cloud-python/archive/main.zip#egg=google-cloud-bigquery-storage&subdirectory=packages/google-cloud-bigquery-storage",
484+
f"{CURRENT_DIRECTORY}/../google-cloud-bigquery",
485+
f"{CURRENT_DIRECTORY}/../google-cloud-bigquery-storage",
527486
)
528487
# Print out prerelease package versions
529488
session.run("pip", "freeze")
@@ -536,9 +495,6 @@ def prerelease_deps(session, protobuf_implementation):
536495
session.run(
537496
"py.test",
538497
"tests/unit",
539-
env={
540-
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
541-
},
542498
)
543499

544500
system_test_path = os.path.join("tests", "system.py")
@@ -558,9 +514,6 @@ def prerelease_deps(session, protobuf_implementation):
558514
f"--junitxml=system_{session.python}_sponge_log.xml",
559515
system_test_path,
560516
*session.posargs,
561-
env={
562-
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
563-
},
564517
)
565518
if os.path.exists(system_test_folder_path):
566519
session.run(
@@ -569,9 +522,6 @@ def prerelease_deps(session, protobuf_implementation):
569522
f"--junitxml=system_{session.python}_sponge_log.xml",
570523
system_test_folder_path,
571524
*session.posargs,
572-
env={
573-
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
574-
},
575525
)
576526

577527

Collapse file

‎packages/bigquery-magics/setup.py‎

Copy file name to clipboardExpand all lines: packages/bigquery-magics/setup.py
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@
106106
"License :: OSI Approved :: Apache Software License",
107107
"Programming Language :: Python",
108108
"Programming Language :: Python :: 3",
109-
"Programming Language :: Python :: 3.8",
110109
"Programming Language :: Python :: 3.9",
111110
"Programming Language :: Python :: 3.10",
112111
"Programming Language :: Python :: 3.11",
@@ -120,7 +119,7 @@
120119
packages=packages,
121120
install_requires=dependencies,
122121
extras_require=extras,
123-
python_requires=">=3.8",
122+
python_requires=">=3.9",
124123
include_package_data=True,
125124
zip_safe=False,
126125
)
Collapse file

‎packages/bigquery-magics/testing/constraints-3.8.txt‎

Copy file name to clipboardExpand all lines: packages/bigquery-magics/testing/constraints-3.8.txt
-17Lines changed: 0 additions & 17 deletions
This file was deleted.
Collapse file

‎packages/bigquery-magics/testing/constraints-3.9.txt‎

Copy file name to clipboardExpand all lines: packages/bigquery-magics/testing/constraints-3.9.txt
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ google-cloud-bigquery-storage==2.6.0
1111
ipywidgets==7.7.1
1212
ipython==7.23.1
1313
ipykernel==5.5.6
14+
packaging==20.0.0
1415
pandas==1.2.0
1516
pyarrow==3.0.0
1617
pydata-google-auth==1.5.0
17-
tqdm==4.7.4
18+
tqdm==4.7.4
Collapse file

‎packages/db-dtypes/CONTRIBUTING.rst‎

Copy file name to clipboardExpand all lines: packages/db-dtypes/CONTRIBUTING.rst
+2-29Lines changed: 2 additions & 29 deletions
  • Display the source diff
  • Display the rich diff
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.8, 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows.
25+
3.9, 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
@@ -177,29 +177,6 @@ Build the docs via:
177177

178178
$ nox -s docs
179179

180-
*************************
181-
Samples and code snippets
182-
*************************
183-
184-
Code samples and snippets live in the `samples/` catalogue. Feel free to
185-
provide more examples, but make sure to write tests for those examples.
186-
Each folder containing example code requires its own `noxfile.py` script
187-
which automates testing. If you decide to create a new folder, you can
188-
base it on the `samples/snippets` folder (providing `noxfile.py` and
189-
the requirements files).
190-
191-
The tests will run against a real Google Cloud Project, so you should
192-
configure them just like the System Tests.
193-
194-
- To run sample tests, you can execute::
195-
196-
# Run all tests in a folder
197-
$ cd samples/snippets
198-
$ nox -s py-3.8
199-
200-
# Run a single sample test
201-
$ cd samples/snippets
202-
$ nox -s py-3.8 -- -k <name of test>
203180

204181
********************************************
205182
Note About ``README`` as it pertains to PyPI
@@ -221,17 +198,13 @@ Supported Python Versions
221198

222199
We support:
223200

224-
- `Python 3.7`_
225-
- `Python 3.8`_
226201
- `Python 3.9`_
227202
- `Python 3.10`_
228203
- `Python 3.11`_
229204
- `Python 3.12`_
230205
- `Python 3.13`_
231206
- `Python 3.14`_
232207

233-
.. _Python 3.7: https://docs.python.org/3.7/
234-
.. _Python 3.8: https://docs.python.org/3.8/
235208
.. _Python 3.9: https://docs.python.org/3.9/
236209
.. _Python 3.10: https://docs.python.org/3.10/
237210
.. _Python 3.11: https://docs.python.org/3.11/
@@ -245,7 +218,7 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
245218
.. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/db-dtypes/noxfile.py
246219

247220

248-
We also explicitly decided to support Python 3 beginning with version 3.7.
221+
We also explicitly decided to support Python 3 beginning with version 3.9.
249222
Reasons for this include:
250223

251224
- Encouraging use of newest versions of Python 3
Collapse file

‎packages/db-dtypes/noxfile.py‎

Copy file name to clipboardExpand all lines: packages/db-dtypes/noxfile.py
+1-10Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,13 @@
3636
LINT_PYTHON_VERSION = "3.10"
3737

3838
UNIT_TEST_PYTHON_VERSIONS: List[str] = [
39-
"3.8",
4039
"3.9",
4140
"3.10",
4241
"3.11",
4342
"3.12",
4443
"3.13",
4544
"3.14",
4645
]
47-
ALL_PYTHON = list(UNIT_TEST_PYTHON_VERSIONS)
48-
ALL_PYTHON.extend(["3.7"])
4946

5047
UNIT_TEST_STANDARD_DEPENDENCIES = [
5148
"mock",
@@ -111,10 +108,6 @@ def lint(session):
111108
session.run("flake8", "db_dtypes", "tests")
112109

113110

114-
# TODO: the owlbot-python docker image still has python 3.8 installed (
115-
# and only 3.8).
116-
# As soon as that gets upgraded, we should be able to revert this session
117-
# to using the DEFAULT_PYTHON_VERSION.
118111
@nox.session(python=DEFAULT_PYTHON_VERSION)
119112
def blacken(session):
120113
"""Run black. Format code to uniform standard."""
@@ -285,12 +278,10 @@ def prerelease(session, tests_path):
285278
)
286279

287280

288-
@nox.session(python=ALL_PYTHON)
281+
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
289282
@nox.parametrize("test_type", ["unit", "compliance"])
290283
def unit(session, test_type):
291284
"""Run the unit test suite."""
292-
if session.python == "3.7":
293-
session.skip("Python 3.7 is no longer supported")
294285

295286
# Compliance tests only run on the latest Python version
296287
if test_type == "compliance" and session.python != DEFAULT_PYTHON_VERSION:
Collapse file

‎packages/db-dtypes/setup.py‎

Copy file name to clipboardExpand all lines: packages/db-dtypes/setup.py
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ def readme():
6464
"License :: OSI Approved :: Apache Software License",
6565
"Programming Language :: Python",
6666
"Programming Language :: Python :: 3",
67-
"Programming Language :: Python :: 3.8",
6867
"Programming Language :: Python :: 3.9",
6968
"Programming Language :: Python :: 3.10",
7069
"Programming Language :: Python :: 3.11",
@@ -76,6 +75,6 @@ def readme():
7675
],
7776
platforms="Posix; MacOS X; Windows",
7877
install_requires=dependencies,
79-
python_requires=">=3.8",
78+
python_requires=">=3.9",
8079
tests_require=["pytest"],
8180
)
Collapse file

‎packages/db-dtypes/testing/constraints-3.8.txt‎

Copy file name to clipboardExpand all lines: packages/db-dtypes/testing/constraints-3.8.txt
-5Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.