Skip to content

Commit fe6469a

Browse files
authored
fix(py/genkit): add support for python 3.14 (#3947)
1 parent d674b15 commit fe6469a

File tree

37 files changed

+238
-158
lines changed

37 files changed

+238
-158
lines changed

.github/workflows/python.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- "3.13"
3838
#- "pypy-3.10" # TODO: Fix build failures.
3939
#- "pypy-3.11" # TODO: Fix build failures.
40-
#- "3.14" # TODO: This still fails.
40+
- "3.14"
4141
fail-fast: false
4242

4343
steps:
@@ -46,7 +46,7 @@ jobs:
4646
- name: Install system dependencies
4747
run: |
4848
sudo apt-get update
49-
sudo apt-get install -y build-essential libffi-dev cmake curl ripgrep
49+
sudo apt-get install -y build-essential libffi-dev cmake curl ripgrep libjpeg-dev zlib1g-dev
5050
5151
- name: Set up Go
5252
uses: actions/setup-go@main

py/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
'3.11',
2929
'3.12',
3030
'3.13',
31-
#'3.14', # This still fails.
31+
'3.14',
3232
]
3333

3434

py/packages/genkit/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ classifiers = [
2929
"Programming Language :: Python :: 3.11",
3030
"Programming Language :: Python :: 3.12",
3131
"Programming Language :: Python :: 3.13",
32+
"Programming Language :: Python :: 3.14",
3233
"Topic :: Scientific/Engineering :: Artificial Intelligence",
3334
"Topic :: Software Development :: Libraries",
3435
]

py/packages/genkit/src/genkit/core/typing.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class BaseDataPoint(BaseModel):
5858
model_config = ConfigDict(extra='forbid', populate_by_name=True)
5959
input: Any | None = None
6060
output: Any | None = None
61-
context: list | None = None
61+
context: list[Any] | None = None
6262
reference: Any | None = None
6363
test_case_id: str | None = Field(None, alias='testCaseId')
6464
trace_ids: list[str] | None = Field(None, alias='traceIds')
@@ -74,7 +74,7 @@ class EvalRequest(BaseModel):
7474

7575

7676
class EvalStatusEnum(StrEnum):
77-
"""Enumeration of evalstatusenum values."""
77+
"""EvalStatusEnum data type class."""
7878

7979
UNKNOWN = 'UNKNOWN'
8080
PASS_ = 'PASS'
@@ -126,7 +126,7 @@ class GenkitError(BaseModel):
126126

127127

128128
class Code(StrEnum):
129-
"""Enumeration of code values."""
129+
"""Code data type class."""
130130

131131
BLOCKED = 'blocked'
132132
OTHER = 'other'
@@ -158,7 +158,7 @@ class CustomPart(BaseModel):
158158

159159

160160
class FinishReason(StrEnum):
161-
"""Enumeration of finishreason values."""
161+
"""FinishReason data type class."""
162162

163163
STOP = 'stop'
164164
LENGTH = 'length'
@@ -169,7 +169,7 @@ class FinishReason(StrEnum):
169169

170170

171171
class ToolChoice(StrEnum):
172-
"""Enumeration of toolchoice values."""
172+
"""ToolChoice data type class."""
173173

174174
AUTO = 'auto'
175175
REQUIRED = 'required'
@@ -220,7 +220,7 @@ class GenerationUsage(BaseModel):
220220

221221

222222
class Constrained(StrEnum):
223-
"""Enumeration of constrained values."""
223+
"""Constrained data type class."""
224224

225225
NONE = 'none'
226226
ALL = 'all'
@@ -244,7 +244,7 @@ class Supports(BaseModel):
244244

245245

246246
class Stage(StrEnum):
247-
"""Enumeration of stage values."""
247+
"""Stage data type class."""
248248

249249
FEATURED = 'featured'
250250
STABLE = 'stable'
@@ -301,7 +301,7 @@ class Resource1(BaseModel):
301301

302302

303303
class Role(StrEnum):
304-
"""Enumeration of role values."""
304+
"""Role data type class."""
305305

306306
SYSTEM = 'system'
307307
USER = 'user'
@@ -349,7 +349,7 @@ class ToolResponse(BaseModel):
349349
ref: str | None = None
350350
name: str
351351
output: Any | None = None
352-
content: list | None = None
352+
content: list[Any] | None = None
353353

354354

