Skip to content

Commit 63f6d96

Browse files
authored
fix(sqlalchemy-bigquery): Drop support for Python 3.8 and 3.9 (googleapis#16956)
This PR updates \`sqlalchemy-bigquery\` to establish Python 3.10 as the minimum supported version, dropping support for Python 3.7, 3.8, and 3.9. ### Changes * Configuration: Updated \`setup.py\` and \`noxfile.py\` to require Python 3.10+ and remove references to Python 3.8 and 3.9. * Documentation: Updated \`README.rst\` and \`CONTRIBUTING.rst\` to reflect supported Python versions (up to 3.14). * Constraints: Transferred lower bounds to \`constraints-3.10.txt\` and dropped \`constraints-3.8.txt\` and \`constraints-3.9.txt\`. * Fixes: Bumped \`pyarrow\` to \`6.0.0\` and pinned \`alembic==1.7.7\` to fix Python 3.10 compatibility issues. Verified successfully with 318 passing unit tests under Python 3.10! Fixes internal issue: http://b/482126936 🦕
1 parent 6544972 commit 63f6d96

9 files changed

Lines changed: 29 additions & 94 deletions

File tree

packages/sqlalchemy-bigquery/CONTRIBUTING.rst

Lines changed: 4 additions & 17 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.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
@@ -148,7 +148,7 @@ Running System Tests
148148

149149
.. note::
150150

151-
System tests are only configured to run under Python 3.9, 3.12, and 3.14.
151+
System tests are only configured to run under Python 3.12 and 3.14.
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.9
198+
$ nox -s py-3.10
199199

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

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

222222
We support:
223223

224-
- `Python 3.9`_
225224
- `Python 3.10`_
226225
- `Python 3.11`_
227226
- `Python 3.12`_
228227
- `Python 3.13`_
229228
- `Python 3.14`_
230229

231-
.. _Python 3.9: https://docs.python.org/3.9/
232230
.. _Python 3.10: https://docs.python.org/3.10/
233231
.. _Python 3.11: https://docs.python.org/3.11/
234232
.. _Python 3.12: https://docs.python.org/3.12/
@@ -241,17 +239,6 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
241239
.. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/sqlalchemy-bigquery/noxfile.py
242240

243241

244-
We also explicitly decided to support Python 3 beginning with version 3.9.
245-
Reasons for this include:
246-
247-
- Encouraging use of newest versions of Python 3
248-
- Taking the lead of `prominent`_ open-source `projects`_
249-
- `Unicode literal support`_ which allows for a cleaner codebase that
250-
works in both Python 2 and Python 3
251-
252-
.. _prominent: https://docs.djangoproject.com/en/1.9/faq/install/#what-python-version-can-i-use-with-django
253-
.. _projects: http://flask.pocoo.org/docs/0.10/python3/
254-
.. _Unicode literal support: https://www.python.org/dev/peps/pep-0414/
255242

256243
**********
257244
Versioning

packages/sqlalchemy-bigquery/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ dependencies.
5151

5252
Supported Python Versions
5353
^^^^^^^^^^^^^^^^^^^^^^^^^
54-
Python >= 3.9, <3.14
54+
Python >= 3.10, <= 3.14
5555

5656
Unsupported Python Versions
5757
^^^^^^^^^^^^^^^^^^^^^^^^^^^
58-
Python <= 3.7.
58+
Python <= 3.9
5959

6060

6161
Mac/Linux

packages/sqlalchemy-bigquery/noxfile.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,13 @@
4545
DEFAULT_PYTHON_VERSION = "3.14"
4646

4747
UNIT_TEST_PYTHON_VERSIONS: List[str] = [
48-
"3.8",
49-
"3.9",
5048
"3.10",
5149
"3.11",
5250
"3.12",
5351
"3.13",
5452
"3.14",
5553
]
5654
ALL_PYTHON = list(UNIT_TEST_PYTHON_VERSIONS)
57-
ALL_PYTHON.extend(["3.7"])
5855
UNIT_TEST_STANDARD_DEPENDENCIES = [
5956
"mock",
6057
"asyncmock",
@@ -276,8 +273,6 @@ def install_unittest_dependencies(session, *constraints):
276273
def unit(session, protobuf_implementation, install_extras=True):
277274
# Install all test dependencies, then install this package in-place.
278275

279-
if session.python in ("3.7",):
280-
session.skip("Python 3.7 is no longer supported")
281276
if protobuf_implementation == "cpp" and session.python in (
282277
"3.11",
283278
"3.12",

packages/sqlalchemy-bigquery/setup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def readme():
6464
"grpcio >= 1.47.0, < 2.0.0",
6565
"grpcio >= 1.49.1, < 2.0.0; python_version =='3.11'",
6666
"grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
67-
"pyarrow >= 5.0.0",
67+
"pyarrow >= 6.0.0",
6868
],
6969
}
7070

@@ -101,8 +101,6 @@ def readme():
101101
"License :: OSI Approved :: MIT License",
102102
"Programming Language :: Python",
103103
"Programming Language :: Python :: 3",
104-
"Programming Language :: Python :: 3.8",
105-
"Programming Language :: Python :: 3.9",
106104
"Programming Language :: Python :: 3.10",
107105
"Programming Language :: Python :: 3.11",
108106
"Programming Language :: Python :: 3.12",
@@ -123,7 +121,7 @@ def readme():
123121
"sqlalchemy>=1.4.16,<3.0.0",
124122
],
125123
extras_require=extras,
126-
python_requires=">=3.8, <3.15",
124+
python_requires=">=3.10, <3.15",
127125
tests_require=["packaging", "pytz"],
128126
entry_points={
129127
"sqlalchemy.dialects": ["bigquery = sqlalchemy_bigquery:BigQueryDialect"]

packages/sqlalchemy-bigquery/sqlalchemy_bigquery/__init__.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import warnings
2424

25-
from . import _versions_helpers
2625
from ._types import (
2726
ARRAY,
2827
BIGNUMERIC,
@@ -44,16 +43,15 @@
4443
)
4544
from .base import BigQueryDialect, dialect
4645
from .version import __version__
46+
import sys
4747

48-
sys_major, sys_minor, sys_micro = _versions_helpers.extract_runtime_version()
49-
50-
# Now that support for Python 3.7 and 3.8 has been removed, we don't expect the
48+
# Now that support for Python 3.7, 3.8 and 3.9 has been removed, we don't expect the
5149
# following check to succeed. The warning is only included for robustness.
52-
if sys_major == 3 and sys_minor in (7, 8): # pragma: NO COVER
50+
if sys.version_info < (3, 10): # pragma: NO COVER
5351
warnings.warn(
54-
"The python-bigquery-sqlalchemy library no longer supports Python 3.7 "
55-
"and Python 3.8. "
56-
f"Your Python version is {sys_major}.{sys_minor}.{sys_micro}. We "
52+
"The python-bigquery-sqlalchemy library no longer supports Python 3.7, "
53+
"3.8 and 3.9. "
54+
f"Your Python version is {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}. We "
5755
"recommend that you update soon to ensure ongoing support. For "
5856
"more details, see: [Google Cloud Client Libraries Supported Python Versions policy](https://cloud.google.com/python/docs/supported-python-versions)",
5957
FutureWarning,

packages/sqlalchemy-bigquery/sqlalchemy_bigquery/_versions_helpers.py

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This constraints file is used to check that lower bounds
2+
# are correct in setup.py
3+
# List *all* library dependencies and extras in this file.
4+
# Pin the version to the lower bound.
5+
#
6+
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
7+
sqlalchemy==1.4.16
8+
google-auth==2.14.1
9+
google-cloud-bigquery==3.20.0
10+
google-cloud-bigquery-storage==2.18.0
11+
google-api-core==2.11.1
12+
grpcio==1.47.0
13+
numpy==1.26.4
14+
alembic==1.7.7
15+
pyarrow==6.0.0

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

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

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

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

0 commit comments

Comments
 (0)