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/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
timeout-minutes: 90 # TODO: need to reduce this after we figure out our testing strategy.
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"] # Need to add 3.13 once we resolve outlines issues.
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Free disk space
Expand Down
4 changes: 2 additions & 2 deletions cli/decompose/decompose.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import keyword
import re
from enum import Enum
from enum import StrEnum
from graphlib import TopologicalSorter
from pathlib import Path
from typing import Annotated
Expand All @@ -13,7 +13,7 @@

# Must maintain declaration order
# Newer versions must be declared on the bottom
class DecompVersion(str, Enum):
class DecompVersion(StrEnum):
latest = "latest"
v1 = "v1"
# v2 = "v2"
Expand Down
8 changes: 3 additions & 5 deletions cli/decompose/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import re
from enum import Enum
from typing import Literal, TypedDict

from typing_extensions import NotRequired
from enum import StrEnum
from typing import Literal, NotRequired, TypedDict

from mellea import MelleaSession
from mellea.backends import ModelOption
Expand Down Expand Up @@ -46,7 +44,7 @@ class DecompPipelineResult(TypedDict):
final_response: NotRequired[str]


class DecompBackend(str, Enum):
class DecompBackend(StrEnum):
ollama = "ollama"
openai = "openai"
rits = "rits"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import re
from collections.abc import Callable, Sequence
from typing import TypedDict, TypeVar, cast, final

from typing_extensions import Unpack
from typing import TypedDict, TypeVar, Unpack, cast, final

from mellea import MelleaSession
from mellea.backends import ModelOption
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import re
from collections.abc import Callable, Sequence
from typing import TypedDict, TypeVar, cast, final

from typing_extensions import Unpack
from typing import TypedDict, TypeVar, Unpack, cast, final

from mellea import MelleaSession
from mellea.backends import ModelOption
Expand Down
1 change: 0 additions & 1 deletion docs/examples/agents/react/react_from_scratch/react.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def call_tool(self, tool: ReactTool, kwargs_json: str):

def tool_name_schema(self):
names = self.tool_names()
# Python 3.10 compatible: use Enum instead of Literal[*names] (requires 3.11+)
ToolEnum = Enum("ToolEnum", {name: name for name in names})
return pydantic.create_model("ToolSelectionSchema", tool=(ToolEnum, ...))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def call_tool(self, tool: ReactTool, kwargs_json: str):

def tool_name_schema(self):
names = self.tool_names()
# Python 3.10 compatible: use Enum instead of Literal[*names] (requires 3.11+)
ToolEnum = Enum("ToolEnum", {name: name for name in names})
return pydantic.create_model("ToolSelectionSchema", tool=(ToolEnum, ...))

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/bedrock/bedrock_litellm_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SKIP REASON: Requires an AWS bearer token for Bedrock.
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# requires-python = ">=3.11"
# dependencies = [
# "mellea[litellm]",
# "boto3" # including so that this example works before the next release.
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/bedrock/bedrock_openai_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SKIP REASON: Requires an AWS bearer token for Bedrock.
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# requires-python = ">=3.11"
# dependencies = [
# "mellea[openai]"
# ]
Expand Down
1 change: 0 additions & 1 deletion mellea/backends/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,6 @@ def validate_tool_arguments(
if len(unique_types) == 1:
param_type = unique_types[0]
else:
# Use modern union syntax (Python 3.10+)
from functools import reduce
from operator import or_

Expand Down
3 changes: 1 addition & 2 deletions mellea/formatters/granite/base/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
"""Common shared types."""

# Standard
from typing import Annotated, Literal, TypeAlias
from typing import Annotated, Any, Literal, TypeAlias

import pydantic

# Third Party
from pydantic import Field, StringConstraints
from typing_extensions import Any


class NoDefaultsMixin:
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ authors = [
]
description = "mellea is a library for writing generative programs"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
Expand Down Expand Up @@ -166,7 +166,7 @@ docs = [
# -----------------------------

[tool.ruff]
target-version = "py310"
target-version = "py311"
respect-gitignore = true

[tool.ruff.format]
Expand Down Expand Up @@ -199,7 +199,6 @@ ignore = [
"F811", # redefinition of the same function
"PL", # Pylint
"RUF012", # Mutable Class Attributes
"PD901", # Generic variable name 'df' for DataFrames (deprecated rule, but needed while PD is enabled)
"C901", # Complexity warnings
]

Expand Down Expand Up @@ -232,7 +231,7 @@ split-on-trailing-comma = false
install_types = true
non_interactive = true
disable_error_code = ["empty-body", "import-untyped"]
python_version = "3.10"
python_version = "3.11"

[[tool.mypy.overrides]]
# Keep import-not-found suppressed for optional dependencies
Expand Down
Loading