diff --git a/packages/google-cloud-documentai-toolbox/CONTRIBUTING.rst b/packages/google-cloud-documentai-toolbox/CONTRIBUTING.rst index 96ef5f655ca1..5f82574cbc8d 100644 --- a/packages/google-cloud-documentai-toolbox/CONTRIBUTING.rst +++ b/packages/google-cloud-documentai-toolbox/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows. + 3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -148,8 +148,7 @@ Running System Tests .. note:: - System tests are only configured to run under Python 3.9 and 3.14. - For expediency, we do not run them in older versions of Python 3. + System tests are only configured to run under Python 3.10 and 3.14. This alone will not run the tests. You'll need to change some local auth settings and change some configuration in your project to @@ -197,14 +196,12 @@ Supported Python Versions We support: -- `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ - `Python 3.12`_ - `Python 3.13`_ - `Python 3.14`_ -.. _Python 3.9: https://docs.python.org/3.9/ .. _Python 3.10: https://docs.python.org/3.10/ .. _Python 3.11: https://docs.python.org/3.11/ .. _Python 3.12: https://docs.python.org/3.12/ @@ -217,17 +214,7 @@ Supported versions can be found in our ``noxfile.py`` `config`_. .. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/google-cloud-documentai-toolbox/noxfile.py -We also explicitly decided to support Python 3 beginning with version 3.9. -Reasons for this include: -- Encouraging use of newest versions of Python 3 -- Taking the lead of `prominent`_ open-source `projects`_ -- `Unicode literal support`_ which allows for a cleaner codebase that - works in both Python 2 and Python 3 - -.. _prominent: https://docs.djangoproject.com/en/1.9/faq/install/#what-python-version-can-i-use-with-django -.. _projects: http://flask.pocoo.org/docs/0.10/python3/ -.. _Unicode literal support: https://www.python.org/dev/peps/pep-0414/ ********** Versioning diff --git a/packages/google-cloud-documentai-toolbox/README.rst b/packages/google-cloud-documentai-toolbox/README.rst index 8ea93c665413..12ac2eae9881 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.9 +Python >= 3.10 .. _active: https://devguide.python.org/devcycle/#in-development-main-branch .. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches Unsupported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python <= 3.8 +Python <= 3.9 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 8ea93c665413..12ac2eae9881 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.9 +Python >= 3.10 .. _active: https://devguide.python.org/devcycle/#in-development-main-branch .. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches Unsupported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python <= 3.8 +Python <= 3.9 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 1c5cdba52088..d9b9098b0088 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 @@ -35,17 +35,11 @@ ) -class Python37DeprecationWarning(DeprecationWarning): # pragma: NO COVER - """ - Deprecation warning raised when Python 3.7 runtime is detected. - Python 3.7 support will be dropped after January 1, 2024. - """ - - -# Checks if the current runtime is Python 3.7. -if sys.version_info.major == 3 and sys.version_info.minor == 7: # pragma: NO COVER +# Checks if the current runtime is Python < 3.10. +if sys.version_info < (3, 10): # pragma: NO COVER message = ( - "After January 1, 2024, new releases of this library will drop support " - "for Python 3.7." + "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, Python37DeprecationWarning) + warnings.warn(message, FutureWarning) diff --git a/packages/google-cloud-documentai-toolbox/noxfile.py b/packages/google-cloud-documentai-toolbox/noxfile.py index 18ecc88ef61b..043edf35c0d4 100644 --- a/packages/google-cloud-documentai-toolbox/noxfile.py +++ b/packages/google-cloud-documentai-toolbox/noxfile.py @@ -36,7 +36,6 @@ DEFAULT_PYTHON_VERSION = "3.14" UNIT_TEST_PYTHON_VERSIONS: List[str] = [ - "3.9", "3.10", "3.11", "3.12", @@ -50,6 +49,7 @@ "pytest", "pytest-cov", "pytest-asyncio", + "setuptools", ] UNIT_TEST_EXTERNAL_DEPENDENCIES: List[str] = [] UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = [] @@ -57,7 +57,7 @@ UNIT_TEST_EXTRAS: List[str] = [] UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} -SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.9", "3.14"] +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.10", "3.14"] SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [ "mock", "pytest", @@ -72,7 +72,6 @@ CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() nox.options.sessions = [ - "unit-3.9", "unit-3.10", "unit-3.11", "unit-3.12", @@ -157,6 +156,7 @@ def lint_setup_py(session): def install_unittest_dependencies(session, *constraints): standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES + session.install("setuptools") session.install(*standard_deps, *constraints) if UNIT_TEST_EXTERNAL_DEPENDENCIES: diff --git a/packages/google-cloud-documentai-toolbox/pytest.ini b/packages/google-cloud-documentai-toolbox/pytest.ini index 67178532d0f7..8b8d46c08c6c 100644 --- a/packages/google-cloud-documentai-toolbox/pytest.ini +++ b/packages/google-cloud-documentai-toolbox/pytest.ini @@ -6,15 +6,11 @@ filterwarnings = ignore:.*custom tp_new.*in Python 3.14:DeprecationWarning # Remove once https://github.com/dateutil/dateutil/issues/1314 is fixed ignore:datetime.datetime.utcfromtimestamp\(\) is deprecated:DeprecationWarning:dateutil.tz.tz - # Remove once Python3.7 support is dropped https://github.com/googleapis/python-documentai-toolbox/issues/209 - ignore:distutils Version classes are deprecated:DeprecationWarning - # Remove after support for Python 3.7 is dropped - ignore:After January 1, 2024, new releases of this library will drop support for Python 3.7:DeprecationWarning + # Remove once the minimum supported version of `google-api-core` is 2.15.0 ignore:.*pkg_resources.declare_namespace:DeprecationWarning ignore:.*pkg_resources is deprecated as an API:DeprecationWarning - # Remove once the minimum supported Python runtime of this library is Python 3.9 - ignore:The python-bigquery library will stop supporting Python 3.7 and Python 3.8:PendingDeprecationWarning + # This error is expected for python versions that approach EOL ignore:.*Please upgrade to the latest Python version.*:FutureWarning ignore:(?s).*using a Python version.*past its end of life.*:FutureWarning diff --git a/packages/google-cloud-documentai-toolbox/setup.py b/packages/google-cloud-documentai-toolbox/setup.py index ea90579a0410..a19c60c08f04 100644 --- a/packages/google-cloud-documentai-toolbox/setup.py +++ b/packages/google-cloud-documentai-toolbox/setup.py @@ -62,7 +62,7 @@ "grpc-google-iam-v1>=0.12.6, <1.0.0", "google-cloud-bigquery>=3.14.0, <4.0.0", "google-cloud-documentai>=2.29.2, <4.0.0", - "google-cloud-storage>=1.31.0, <4.0.0", + "google-cloud-storage>=2.0.0, <4.0.0", "google-cloud-vision>=2.7.0, <4.0.0", "numpy>=1.23.5, <3.0.0", "intervaltree>=3.0.0", @@ -71,12 +71,11 @@ "Pillow>=10.0.0, <12.0.0", "Jinja2>=3.1.0, <4.0.0", ), - python_requires=">=3.9", + python_requires=">=3.10", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Operating System :: OS Independent", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", diff --git a/packages/google-cloud-documentai-toolbox/testing/constraints-3.10.txt b/packages/google-cloud-documentai-toolbox/testing/constraints-3.10.txt index e830766f197e..0306d1cf6758 100644 --- a/packages/google-cloud-documentai-toolbox/testing/constraints-3.10.txt +++ b/packages/google-cloud-documentai-toolbox/testing/constraints-3.10.txt @@ -1,12 +1,15 @@ -# -*- 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 +google-api-core==2.15.0 +pandas==2.0.0 +pyarrow==15.0.0 +tabulate==0.9.0 +proto-plus==1.22.3 +grpc-google-iam-v1==0.12.6 +google-cloud-bigquery==3.14.0 +google-cloud-documentai==2.29.2 +numpy==1.23.5 +intervaltree==3.0.0 +pikepdf==8.0.0 +immutabledict==2.0.0 +Pillow==10.0.0 +Jinja2==3.1.0 +google-cloud-core==2.5.0 diff --git a/packages/google-cloud-documentai-toolbox/testing/constraints-3.9.txt b/packages/google-cloud-documentai-toolbox/testing/constraints-3.9.txt deleted file mode 100644 index d46fe6312c3f..000000000000 --- a/packages/google-cloud-documentai-toolbox/testing/constraints-3.9.txt +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file. -# Pin the version to the lower bound. -# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", -# Then this file should have google-cloud-foo==1.14.0 -google-api-core==2.15.0 -pandas==2.0.0 -proto-plus==1.22.3 -grpc-google-iam-v1==0.12.6 -google-cloud-bigquery==3.14.0 -google-cloud-documentai==2.29.2 -google-cloud-storage==2.7.0 -pandas-gbq==0.21.0 -numpy==1.23.5 -pikepdf==8.2.3