From dcfa12aa4fa894c82350efe8148a406586fd3155 Mon Sep 17 00:00:00 2001 From: Mark Daoust Date: Mon, 26 Oct 2026 09:10:14 -0700 Subject: [PATCH] feat: Add `pillow` extra and require pillow>=13.0.0 in extras PiperOrigin-RevId: 1007325000 --- .github/workflows/import.yml | 2 +- .github/workflows/mypy.yml | 2 +- google/genai/types.py | 2 +- pyproject.toml | 6 +++--- requirements.txt | 7 +++---- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/import.yml b/.github/workflows/import.yml index 08e11ec02f..89cb1a6f50 100644 --- a/.github/workflows/import.yml +++ b/.github/workflows/import.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15'] + python-version: ['3.11', '3.12', '3.13', '3.14', '3.15'] steps: - name: Checkout repository diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index c422de85f6..c096bc4fe2 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15'] + python-version: ['3.11', '3.12', '3.13', '3.14', '3.15'] steps: - name: Checkout code diff --git a/google/genai/types.py b/google/genai/types.py index 7a18e2a6d6..2a4f197a0e 100644 --- a/google/genai/types.py +++ b/google/genai/types.py @@ -9712,7 +9712,7 @@ def _pil_image(self) -> Optional['PIL_Image']: if not PIL_Image: raise RuntimeError( 'The PIL module is not available. Please install the Pillow' - ' package. `pip install pillow`' + ' package. `pip install google-genai[pillow]`' ) if self.image_bytes is None: raise ValueError('The image bytes are not set.') diff --git a/pyproject.toml b/pyproject.toml index d0396e651d..84cfea035c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ version = "2.33.0" description = "GenAI Python SDK" readme = "README.md" license = "Apache-2.0" -requires-python = ">=3.10" +requires-python = ">=3.11" authors = [ { name = "Google LLC", email = "googleapis-packages@google.com" }, ] @@ -16,7 +16,6 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", @@ -41,10 +40,11 @@ dependencies = [ [project.optional-dependencies] aiohttp = ["aiohttp>=3.10.11, <4.0.0"] httpx2 = ["httpx2>=2.0.0, <3.0.0"] +pillow = ["pillow>=13.0.0"] local-tokenizer = [ "sentencepiece>=0.2.0", "protobuf", - "pillow", + "pillow>=13.0.0", "torch", "torchvision", "transformers", diff --git a/requirements.txt b/requirements.txt index c8f6e0aa4d..bd0195e3f8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,13 +7,12 @@ charset-normalizer==3.4.0 coverage==7.6.9 distro==1.9.0 httpx==0.28.1 -httpx2==2.7.0; python_version >= '3.10' +httpx2==2.7.0 google-auth==2.56.0 idna==3.18 iniconfig==2.0.0 packaging==24.2 -pillow==11.0.0; python_version < '3.15' -pillow==12.3.0; python_version >= '3.15' +pillow==13.0.0 pluggy==1.5.0 py==1.11.0 pyasn1==0.6.1 @@ -33,6 +32,6 @@ tenacity==8.2.3 typing_extensions>=4.14.1 urllib3==2.5.0 websockets==16.0 -mcp>=1.14.0,<2.0.0; python_version > '3.9' +mcp>=1.14.0,<2.0.0 sentencepiece>=0.2.0 protobuf