Skip to main content

Development & testing

A Makefile at the repo root wraps the day-to-day commands so you don’t have to remember the uv incantations.
make help            # list every target with descriptions
make install-dev     # uv sync --extra dev (first time only)
make test            # full SDK test suite, quiet
make check           # lint + fmt-check + test (matches CI)
make test-one T=tests/security/test_bundle.py   # single file

Targets at a glance

TargetWhat it runs
SDK dev loop
test / test-verbose / test-failed / test-onepytest tests/ with various flags
lint / lint-fixruff check (with --fix for autofixes)
fmt / fmt-checkruff format
checklint + fmt-check + test — pre-push gate
Policy demo
policy-buildCompile the example policy.yaml to a bundle
policy-test-wasmSmoke a WASM-engine decision
demo-overrideBuild a deny bundle + chat with HEXGATE_LOCAL_POLICY
Platform demo (multi-terminal — see make demo-platform)
platform-api / platform-api-install / platform-api-testFastAPI control plane in platform/api/
dashboard / dashboard-installVite + React app in platform/dashboard/
servehexgate serve — bridge this SDK to the platform
demo-platformPrint the 3-terminal recipe
Misc
build / cleanPackage + tidy

Using an existing virtualenv

By default uv manages its own .venv (created by make install-dev). If you keep your dev environment elsewhere — e.g. a micromamba env — point uv at it once and make picks it up:
export UV_PROJECT_ENVIRONMENT=/Users/<you>/micromamba/envs/<your-env>
uv sync --extra dev           # one-time: install dev deps into that env
make test                     # now runs against the micromamba env
Drop the export into your shell rc (or a direnv .envrc) and forget about it. Without --extra dev, pytest-asyncio is missing and you’ll see “async functions are not natively supported” across every async test — same trap on a fresh env.

Platform-side test suite

The platform-side test suite is separate and lives at platform/api/tests/:
cd platform/api && uv run pytest tests/