Skip to content

fix(documentai-toolbox): Drop support for Python <= 3.9#16967

Open
chalmerlowe wants to merge 7 commits intomainfrom
feat/drop-python-3.7-3.9-google-cloud-documentai-toolbox
Open

fix(documentai-toolbox): Drop support for Python <= 3.9#16967
chalmerlowe wants to merge 7 commits intomainfrom
feat/drop-python-3.7-3.9-google-cloud-documentai-toolbox

Conversation

@chalmerlowe
Copy link
Copy Markdown
Contributor

@chalmerlowe chalmerlowe commented May 6, 2026

This PR updates google-cloud-documentai-toolbox to establish Python 3.10 as the minimum supported version, dropping support for Python 3.9 and below.

Changes

  • Configuration: Updated setup.py and noxfile.py to require Python 3.10+ and remove references to Python 3.9. Deleted constraints-3.9.txt.
  • Documentation: Updated README.rst and CONTRIBUTING.rst to require Python 3.10+ and remove references to Python 3.9. Synced the top-level README.rst to the docs folder.
  • Cleanup: Removed obsolete warning suppressions in pytest.ini related to Python 3.7 and 3.8. Updated the runtime version check in __init__.py to warn on versions older than 3.10.
  • Dependency Fixes: Resolved dependency conflicts on Python 3.10 by bumping the minimum version of google-cloud-storage to 2.0.0 in setup.py to avoid conflicts with google-auth. Added setuptools==79.0.0 to constraints-3.10.txt to resolve the ModuleNotFoundError: No module named 'pkg_resources' and avoid its subsequent deprecation warning.

Fixes internal issue: http://b/482126936 🦕

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request drops support for Python 3.9 across the package, updating documentation, runtime version checks, test configurations, and package metadata to reflect a new minimum requirement of Python 3.10. The review feedback correctly identifies that while Python 3.9 was removed, Python 3.13 and 3.14 should be explicitly added to the test matrices in noxfile.py and the Trove classifiers in setup.py to align with the supported versions mentioned in the documentation.

I am having trouble creating individual review comments. Click here to see my feedback.

packages/google-cloud-documentai-toolbox/noxfile.py (39-41)

medium

To align with the supported versions listed in CONTRIBUTING.rst (3.10-3.14), please add Python 3.13 and 3.14 to this list. This ensures unit tests cover all supported Python versions.

    "3.10",
    "3.11",
    "3.12",
    "3.13",
    "3.14",
References
  1. Verify that suggested additions to a configuration list (such as Python versions in a test matrix) are not already present in the file before recommending their inclusion to avoid false positive suggestions.

packages/google-cloud-documentai-toolbox/noxfile.py (74-76)

medium

To match the updated UNIT_TEST_PYTHON_VERSIONS, please also add unit-3.13 and unit-3.14 to the default nox sessions. This ensures all supported versions are run by default.

    "unit-3.10",
    "unit-3.11",
    "unit-3.12",
    "unit-3.13",
    "unit-3.14",
References
  1. Verify that suggested additions to a configuration list (such as Python versions in a test matrix) are not already present in the file before recommending their inclusion to avoid false positive suggestions.

packages/google-cloud-documentai-toolbox/setup.py (81)

medium

The classifiers for supported Python versions are incomplete. According to CONTRIBUTING.rst, Python 3.13 and 3.14 are also supported. Please add the corresponding classifiers for PyPI metadata correctness.

        "Programming Language :: Python :: 3.12",
        "Programming Language :: Python :: 3.13",
        "Programming Language :: Python :: 3.14",
References
  1. When updating the minimum supported Python version in runtime checks (e.g., 'sys.version_info' checks), ensure that the project's metadata in 'setup.py' or 'pyproject.toml' is also updated to reflect the same minimum version in 'python_requires' and Trove classifiers.

@parthea parthea marked this pull request as ready for review May 6, 2026 20:00
@parthea parthea requested a review from a team as a code owner May 6, 2026 20:00

def install_unittest_dependencies(session, *constraints):
standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES
session.install("setuptools")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please could you clarify why setuptools is needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants