From a4b8883c32c9f02eefd0b5b57fa210f013415b4c Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Wed, 18 Nov 2026 17:47:25 -0700 Subject: [PATCH] feat(documentai-toolbox): drop Python 3.10 support --- .../README.rst | 4 +-- .../docs/README.rst | 4 +-- .../cloud/documentai_toolbox/__init__.py | 13 ------- .../noxfile.py | 20 ++++++++--- .../google-cloud-documentai-toolbox/setup.py | 7 ++-- .../testing/constraints-3.10.txt | 22 ------------ .../testing/constraints-3.11.txt | 34 ++++++++++++------- 7 files changed, 44 insertions(+), 60 deletions(-) delete mode 100644 packages/google-cloud-documentai-toolbox/testing/constraints-3.10.txt diff --git a/packages/google-cloud-documentai-toolbox/README.rst b/packages/google-cloud-documentai-toolbox/README.rst index 12ac2eae9881..705272a90c50 100644 --- a/packages/google-cloud-documentai-toolbox/README.rst +++ b/packages/google-cloud-documentai-toolbox/README.rst @@ -63,14 +63,14 @@ Supported Python Versions Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of Python. -Python >= 3.10 +Python >= 3.11 .. _active: https://devguide.python.org/devcycle/#in-development-main-branch .. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches Unsupported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python <= 3.9 +Python <= 3.10 If you are using an `end-of-life`_ version of Python, we recommend that you update as soon as possible to an actively supported version. diff --git a/packages/google-cloud-documentai-toolbox/docs/README.rst b/packages/google-cloud-documentai-toolbox/docs/README.rst index 12ac2eae9881..705272a90c50 100644 --- a/packages/google-cloud-documentai-toolbox/docs/README.rst +++ b/packages/google-cloud-documentai-toolbox/docs/README.rst @@ -63,14 +63,14 @@ Supported Python Versions Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of Python. -Python >= 3.10 +Python >= 3.11 .. _active: https://devguide.python.org/devcycle/#in-development-main-branch .. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches Unsupported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python <= 3.9 +Python <= 3.10 If you are using an `end-of-life`_ version of Python, we recommend that you update as soon as possible to an actively supported version. diff --git a/packages/google-cloud-documentai-toolbox/google/cloud/documentai_toolbox/__init__.py b/packages/google-cloud-documentai-toolbox/google/cloud/documentai_toolbox/__init__.py index d9b9098b0088..8d0767277eab 100644 --- a/packages/google-cloud-documentai-toolbox/google/cloud/documentai_toolbox/__init__.py +++ b/packages/google-cloud-documentai-toolbox/google/cloud/documentai_toolbox/__init__.py @@ -14,9 +14,6 @@ # limitations under the License. # -import sys -import warnings - from google.cloud.documentai_toolbox import version as package_version __version__ = package_version.__version__ @@ -33,13 +30,3 @@ "docai_utilities", "gcs_utilities", ) - - -# Checks if the current runtime is Python < 3.10. -if sys.version_info < (3, 10): # pragma: NO COVER - message = ( - "The google-cloud-documentai-toolbox library no longer supports Python 3.7, 3.8, and 3.9. " - "We recommend that you update soon to ensure ongoing support. For " - "more details, see: [Google Cloud Client Libraries Supported Python Versions policy](https://cloud.google.com/python/docs/supported-python-versions)" - ) - warnings.warn(message, FutureWarning) diff --git a/packages/google-cloud-documentai-toolbox/noxfile.py b/packages/google-cloud-documentai-toolbox/noxfile.py index c1d2ab53dde8..3e5d7e14d8bd 100644 --- a/packages/google-cloud-documentai-toolbox/noxfile.py +++ b/packages/google-cloud-documentai-toolbox/noxfile.py @@ -40,7 +40,7 @@ DEFAULT_PYTHON_VERSION = "3.14" -UNIT_TEST_PYTHON_VERSIONS: List[str] = [ +ALL_PYTHON: List[str] = [ "3.10", "3.11", "3.12", @@ -49,6 +49,14 @@ "3.15", ] +UNIT_TEST_PYTHON_VERSIONS: List[str] = [ + "3.11", + "3.12", + "3.13", + "3.14", + "3.15", +] + UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", @@ -88,7 +96,6 @@ nox.options.sessions = [ - "unit-3.10", "unit-3.11", "unit-3.12", "unit-3.13", @@ -212,12 +219,15 @@ def install_unittest_dependencies(session, *constraints): session.install("-e", ".", *constraints) -@nox.session(python=UNIT_TEST_PYTHON_VERSIONS) +@nox.session(python=ALL_PYTHON) @nox.parametrize( "protobuf_implementation", ["python", "upb"], ) def unit(session, protobuf_implementation): + if session.python not in UNIT_TEST_PYTHON_VERSIONS: + session.skip(f"Python {session.python} is not supported.") + # Install all test dependencies, then install this package in-place. constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" @@ -329,7 +339,7 @@ def cover(session): session.run("coverage", "erase") -@nox.session(python="3.10") +@nox.session(python="3.11") def docs(session): """Build the docs for this library.""" @@ -364,7 +374,7 @@ def docs(session): ) -@nox.session(python="3.10") +@nox.session(python="3.11") def docfx(session): """Build the docfx yaml files for this library.""" diff --git a/packages/google-cloud-documentai-toolbox/setup.py b/packages/google-cloud-documentai-toolbox/setup.py index fb98c43de888..7ca6f9a3c0b7 100644 --- a/packages/google-cloud-documentai-toolbox/setup.py +++ b/packages/google-cloud-documentai-toolbox/setup.py @@ -62,21 +62,20 @@ "grpc-google-iam-v1>=0.14.2, <1.0.0", "google-cloud-bigquery>=3.14.0, <4.0.0", "google-cloud-documentai>=3.2.1, <4.0.0", - "google-cloud-storage>=2.3.0, <4.0.0", + "google-cloud-storage>=2.8.0, <4.0.0", "google-cloud-vision>=3.10.1, <4.0.0", "numpy>=1.23.5, <3.0.0", "intervaltree>=3.0.0", "pikepdf>=8.0.0, <11.0.0", "immutabledict>=2.0.0, <5.0.0", - "Pillow>=10.0.0, <13.0.0", + "Pillow>=13.0.0, <14.0.0", "Jinja2>=3.1.0, <4.0.0", ), - python_requires=">=3.10", + python_requires=">=3.11", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Operating System :: OS Independent", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", diff --git a/packages/google-cloud-documentai-toolbox/testing/constraints-3.10.txt b/packages/google-cloud-documentai-toolbox/testing/constraints-3.10.txt deleted file mode 100644 index b10dea95c1dc..000000000000 --- a/packages/google-cloud-documentai-toolbox/testing/constraints-3.10.txt +++ /dev/null @@ -1,22 +0,0 @@ -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.25.0 -pandas==2.0.0 -pyarrow==15.0.0 -tabulate==0.9.0 -proto-plus==1.26.1 -grpc-google-iam-v1==0.14.2 -google-cloud-bigquery==3.14.0 -google-cloud-documentai==3.2.1 -google-cloud-storage==2.3.0 -google-cloud-vision==3.10.1 -numpy==1.23.5 -intervaltree==3.0.0 -pikepdf==8.0.0 -immutabledict==2.0.0 -Pillow==12.2.0 -Jinja2==3.1.6 diff --git a/packages/google-cloud-documentai-toolbox/testing/constraints-3.11.txt b/packages/google-cloud-documentai-toolbox/testing/constraints-3.11.txt index e830766f197e..80caddc1b502 100644 --- a/packages/google-cloud-documentai-toolbox/testing/constraints-3.11.txt +++ b/packages/google-cloud-documentai-toolbox/testing/constraints-3.11.txt @@ -1,12 +1,22 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -pandas -proto-plus -grpc-google-iam-v1 -google-cloud-bigquery -google-cloud-documentai -google-cloud-storage -numpy -pikepdf +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.25.0 +pandas==2.0.0 +pyarrow==15.0.0 +tabulate==0.9.0 +proto-plus==1.26.1 +grpc-google-iam-v1==0.14.2 +google-cloud-bigquery==3.14.0 +google-cloud-documentai==3.2.1 +google-cloud-storage==2.8.0 +google-cloud-vision==3.10.1 +numpy==1.23.5 +intervaltree==3.0.0 +pikepdf==8.0.0 +immutabledict==2.0.0 +Pillow==13.0.0 +Jinja2==3.1.6