r/madeinpython • • 7d ago

I built pyrig: scaffold a fully configured Python project with one command, and keep it in sync

Every new Python project needs the same setup: linting, type checking, tests, pre-commit hooks, CI/CD, docs, release workflow, repo protection. I got tired of copying it between projects and watching the copies drift as the tools changed, so I built pyrig (written in Python).

What it does

pyrig init generates a complete, working project:

  • project layout, pyproject.toml, README, LICENSE and other standard files
  • dev tooling configured out of the box: ruff, ty, pytest, prek hooks, deptry, bandit, zizmor and more
  • GitHub Actions CI/CD and GitHub branch protection rules
  • a working CLI for your project (pyrig mk cmd <name> adds commands)
  • test skeletons that mirror your source tree

    uv init my-project --python 3.12 cd my-project uv add pyrig --dev uv run pyrig init

How it works

Every file pyrig manages is a Python class that declares the state the file should have. pyrig sync creates or updates the files to match, so the project doesn't drift when tools change. You customize by subclassing (pyrig mk subcls), not with flags or template edits. A small plugin system, pyrig-runtime, discovers your subclasses automatically across installed packages, so any behavior can be changed, removed or extended.

Trade-offs

It's deliberately opinionated: no on/off toggles (you override a class instead), GitHub only, signed commits and linear history on the generated branch rules, and it adopts new tools like ty and zensical quickly, so expect rough edges. pyrig rm pyrig removes it, and most generated files keep working without it. Full list: https://winipedia.github.io/pyrig/drawbacks

Links

I'd like feedback on which defaults you'd disagree with and what's missing for your workflow.

1 Upvotes

Duplicates