Winipedia/pyrig: A Python toolkit to rig up your project that standardizes and automates project setup, configuration and development.


pyrig
uv
Container
prek
MkDocs

ruff
ty
security: bandit
pytest
codecov
rumdl

PyPI
Python
License

CI
CD

Documentation


A Python toolkit to rig up your project that standardizes and automates project setup, configuration and development.


pyrig generates and maintains a complete, production-ready Python project from a
single command. It creates all the files you need—source structure, tests,
CI/CD, documentation, configs—and keeps them in sync as your project evolves.

Run once, stay current: pyrig is idempotent. Rerun it anytime to update
configs, add missing files, or sync with the latest best practices.

# Initialize project with uv and pyrig
uv init
uv add pyrig
uv run pyrig init

That’s it. You now have a complete project with:

  • Source code structure with CLI entry point
  • Test framework with 90% coverage enforcement
  • GitHub Actions (CI/CD, releases, docs deployment)
  • Prek hooks (linting, formatting, type checking)
  • MkDocs documentation site
  • Container support (Podman/Docker)

See the
Getting Started Guide
for detailed setup instructions.

pyrig’s core is a declarative config file system. Each config file
(pyproject.toml, prek.toml, GitHub workflows, etc.) is a Python
class that:

  • Generates the file with working sensible defaults
  • Validates existing files against expected structure
  • Merges missing values without removing your customizations (overrides are
    possible, read the docs for details)

Create custom configs by subclassing—pyrig discovers them automatically.

Multi-Package Inheritance

Build on pyrig to create multiproject-wide standards. Your base package defines
configs, fixtures, and CLI commands that all dependent projects inherit:

pyrig → company-base → auth-service
                     → payment-service
                     → notification-service

Override any config by subclassing with the same class name. Leaf classes win.

Everything is discovered automatically across the dependency chain:

  • CLI commands from .dev.cli.subcommands
  • Config files from .dev.configs
  • Test fixtures from .dev.tests.fixtures
  • Builders from .dev.builders
  • Tools from .dev.management

No registration required. Just define and it works.

After pyrig init, your project includes:

Category Files
Source Package structure, main.py CLI, py.typed marker
Tests Mirror structure, conftest.py, test skeletons
CI/CD Health check, build, release, deploy workflows
Docs MkDocs config, index, API reference
GitHub Issue templates, PR template, branch protection
Community CODE_OF_CONDUCT, CONTRIBUTING, SECURITY
Config pyproject.toml, .gitignore, prek.toml, Containerfile

uv run pyrig init         # Complete project initialization
uv run pyrig mkroot       # Create/update all config files
uv run pyrig mktests      # Generate test skeletons
uv run pyrig mkinits      # Create __init__.py files
uv run pyrig build        # Build artifacts (PyInstaller, etc.)
uv run pyrig protect-repo # Configure repository protection
uv run my-project --help  # Your project's CLI

pyrig enforces modern Python best practices:

  • Python 3.12+ with full type hints
  • All ruff rules enabled (with sensible exceptions)
  • Strict type checking with ty
  • 90% test coverage minimum
  • Linear git history with branch protection



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *