Skip to content

Commit 3fa80b7

Browse files
authored
chore: feat: add Python 3.10 support [ENG-11910] (#108)
* feat: add Python 3.10 support - Update requires-python to >=3.10 - Add Python 3.10 classifier - Add Python 3.10 to CI test matrix * fix: Python 3.10 compatibility - Use timezone.utc instead of datetime.UTC (introduced in Python 3.11) - Update ruff target-version from py311 to py310 - Remove unused ty: ignore comments for unresolved-import - Add ty: ignore for deprecated langgraph.prebuilt.create_react_agent * ci: add Python 3.12 to test matrix
1 parent 234b48d commit 3fa80b7

5 files changed

Lines changed: 583 additions & 19 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
runs-on: ubuntu-latest
3838
strategy:
3939
matrix:
40-
python-version: ["3.11", "3.13"]
40+
python-version: ["3.10", "3.11", "3.12", "3.13"]
4141
steps:
4242
- name: Checkout repository
4343
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackone-ai"
33
version = "2.0.0"
44
description = "agents performing actions on your SaaS"
55
readme = "README.md"
6-
requires-python = ">=3.11"
6+
requires-python = ">=3.10"
77
authors = [
88
{ name = "StackOne", email = "support@stackone.com" }
99
]
@@ -12,6 +12,7 @@ classifiers = [
1212
"Intended Audience :: Developers",
1313
"License :: OSI Approved :: MIT License",
1414
"Programming Language :: Python :: 3",
15+
"Programming Language :: Python :: 3.10",
1516
"Programming Language :: Python :: 3.11",
1617
"Programming Language :: Python :: 3.12",
1718
"Programming Language :: Python :: 3.13",
@@ -77,7 +78,7 @@ markers = [
7778

7879
[tool.ruff]
7980
line-length = 110
80-
target-version = "py311"
81+
target-version = "py310"
8182

8283
[tool.ruff.lint]
8384
select = [

stackone_ai/integrations/langgraph.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
def _ensure_langgraph() -> None:
2525
try:
26-
from langgraph import prebuilt as _ # noqa: F401 # ty: ignore[unresolved-import]
26+
from langgraph import prebuilt as _ # noqa: F401
2727
except Exception as e: # pragma: no cover
2828
raise ImportError(
2929
"LangGraph is not installed. Install with `pip install langgraph` or "
@@ -45,7 +45,7 @@ def to_tool_node(tools: Tools | Sequence[BaseTool], **kwargs: Any) -> Any:
4545
for inclusion in a graph.
4646
"""
4747
_ensure_langgraph()
48-
from langgraph.prebuilt import ToolNode # ty: ignore[unresolved-import]
48+
from langgraph.prebuilt import ToolNode
4949

5050
langchain_tools = _to_langchain_tools(tools)
5151
return ToolNode(langchain_tools, **kwargs)
@@ -58,7 +58,7 @@ def to_tool_executor(tools: Tools | Sequence[BaseTool], **kwargs: Any) -> Any:
5858
This function now returns a ToolNode for compatibility.
5959
"""
6060
_ensure_langgraph()
61-
from langgraph.prebuilt import ToolNode # ty: ignore[unresolved-import]
61+
from langgraph.prebuilt import ToolNode
6262

6363
langchain_tools = _to_langchain_tools(tools)
6464
return ToolNode(langchain_tools, **kwargs)
@@ -81,6 +81,6 @@ def create_react_agent(llm: Any, tools: Tools | Sequence[BaseTool], **kwargs: An
8181
`Tools` collection from this SDK.
8282
"""
8383
_ensure_langgraph()
84-
from langgraph.prebuilt import create_react_agent as _create # ty: ignore[unresolved-import]
84+
from langgraph.prebuilt import create_react_agent as _create # ty: ignore[deprecated]
8585

86-
return _create(llm, _to_langchain_tools(tools), **kwargs)
86+
return _create(llm, _to_langchain_tools(tools), **kwargs) # ty: ignore[deprecated]

stackone_ai/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import json
55
import logging
66
from collections.abc import Sequence
7-
from datetime import UTC, datetime
7+
from datetime import datetime, timezone
88
from enum import Enum
99
from typing import Annotated, Any, ClassVar, TypeAlias, cast
1010
from urllib.parse import quote
@@ -196,7 +196,7 @@ def execute(
196196
StackOneAPIError: If the API request fails
197197
ValueError: If the arguments are invalid
198198
"""
199-
datetime.now(UTC)
199+
datetime.now(timezone.utc)
200200
feedback_options: JsonDict = {}
201201
result_payload: JsonDict | None = None
202202
response_status: int | None = None
@@ -266,7 +266,7 @@ def execute(
266266
status = "error"
267267
raise StackOneError(f"Request failed: {exc}") from exc
268268
finally:
269-
datetime.now(UTC)
269+
datetime.now(timezone.utc)
270270
metadata: JsonDict = {
271271
"http_method": self._execute_config.method,
272272
"url": url_used,

0 commit comments

Comments
 (0)