Installation¶
This guide sets up a working development environment for building with Tryx.
Prerequisites¶
| Tool | Version | Purpose |
|---|---|---|
| Python | 3.8+ | Runtime |
| Rust | stable | Native extension compilation |
| uv | latest | Package management |
| OpenSSL | 1.1+ | TLS for WebSocket connections |
Install Rust¶
Install uv¶
Quick Setup¶
# Clone the repository
git clone https://github.com/krypton-byte/tryx.git
cd tryx
# Install all dependencies
uv sync --group dev
# Build the Rust extension into your environment
uv run maturin develop
Verify installation
If this printsTryx loaded successfully, you're ready to go.
Build Options¶
Development Build (fast compilation)¶
This installs the extension module in editable mode. Re-run after Rust source changes.
Release Build (optimized binary)¶
The wheel is output to target/wheels/.
With Specific Features¶
# Verbose build for debugging
uv run maturin develop -v
# Release with debug symbols
uv run maturin develop --release --cargo-extra-args="--profile dev"
Project Layout¶
tryx/
├── Cargo.toml # Rust dependencies and build config
├── pyproject.toml # Python dependencies and tool config
├── src/ # Rust source code
│ ├── lib.rs # Module entry point
│ ├── clients/ # Client implementations
│ ├── events/ # Event dispatcher
│ └── types.rs # Shared data types
├── python/tryx/ # Python package
│ ├── __init__.py # Re-exports
│ ├── *.pyi # Type stubs for IDE support
│ └── waproto/ # Protobuf definitions
├── tests/ # Test suite
└── examples/ # Usage examples
Common Issues¶
Rust compiler not found¶
Build fails with linker errors¶
Install MSVC Build Tools.
ImportError for extension module¶
Make sure you're using the same Python environment where maturin develop was run:
Protobuf version mismatch¶
Tryx uses protobuf 5.28+ for code generation. If you see version warnings:
Optional Tools¶
| Tool | Install | Purpose |
|---|---|---|
| mypy | uv add mypy |
Static type checking |
| pyright | uv add pyright |
Type checking alternative |
| ruff | uv add ruff |
Linting and formatting |
| pytest | uv add pytest |
Test runner |
# Type check
uv run mypy your_project/
# Lint
uv run ruff check .
# Format
uv run ruff format .
# Test
uv run pytest
Next Step¶
→ Quick Start — build your first bot in 5 minutes