diff --git a/README.md b/README.md index b27a201..a42af87 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # skilldiff -[](https://github.com/shunvel/skilldiff/actions/workflows/ci.yml) -[](https://pypi.org/project/skilldiff/) -[](https://pypi.org/project/skilldiff/) +[](https://github.com/shunvel/skilldiff/actions/workflows/ci.yml?query=branch%3Amain) +[](https://pypi.org/project/skilldiff/) +[](https://pypi.org/project/skilldiff/) [](LICENSE) Adding a tool, rewriting a skill, or swapping a system prompt is cheap. Knowing whether the agent got *better* is not. Offline evals score a final answer. They miss the trajectory: extra tool hops, silent regressions, and “it still printed the right string” failures. diff --git a/pyproject.toml b/pyproject.toml index 8b52668..40f8e0e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,6 +57,7 @@ packages = ["skilldiff"] testpaths = ["tests"] asyncio_mode = "auto" addopts = "-q" +pythonpath = ["."] [tool.ruff] line-length = 120 @@ -69,4 +70,9 @@ select = ["E", "F", "I", "W"] python_version = "3.10" packages = ["skilldiff"] ignore_missing_imports = true -warn_unused_ignores = true +warn_unused_ignores = false + +[[tool.mypy.overrides]] +module = ["google.*", "google.genai.*"] +ignore_missing_imports = true +ignore_errors = true diff --git a/skilldiff/tools_schema.py b/skilldiff/tools_schema.py index dca4441..40e638c 100644 --- a/skilldiff/tools_schema.py +++ b/skilldiff/tools_schema.py @@ -53,6 +53,7 @@ def load_tools_from_script(script_path: Path) -> dict[str, Callable[..., Any]]: raise ImportError(f"Unable to load tool script: {script_path}") module = importlib.util.module_from_spec(spec) + sys.modules[module_name] = module parent_dir = str(script_path.parent.resolve()) if parent_dir not in sys.path: sys.path.insert(0, parent_dir) diff --git a/tests/test_http_utils.py b/tests/test_http_utils.py index 35d0c55..1ed850d 100644 --- a/tests/test_http_utils.py +++ b/tests/test_http_utils.py @@ -1,22 +1,26 @@ """Tests for example HTTP helpers.""" +import sys +from pathlib import Path from unittest.mock import MagicMock, patch -from examples.http_utils import fetch_url_text +from skilldiff.tools_schema import load_tools_from_script def test_fetch_url_text_uses_certifi_context() -> None: + tools = load_tools_from_script(Path("examples/http_utils.py")) + fetch_url_text = tools["fetch_url_text"] + module = sys.modules[fetch_url_text.__module__] + html = b"