fix(db-dtypes): Drop support for Python <= 3.9 (#16966) · googleapis/google-cloud-python@6698861 · GitHub
Skip to content

Commit 6698861

Browse files
authored
fix(db-dtypes): Drop support for Python <= 3.9 (#16966)
This PR updates \`db-dtypes\` 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 metadata and python_requires to >=3.10. * Nox: Updated noxfile.py sessions and deleted constraints-3.9.txt. * Documentation: Updated README.rst and CONTRIBUTING.rst (and synced to docs/README.rst!). * Removed extract_runtime_version and its helper file from db_dtypes * Updated the tests to mock sys.version_info correctly. Fixes internal issue: http://b/482126936 🦕
1 parent 8fa321e commit 6698861

10 files changed

Lines changed: 40 additions & 81 deletions

File tree

packages/db-dtypes/CONTRIBUTING.rst

Lines changed: 3 additions & 16 deletions

packages/db-dtypes/README.rst

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

3535
Supported Python Versions
3636
^^^^^^^^^^^^^^^^^^^^^^^^^
37-
Python >= 3.9
37+
Python >= 3.10
3838

3939
Unsupported Python Versions
4040
^^^^^^^^^^^^^^^^^^^^^^^^^^^
41-
Python <= 3.8.
41+
Python <= 3.9
4242

4343

4444
Mac/Linux

packages/db-dtypes/db_dtypes/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
from db_dtypes import core
3131
from db_dtypes.json import JSONArray, JSONArrowType, JSONDtype # noqa: F401
3232

33-
from . import _versions_helpers
3433

3534
date_dtype_name = "dbdate"
3635
time_dtype_name = "dbtime"
@@ -341,12 +340,13 @@ def __sub__(self, other):
341340

342341
def _check_python_version():
343342
"""Checks the runtime Python version and issues a warning if needed."""
344-
sys_major, sys_minor, sys_micro = _versions_helpers.extract_runtime_version()
345-
if sys_major == 3 and sys_minor in (7, 8):
343+
import sys
344+
345+
if sys.version_info < (3, 10):
346346
warnings.warn(
347347
"The python-bigquery library as well as the python-db-dtypes-pandas library no "
348-
"longer supports Python 3.7 and Python 3.8. "
349-
f"Your Python version is {sys_major}.{sys_minor}.{sys_micro}. We "
348+
"longer supports Python 3.7, 3.8, and 3.9. "
349+
f"Your Python version is {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}. We "
350350
"recommend that you update soon to ensure ongoing support. For "
351351
"more details, see: [Google Cloud Client Libraries Supported Python Versions policy](https://cloud.google.com/python/docs/supported-python-versions)",
352352
FutureWarning,

packages/db-dtypes/db_dtypes/_versions_helpers.py

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

packages/db-dtypes/docs/README.rst

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

3535
Supported Python Versions
3636
^^^^^^^^^^^^^^^^^^^^^^^^^
37-
Python >= 3.9
37+
Python >= 3.10
3838

3939
Unsupported Python Versions
4040
^^^^^^^^^^^^^^^^^^^^^^^^^^^
41-
Python <= 3.8.
41+
Python <= 3.9
4242

4343

4444
Mac/Linux

packages/db-dtypes/noxfile.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
LINT_PYTHON_VERSION = "3.10"
3838

3939
UNIT_TEST_PYTHON_VERSIONS: List[str] = [
40-
"3.9",
4140
"3.10",
4241
"3.11",
4342
"3.12",
@@ -58,7 +57,7 @@
5857
UNIT_TEST_EXTRAS: List[str] = []
5958
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
6059

61-
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.9"]
60+
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.12"]
6261
SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [
6362
"mock",
6463
"pytest",

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.9",
6867
"Programming Language :: Python :: 3.10",
6968
"Programming Language :: Python :: 3.11",
7069
"Programming Language :: Python :: 3.12",
@@ -75,6 +74,6 @@ def readme():
7574
],
7675
platforms="Posix; MacOS X; Windows",
7776
install_requires=dependencies,
78-
python_requires=">=3.9",
77+
python_requires=">=3.10",
7978
tests_require=["pytest"],
8079
)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
# pinning their versions to their lower bounds.
5+
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
6+
# then this file should have google-cloud-foo==1.14.0
7+
numpy==1.24.0
8+
packaging==24.2.0
9+
pandas==1.5.3
10+
pyarrow==13.0.0

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

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

packages/db-dtypes/tests/unit/test__init__.py

Lines changed: 16 additions & 9 deletions

0 commit comments

Comments
 (0)