Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/import.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']

steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.10', '3.11', '3.12', '3.13', '3.14']

steps:
- name: Checkout code
Expand Down
15 changes: 7 additions & 8 deletions google/genai/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import sys
import types as builtin_types
import typing
from typing import Annotated, Any, Callable, Dict, List, Literal, Optional, Sequence, Union
from typing import Annotated, Any, Callable, Dict, List, Literal, Optional, Sequence, Union, _UnionGenericAlias # type: ignore
import pydantic
from pydantic import ConfigDict, Field, PrivateAttr, WrapValidator, model_validator
from typing_extensions import Self, TypedDict
Expand All @@ -37,15 +37,14 @@
_UploadToFileSearchStoreOperation_from_mldev,
)

if sys.version_info >= (3, 14):
# Union[t1, t2] and t1 | t2 both create builtin_types.UnionType, and
# typing._UnionGenericAlias is deprecated.
VersionedUnionType = builtin_types.UnionType
_UNION_TYPES = (typing.Union, builtin_types.UnionType)
else:
if sys.version_info >= (3, 10):
# Supports both Union[t1, t2] and t1 | t2
VersionedUnionType = Union[builtin_types.UnionType, typing._UnionGenericAlias] # type: ignore
VersionedUnionType = Union[builtin_types.UnionType, _UnionGenericAlias]
_UNION_TYPES = (typing.Union, builtin_types.UnionType)
else:
# Supports only Union[t1, t2]
VersionedUnionType = _UnionGenericAlias
_UNION_TYPES = (typing.Union,)

_is_pillow_image_imported = False
if typing.TYPE_CHECKING:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ classifiers = [
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Topic :: Internet",
"Topic :: Software Development :: Libraries :: Python Modules",
]
Expand Down
9 changes: 3 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@ 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==11.0.0
pluggy==1.5.0
py==1.11.0
pyasn1==0.6.1
pyasn1_modules==0.4.1
pydantic==2.12.0; python_version < '3.15'
pydantic==2.14.1; python_version >= '3.15'
pydantic_core==2.41.1; python_version < '3.15'
pydantic_core==2.50.1; python_version >= '3.15'
pydantic==2.12.0
pydantic_core==2.41.1
pyopenssl==24.2.1
pytest==8.3.4
pytest-asyncio==0.25.0
Expand Down
Loading