Development Setup¶
Set up your local development environment for contributing to PitLane-AI.
Prerequisites¶
- Python 3.12, 3.13, or 3.14
- uv package manager
- Git
Installation¶
1. Install uv¶
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Verify installation
uv --version
2. Clone Repository¶
3. Install Dependencies¶
This installs both pitlane-agent and pitlane-web packages with development dependencies.
Project Structure¶
PitLane-AI/
├── pyproject.toml # Workspace configuration
├── uv.lock # Dependency lockfile
├── packages/
│ ├── pitlane-agent/ # Core agent library
│ │ ├── pyproject.toml
│ │ ├── src/pitlane_agent/
│ │ └── tests/
│ └── pitlane-web/ # Web interface
│ ├── pyproject.toml
│ ├── src/pitlane_web/
│ └── tests/
└── docs/ # Documentation (this site)
Running Tests¶
# Run all tests
uv run pytest
# Run specific package tests
uv run --directory packages/pitlane-agent pytest
uv run --directory packages/pitlane-web pytest
# Run with coverage
uv run pytest --cov=pitlane_agent --cov=pitlane_web
# Run integration tests only
uv run pytest -m integration
# Run unit tests only (exclude integration)
uv run pytest -m "not integration"
Code Quality¶
Linting and Formatting¶
# Check code style
uv run ruff check .
# Auto-fix issues
uv run ruff check --fix .
# Format code
uv run ruff format .
Type Checking¶
Running Locally¶
CLI¶
Web Interface¶
# Development mode with auto-reload
uv run --directory packages/pitlane-web uvicorn pitlane_web.app:app --reload
# Or using the CLI
uvx pitlane-web --env development
Visit http://localhost:8000
Environment Configuration¶
Set your Anthropic API key before running the project. Get a key at console.anthropic.com.
You can export it directly or create a .env file:
# Required: Anthropic API key for Claude
ANTHROPIC_API_KEY=sk-ant-...
# Tracing (optional)
PITLANE_TRACING_ENABLED=1
PITLANE_SPAN_PROCESSOR=simple
# Cache directory (optional)
PITLANE_CACHE_DIR=~/.pitlane/cache
Development Workflow¶
-
Create a branch
-
Make changes
-
Run tests
-
Format code
-
Commit changes
-
Push and create PR
Troubleshooting¶
Module Not Found¶
Problem: ModuleNotFoundError: No module named 'pitlane_agent'
Solution:
Test Failures¶
Problem: Tests fail with import errors
Solution: Ensure you're using uv run to execute tests:
Cache Issues¶
Problem: Stale test cache
Solution:
# Clear pytest cache
rm -rf .pytest_cache
rm -rf packages/*/.pytest_cache
# Clear Python cache
find . -type d -name __pycache__ -exec rm -r {} +
Next Steps¶
- Project Structure - Detailed codebase layout
- Contributing - Contribution guidelines
- Testing - Writing and running tests
- Code Quality - Code standards