Skip to content

Latest commit

 

History

History
81 lines (51 loc) · 1.89 KB

File metadata and controls

81 lines (51 loc) · 1.89 KB

Tower CLI and SDK — Development Guide

Development setup and tooling for contributors.

For contribution guidelines (reporting bugs, suggesting features, code of conduct), see CONTRIBUTING.md.

Runtime architecture (Rust + Python)

The tower-runtime crate is the Rust runtime used to execute Tower apps. The main crate defines the interfaces; the local package implements running Tower packages locally.

See the tower-package crate for how Tower packages are built and run.

Development setup

Make sure you have uv installed.

To interactively test your changes, start a REPL with the project installed in development mode:

uv run python
>>> import tower
>>> table = tower.tables("my_table").load()

Running the CLI locally

uv run tower --help

Running tests

Copy pytest.ini.template to pytest.ini:

cp pytest.ini.template pytest.ini

Set the required environment variables (e.g. TOWER_INFERENCE_ROUTER_API_KEY) to your own or test values.

Then install dependencies and run the tests:

uv sync --locked --all-extras --dev
uv run pytest tests

Development flow

Typical development loop:

  1. Make changes
  2. Run uv run pytest tests
  3. Run uv run tower --help or other CLI commands to verify behavior

OpenAPI SDK

If you need to get the latest OpenAPI SDK, you can run:

./scripts/generate-python-api-client.sh

Code Formatting

We use Black for Python code formatting. The pre-commit hooks will automatically format your code, but you can also run it manually:

# Format all Python files in the project
uv run --group dev black .

# Check formatting without making changes
uv run --group dev black --check .

Code of conduct

Contributions must follow our Code of Conduct.