This project uses modern Python tooling with uv and Docker Compose, with first-class NixOS support via devenv.nix and direnv.
-
Tool Invocation:
- Prefer using
make <target>oruv run <cmd>for executing tests, linting, formatting, and database operations. - Do NOT use
pipdirectly. Dependencies are managed viapyproject.tomlanduv.lock.
- Prefer using
-
Common Commands (
Makefileshortcuts):-
Run Test Suite:
make test(oruv run pytest -v tests/) -
Run Application:
make run(oruv run python -m src.main) -
Linting:
make lint(oruv run ruff check .) -
Lint & Fix:
make lint-fix(oruv run ruff check --fix .) -
Formatting:
make format(oruv run ruff format .) -
Full Check:
make check(runs lint, format-check, and tests) -
Sync Dependencies:
make sync(oruv run uv sync --all-extras) -
Sync Slash Commands:
make sync-commands(oruv run python -m src.cli sync-commands) -
Database Up:
make db-up(docker compose up -d postgres) -
Database Down:
make db-down(docker compose stop postgres) -
Database Initialization:
make db-init -
Database Migrations:
make db-migrate(oruv run alembic upgrade head) -
Database Check:
make db-check(oruv run alembic check) -
Database Revision:
make db-revision MSG="description" -
Database Clear/Wipe:
make db-clear -
Declarative Seeding (Non-destructive):
make seed(oruv run python scripts/seed.py --no-reset) -
Database Reset & Full Re-seed:
make db-reset(oruv run python scripts/seed.py) -
Database Shell:
make db-shell
-
-
Background Services:
- PostgreSQL 18 is managed via Docker Compose (
make db-up/docker compose up -d postgres). - Unit and integration tests run against an in-memory SQLite database (
sqlite+aiosqlite:///:memory:) and do not require PostgreSQL to be running.
- PostgreSQL 18 is managed via Docker Compose (
-
NixOS Support & Tool Availability:
- NixOS developers can use
direnv(use devenvin.envrc) ordevenv shellto automatically populate Python 3.13,uv,psql,docker, and required system libraries in their environment. - If any needed CLI utility or dependency is missing from the environment, use
nix-shell -p <package>(or enter anix-shell) to run or provide it on demand.
- NixOS developers can use
-
Deployment & App Container Rebuild:
- When finished making code changes/updates, rebuild and restart the application container by running
make docker-build(ordocker compose up -d --build app).
- When finished making code changes/updates, rebuild and restart the application container by running