Skip to content

Commit 0f72893

Browse files
authored
Merge branch 'main' into release-please--branches--main--components--stackone-ai
2 parents fa9281c + c6d62a2 commit 0f72893

File tree

9 files changed

+686
-143
lines changed

9 files changed

+686
-143
lines changed

.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

.github/workflows/nix-flake.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2828

2929
- name: Install Nix
30-
uses: cachix/install-nix-action@0b0e072294b088b73964f1d72dfdac0951439dbd # v31.8.4
30+
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
3131
with:
3232
github_access_token: ${{ github.token }}
3333

flake.nix

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,6 @@
120120
uv sync --all-extras
121121
fi
122122
123-
# Install Node.js dependencies for MCP mock server (used in tests)
124-
if [ -f vendor/stackone-ai-node/package.json ]; then
125-
if [ ! -f vendor/stackone-ai-node/node_modules/.pnpm/lock.yaml ] || \
126-
[ vendor/stackone-ai-node/pnpm-lock.yaml -nt vendor/stackone-ai-node/node_modules/.pnpm/lock.yaml ]; then
127-
echo "📦 Installing MCP mock server dependencies..."
128-
(cd vendor/stackone-ai-node && pnpm install --frozen-lockfile)
129-
fi
130-
fi
131-
132123
# Install git hooks
133124
${config.pre-commit.installationScript}
134125
'';

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.1.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,

tests/conftest.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import annotations
44

55
import os
6-
import shutil
76
import socket
87
import subprocess
98
import time
@@ -61,30 +60,16 @@ def test_mcp_integration(mcp_mock_server):
6160
if not vendor_dir.exists():
6261
pytest.skip("stackone-ai-node submodule not found. Run 'git submodule update --init'")
6362

64-
# Check for bun runtime
65-
bun_path = shutil.which("bun")
66-
if not bun_path:
67-
pytest.skip("bun not found. Install via Nix flake.")
68-
63+
# find port
6964
port = _find_free_port()
7065
base_url = f"http://localhost:{port}"
7166

72-
# Install dependencies if needed
73-
node_modules = vendor_dir / "node_modules"
74-
if not node_modules.exists():
75-
subprocess.run(
76-
[bun_path, "install"],
77-
cwd=vendor_dir,
78-
check=True,
79-
capture_output=True,
80-
)
81-
8267
# Start the server from project root
8368
env = os.environ.copy()
8469
env["PORT"] = str(port)
8570

8671
process = subprocess.Popen(
87-
[bun_path, "run", str(serve_script)],
72+
[str(serve_script)],
8873
cwd=project_root,
8974
env=env,
9075
stdout=subprocess.PIPE,

tests/mocks/serve.ts

100644100755
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
#!/usr/bin/env -S bun run
12
/**
23
* Standalone HTTP server for MCP mock testing.
34
* Imports createMcpApp from stackone-ai-node vendor submodule.
45
*
56
* Usage:
7+
* ./tests/mocks/serve.ts [port]
8+
* # or
69
* bun run tests/mocks/serve.ts [port]
710
*/
811
import { Hono } from "hono";

0 commit comments

Comments
 (0)