355355
class CommonRerankerOptions(BaseModel):
@@ -410,7 +410,7 @@ class SameProcessAsParentSpan(BaseModel):
410410

411411

412412
class State(StrEnum):
413-
"""Enumeration of state values."""
413+
"""State data type class."""
414414

415415
SUCCESS = 'success'
416416
ERROR = 'error'
@@ -462,10 +462,10 @@ class TraceMetadata(BaseModel):
462462
timestamp: float
463463

464464

465-
class Context(RootModel[list]):
465+
class Context(RootModel[list[Any]]):
466466
"""Root model for context."""
467467

468-
root: list
468+
root: list[Any]
469469

470470

471471
class Input(RootModel[Any]):
@@ -504,10 +504,10 @@ class MediaModel(RootModel[Any]):
504504
root: Any
505505

506506

507-
class Metadata(RootModel[dict[str, Any] | None]):
507+
class Metadata(RootModel[dict[str, Any]]):
508508
"""Root model for metadata."""
509509

510-
root: dict[str, Any] | None = None
510+
root: dict[str, Any]
511511

512512

513513
class Reasoning(RootModel[Any]):
@@ -540,10 +540,10 @@ class ToolResponseModel(RootModel[Any]):
540540
root: Any
541541

542542

543-
class Custom(RootModel[dict[str, Any] | None]):
543+
class Custom(RootModel[dict[str, Any]]):
544544
"""Root model for custom."""
545545

546-
root: dict[str, Any] | None = None
546+
root: dict[str, Any]
547547

548548

549549
class Config(RootModel[Any]):

py/plugins/anthropic/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ classifiers = [
2929
"Programming Language :: Python :: 3.11",
3030
"Programming Language :: Python :: 3.12",
3131
"Programming Language :: Python :: 3.13",
32+
"Programming Language :: Python :: 3.14",
3233
"Topic :: Scientific/Engineering :: Artificial Intelligence",
3334
"Topic :: Software Development :: Libraries",
3435
]

py/plugins/compat-oai/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ classifiers = [
2929
"Programming Language :: Python :: 3.11",
3030
"Programming Language :: Python :: 3.12",
3131
"Programming Language :: Python :: 3.13",
32+
"Programming Language :: Python :: 3.14",
3233
"Topic :: Scientific/Engineering :: Artificial Intelligence",
3334
"Topic :: Software Development :: Libraries",
3435
]

py/plugins/dev-local-vectorstore/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ classifiers = [
2929
"Programming Language :: Python :: 3.11",
3030
"Programming Language :: Python :: 3.12",
3131
"Programming Language :: Python :: 3.13",
32+
"Programming Language :: Python :: 3.14",
3233
"Topic :: Scientific/Engineering :: Artificial Intelligence",
3334
"Topic :: Software Development :: Libraries",
3435
]

py/plugins/evaluators/pyproject.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,16 @@ classifiers = [
2626
"Programming Language :: Python",
2727
"Programming Language :: Python :: 3.12",
2828
"Programming Language :: Python :: 3.13",
29+
"Programming Language :: Python :: 3.14",
2930
"Programming Language :: Python :: 3 :: Only",
3031
"Topic :: Scientific/Engineering :: Artificial Intelligence",
3132
"Topic :: Software Development :: Libraries",
3233
]
3334
dependencies = [
34-
"genkit",
35-
"jsonata-python>=0.5.3",
36-
"pydantic>=2.10.5",
37-
"strenum>=0.4.15; python_version < '3.11'",
35+
"genkit",
36+
"jsonata-python>=0.5.3",
37+
"pydantic>=2.10.5",
38+
"strenum>=0.4.15; python_version < '3.11'",
3839
]
3940
description = "Genkit Evaluators Plugin for RAGAS"
4041
license = { text = "Apache-2.0" }

py/plugins/evaluators/src/genkit/plugins/evaluators/constant.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717

1818
from collections.abc import Callable
19+
1920
try:
2021
from enum import StrEnum
2122
except ImportError:

py/plugins/firebase/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ classifiers = [
2929
"Programming Language :: Python :: 3.11",
3030
"Programming Language :: Python :: 3.12",
3131
"Programming Language :: Python :: 3.13",
32+
"Programming Language :: Python :: 3.14",
3233
"Topic :: Scientific/Engineering :: Artificial Intelligence",
3334
"Topic :: Software Development :: Libraries",
3435
]

0 commit comments

Comments
 (0)