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 .gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ useDefault = true

[allowlist]
description = "Global allowlist"
paths = ['''uv\.lock$''', '''venv/''', '''\.venv/''', '''\.ruff_cache/''']
paths = ['''uv\.lock$''', '''\.venv/''', '''\.ruff_cache/''']
2 changes: 0 additions & 2 deletions .release-please-config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"release-type": "python",
"changelog-path": "CHANGELOG.md",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"draft": false,
"prerelease": false,
"include-v-in-tag": true,
Expand Down
7 changes: 7 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,13 @@ tool = StackOneTool(


# 3.0
import json

import httpx

from stackone_ai import ExecuteConfig, StackOneTool, ToolParameters


class GetEmployee(StackOneTool):
def __init__(self) -> None:
super().__init__(
Expand Down
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ dependencies = [
"mcp>=1.30.0,<2.0.0",
]

[project.urls]
Repository = "https://github.com/StackOneHQ/stackone-ai-python"
Changelog = "https://github.com/StackOneHQ/stackone-ai-python/blob/main/CHANGELOG.md"
Issues = "https://github.com/StackOneHQ/stackone-ai-python/issues"

[build-system]
requires = ["hatchling>=1.27"]
build-backend = "hatchling.build"
Expand Down Expand Up @@ -51,6 +56,7 @@ examples = [
dev = [
"hypothesis>=6.141.1",
"langchain-core>=0.3.36",
"pydantic-ai-slim>=1.83.0",
"pytest>=8.3.4",
"pytest-asyncio>=0.25.3",
"pytest-cov>=6.0.0",
Expand All @@ -63,9 +69,6 @@ testpaths = ["tests"]
asyncio_mode = "strict"
asyncio_default_fixture_loop_scope = "function"

[tool.ruff.lint.per-file-ignores]
"examples/**.py" = ["E501", "F841", "E402"]

[tool.ruff]
line-length = 110
target-version = "py311"
Expand All @@ -86,10 +89,7 @@ select = [
[tool.coverage.run]
source = ["stackone_ai"]
branch = true
omit = ["stackone_ai/__init__.py", "**/py.typed"]

[tool.coverage.report]
exclude_lines = ["pragma: no cover"]
omit = ["stackone_ai/__init__.py"]

[tool.coverage.json]
output = "coverage/coverage.json"
Expand Down
4 changes: 2 additions & 2 deletions scripts/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# ./scripts/validate.sh # all sections
# ./scripts/validate.sh examples # one of: examples | conformance | sdk | pydantic | adk
#
# Sibling repo locations can be overridden:
# CONFORMANCE=/path/to/sdk-conformance ADK=/path/to/stackone-adk-plugin ./scripts/validate.sh
# Sibling repo locations default to ../sdk-conformance and ../adk-26-ci, and can be overridden:
# CONFORMANCE=/path/to/sdk-conformance ADK=/path/to/adk-checkout ./scripts/validate.sh
#
# Everything here runs against the sdk-conformance mock API on 127.0.0.1 with a
# dummy key. Nothing touches the live StackOne API, so results are deterministic
Expand Down
5 changes: 4 additions & 1 deletion stackone_ai/toolset.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def fetch_tools(
account_ids: list[str] | None = None,
providers: list[str] | None = None,
actions: list[str] | None = None,
mode: Any = _UNSET,
mode: ToolMode | None = _UNSET, # ty: ignore[invalid-parameter-default]
) -> Tools:
"""Fetch tools with optional filtering by account IDs, providers, and actions

Expand All @@ -325,6 +325,9 @@ def fetch_tools(
needed. No matching account means no tools.
actions: Optional list of action patterns with glob support
(e.g., ['*_list_employees', 'hibob_create_employees'])
mode: ``tool_mode`` for this call only. ``None`` lists one tool per action,
even on a toolset built with ``tool_mode="search_execute"``. Defaults to the
toolset's ``tool_mode``.

Returns:
Collection of tools matching the filter criteria
Expand Down
2 changes: 0 additions & 2 deletions tests/test_fetch_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ def test_langchain(self, monkeypatch, served, expected):

@pytest.mark.parametrize(("served", "expected"), _SERVED_REQUIRED_CASES)
def test_pydantic_ai(self, monkeypatch, served, expected):
pytest.importorskip("pydantic_ai")
schema = self._tool(monkeypatch, served).to_pydantic_ai_tool().function_schema.json_schema
assert schema.get("required") == expected
if expected is None:
Expand Down Expand Up @@ -2049,7 +2048,6 @@ def test_langchain_does_not_forward_unsupplied_optionals_as_null(self, monkeypat
assert seen["args"] == {"path_id": "x"}

def test_pydantic_ai_raises_model_retry(self, monkeypatch):
pytest.importorskip("pydantic_ai")
from pydantic_ai.exceptions import ModelRetry

from stackone_ai.tools import StackOneMcpTool
Expand Down
17 changes: 7 additions & 10 deletions tests/test_integrations_pydantic_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,20 @@
from unittest.mock import MagicMock, patch

import pytest

pytest.importorskip("pydantic_ai", reason="pydantic-ai not installed")

from pydantic_ai import Agent # noqa: E402
from pydantic_ai.messages import ( # noqa: E402
from pydantic_ai import Agent
from pydantic_ai.messages import (
ModelMessage,
ModelResponse,
TextPart,
ToolCallPart,
ToolReturnPart,
)
from pydantic_ai.models.function import AgentInfo, FunctionModel # noqa: E402
from pydantic_ai.tools import Tool # noqa: E402
from pydantic_ai.models.function import AgentInfo, FunctionModel
from pydantic_ai.tools import Tool

from stackone_ai import StackOneToolSet # noqa: E402
from stackone_ai.tools import StackOneTool, Tools # noqa: E402
from stackone_ai.types import ExecuteConfig, ToolParameters # noqa: E402
from stackone_ai import StackOneToolSet
from stackone_ai.tools import StackOneTool, Tools
from stackone_ai.types import ExecuteConfig, ToolParameters


@pytest.fixture
Expand Down
2 changes: 2 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading