Mirror of https://github.com/roostorg/osprey
github.com/roostorg/osprey
1# Development Tools Overview
2
3## Ruff - Linting and Formatting
4
5**Purpose**: Replaces Black, isort, Flake8, and other tools
6
7**Configuration**: Located in `pyproject.toml` under `[tool.ruff]`
8
9**Key Rules Enabled**:
10
11- `E` - pycodestyle errors
12- `F` - pyflakes
13- `I` - isort (import sorting)
14- `B006` - flake8-bugbear (mutable default arguments)
15
16**Commands**:
17
18```bash
19# Check for issues
20uv run ruff check
21
22# Fix auto-fixable issues
23uv run ruff check --fix
24
25# Format code
26uv run ruff format
27
28# Check specific files
29uv run ruff check path/to/file.py
30```
31
32## MyPy - Type Checking
33
34**Purpose**: Static type checking for Python
35
36**Configuration**: Located in `pyproject.toml` under `[tool.mypy]`
37
38**Key Features**:
39
40- Pydantic plugin support
41- SQLAlchemy plugin support
42- Relaxed strict mode (matching legacy codebase)
43- Ignores protobuf generated files
44
45**Commands**:
46
47```bash
48# Type check entire project
49uv run mypy .
50
51# Type check specific files
52uv run mypy path/to/file.py
53
54# Type check entire module
55uv run mypy osprey_worker/
56
57# Check with verbose output
58uv run mypy --show-traceback path/to/file.py
59```
60
61## Pre-commit - Git Hooks
62
63**Purpose**: Automated quality checks before commits
64
65**Configuration**: Located in `.pre-commit-config.yaml`
66
67**Commands**:
68
69```bash
70# Run all hooks on staged files
71uv run pre-commit run
72
73# Run all hooks on all files
74uv run pre-commit run --all-files
75
76# Run specific hook
77uv run pre-commit run ruff
78
79# Update hook versions
80uv run pre-commit autoupgrade
81
82# Bypass hooks (emergency only)
83git commit --no-verify
84```
85
86## UV - Package Management
87
88**Purpose**: Fast Python package manager and environment management
89
90**Key Commands**:
91
92```bash
93# Install dependencies
94uv sync
95
96# Add new dependency
97uv add package-name
98
99# Add development dependency
100uv add --group dev package-name
101
102# Remove dependency
103uv remove package-name
104
105# Run command in environment
106uv run command-name
107
108# Update dependencies
109uv lock --upgrade
110```