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
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup uv
uses: astral-sh/setup-uv@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install dependencies
run: uv pip install --system -e ".[dev]"

- name: Install pre-commit
run: uv pip install --system pre-commit

- name: Run pre-commit
run: pre-commit run --all-files

test:
runs-on: ubuntu-latest
env:
CI: 1

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup uv
uses: astral-sh/setup-uv@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install dependencies
run: uv pip install --system -e ".[dev]"

- name: Run unit tests
run: uv run pytest tests/unit/ -v

- name: Run integration tests
run: uv run pytest tests/integration/ -v
26 changes: 17 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,26 @@ repos:
- id: no-commit-to-branch
args: [--branch, main]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
- repo: local
hooks:
- id: ruff
name: ruff
entry: uv run ruff check
args: [--fix, --exit-non-zero-on-fix]
language: system
types: [python]
require_serial: true

- id: ruff-format
name: ruff-format
entry: uv run ruff format
language: system
types: [python]
require_serial: true

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies:
- pytest
- types-requests
files: ^(src/|servers/|tests/)
name: mypy
entry: uv run mypy
language: system
types: [python]
files: ^(src/|tests/)
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ cd wags
uv venv
source .venv/bin/activate

# Install the package in development mode
# Install with dev dependencies (for testing and linting)
uv pip install -e ".[dev]"

# Optional: Install with evaluation dependencies for running benchmarks
uv pip install -e ".[dev,evals]"
```

### Verify Installation
Expand Down Expand Up @@ -190,6 +193,13 @@ WAGS includes evaluation support for the Berkeley Function Call Leaderboard (BFC

### Setup

First, install the evaluation dependencies:

```bash
# Install evaluation dependencies (BFCL, fast-agent, etc.)
uv pip install -e ".[dev,evals]"
```

If you cloned the repository without submodules, initialize them:

```bash
Expand Down
7 changes: 2 additions & 5 deletions docs/snippets/quickstart/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ async def create_issue(
repo: str,
# Allow user to review and edit these fields
# before actually invoking the tool
title: Annotated[str, RequiresElicitation(
"Title")],
body: Annotated[str, RequiresElicitation(
"Body"
)]
title: Annotated[str, RequiresElicitation("Title")],
body: Annotated[str, RequiresElicitation("Body")],
):
pass
1 change: 1 addition & 0 deletions docs/snippets/quickstart/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@

if __name__ == "__main__":
import asyncio

asyncio.run(mcp.run_stdio_async())
12 changes: 10 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ requires-python = ">=3.13.5"

dependencies = [
"mcp @ git+https://github.com/chughtapan/python-sdk.git@wags-dev",
"fast-agent-mcp @ git+https://github.com/chughtapan/fast-agent.git@wags-dev", # TODO: also move into evals section
"fast-agent-mcp @ git+https://github.com/chughtapan/fast-agent.git@wags-dev",
"fastmcp @ git+https://github.com/chughtapan/fastmcp.git@wags-dev",
"cyclopts>=2.0.0",
"rich>=13.0.0",
"jinja2>=3.0.0",
"mpmath>=1.3.0", # TODO: Remove (only used for BFCL evals)
]

[project.scripts]
Expand All @@ -30,6 +29,9 @@ dev = [
"pytest-asyncio>=0.21",
"ruff",
"mypy",
]

evals = [
"bfcl-eval",
]

Expand All @@ -54,6 +56,12 @@ select = [
]
ignore = ["PERF203", "PLC0415", "PLR0402"]

[tool.ruff.lint.per-file-ignores]
# Handler methods have many required parameters matching API signatures
"servers/*/handlers.py" = ["PLR0913"]
# CLI commands naturally have many parameters (one per flag/option)
"src/wags/cli/main.py" = ["PLR0913"]

[tool.ruff.lint.pylint]
allow-magic-value-types = ["bytes", "float", "int", "str"]

Expand Down
4 changes: 2 additions & 2 deletions servers/github/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

from pathlib import Path

from handlers import GithubHandlers

from wags import create_proxy, load_config
from wags.middleware import ElicitationMiddleware, RootsMiddleware

from handlers import GithubHandlers

# Load config and create proxy server
config = load_config(Path(__file__).parent / "config.json")
mcp = create_proxy(config, "github-proxy")
Expand Down
107 changes: 0 additions & 107 deletions servers/github/test_non_file_roots.py

This file was deleted.

Loading