Skip to content

Commit fb3a9ad

Browse files
committed
fix: Require Python 3.9
1 parent 2647414 commit fb3a9ad

File tree

89 files changed

+242
-840
lines changed

Some content is hidden

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

89 files changed

+242
-840
lines changed

packages/bigquery-magics/CONTRIBUTING.rst

Lines changed: 0 additions & 23 deletions
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

packages/bigquery-magics/mypy.ini

Lines 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

packages/bigquery-magics/noxfile.py

Lines changed: 3 additions & 52 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",
@@ -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
@@ -536,9 +496,6 @@ def prerelease_deps(session, protobuf_implementation):
536496
session.run(
537497
"py.test",
538498
"tests/unit",
539-
env={
540-
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
541-
},
542499
)
543500

544501
system_test_path = os.path.join("tests", "system.py")
@@ -558,9 +515,6 @@ def prerelease_deps(session, protobuf_implementation):
558515
f"--junitxml=system_{session.python}_sponge_log.xml",
559516
system_test_path,
560517
*session.posargs,
561-
env={
562-
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
563-
},
564518
)
565519
if os.path.exists(system_test_folder_path):
566520
session.run(
@@ -569,9 +523,6 @@ def prerelease_deps(session, protobuf_implementation):
569523
f"--junitxml=system_{session.python}_sponge_log.xml",
570524
system_test_folder_path,
571525
*session.posargs,
572-
env={
573-
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
574-
},
575526
)
576527

577528

packages/bigquery-magics/setup.py

Lines 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
)

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

Lines changed: 0 additions & 17 deletions
This file was deleted.

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

Lines 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

packages/db-dtypes/CONTRIBUTING.rst

Lines changed: 2 additions & 29 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.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

packages/db-dtypes/noxfile.py

Lines 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:

packages/db-dtypes/setup.py

Lines 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
)

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

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)