Skip to content

chore(multiple samples): bump pillow to 12.2.0 and restrict to python 3.10+#14251

Draft
XrossFox wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
XrossFox:python-pillow-dependency-update-1
Draft

chore(multiple samples): bump pillow to 12.2.0 and restrict to python 3.10+#14251
XrossFox wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
XrossFox:python-pillow-dependency-update-1

Conversation

@XrossFox
Copy link
Copy Markdown
Contributor

@XrossFox XrossFox commented May 29, 2026

  • Consolidated multiple pillow entries across requirements files into a single, version-pinned entry (pillow==12.2.0).
  • Restricted execution strictly to Python 3.10 and newer (python_version >= "3.10") to resolve compatibility conflicts.

Description

Fixes b/517989048

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

… 3.10+

 - Consolidated multiple pillow entries across requirements files into a single, version-pinned entry (`pillow==12.2.0`).
 - Restricted execution strictly to Python 3.10 and newer (`python_version >= "3.10"`) to resolve compatibility conflicts.
@product-auto-label product-auto-label Bot added samples Issues that are directly related to samples. api: appengine Issues related to the App Engine Admin API API. api: people-and-planet-ai api: vision Issues related to the Cloud Vision API. labels May 29, 2026
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 updates the pillow dependency to version 12.2.0 (restricted to Python >= 3.10) across multiple requirements.txt files. The reviewer noted that restricting pillow to Python >= 3.10 without providing a fallback for older Python versions will cause installation and runtime issues on environments running Python 3.8 or 3.9, which are still supported by other dependencies in these files. It is recommended to add a fallback pin (such as pillow==10.4.0; python_version < "3.10") to maintain backward compatibility.

numpy==1.26.4; python_version == '3.9'
numpy==1.24.4; python_version == '3.8'
pillow==10.4.0
pillow==12.2.0; python_version >= "3.10"
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.

high

By restricting pillow to python_version >= "3.10" without providing a fallback for older Python versions, environments running Python 3.8 or 3.9 (which are still supported by other dependencies in this file, such as numpy==1.24.4 and scipy==1.10.1) will fail to install pillow entirely. This will lead to ModuleNotFoundError at runtime. Please add a fallback pin for Python < 3.10.

pillow==10.4.0; python_version < "3.10"
pillow==12.2.0; python_version >= "3.10"

pandas==2.2.3; python_version > '3.8'
pillow==10.4.0; python_version < '3.8'
pillow==10.4.0; python_version >= '3.8'
pillow==12.2.0; python_version >= "3.10"
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.

high

Restricting pillow to >= 3.10 without a fallback will cause installation to omit pillow on Python 3.8 and 3.9, which are still supported by other dependencies in this file (e.g., pandas). Please provide a fallback version for Python < 3.10 to prevent runtime import errors.

pillow==10.4.0; python_version < "3.10"
pillow==12.2.0; python_version >= "3.10"

google-cloud-vision==3.8.1
pillow==10.3.0; python_version < '3.8'
pillow==10.4.0; python_version >= '3.8'
pillow==12.2.0; python_version >= "3.10"
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.

high

Since google-cloud-vision supports Python 3.8 and 3.9, completely omitting pillow on Python < 3.10 will break this snippet for users on those Python versions. Please add a fallback for Python < 3.10.

pillow==10.4.0; python_version < "3.10"
pillow==12.2.0; python_version >= "3.10"

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

Labels

api: appengine Issues related to the App Engine Admin API API. api: people-and-planet-ai api: vision Issues related to the Cloud Vision API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant