π± Rhiza¶
Reusable Configuration Templates for Modern Python Projects
αΏ₯Ξ―ΞΆΞ± (ree-ZAH) β Ancient Greek for "root"
π€ The Problem¶
Setting up a new Python project is time-consuming:
- βοΈ Configuring CI/CD pipelines
- π§ͺ Setting up testing frameworks
- π Creating linting and formatting rules
- π Configuring documentation generation
- π§ Establishing development workflows
- π³ Setting up dev containers
Result: Hours of configuration before writing actual code
π‘ The Solution: Rhiza¶
A curated collection of battle-tested templates that:
β Save time on project setup β Enforce best practices β Maintain consistency across projects β Stay up-to-date automatically β Support multiple Python versions (3.11-3.14)
β¨ Key Features¶
π Available Templates¶
π± Core Project Configuration¶
.gitignoreβ Python project defaults.editorconfigβ Consistent coding standardsruff.tomlβ Linting and formattingpytest.iniβ Testing frameworkMakefileβ Common development tasksCODE_OF_CONDUCT.md&CONTRIBUTING.md
π Available Templates (cont.)¶
π§ Developer Experience¶
.devcontainer/β VS Code dev containers.pre-commit-config.yamlβ Pre-commit hooksdocker/β Dockerfile templates
π CI/CD & Automation¶
.github/workflows/β GitHub Actions- Automated testing & releases
- Documentation generation
- Security scanning (CodeQL, Scorecard)
π― Quick Start¶
1. Install the plugin (once)¶
2. Adopt, in two pull requests¶
/rhiza:init # writes .rhiza/template.yml β the pointer. Merge it.
/rhiza:update # the first sync: the workflows, the Makefile, the rest
/rhiza:init syncs nothing, so its PR looks almost empty β that is correct.
π Template Synchronization¶
Templates stay up-to-date with Rhiza's latest improvements:
Configuration: .rhiza/template.yml¶
repository: "Jebel-Quant/rhiza"
ref: "v1.5.1"
profiles:
- github-project
exclude: |
docs/development/DOCKER.md
A profile expands to its bundles; exclude opts out of individual files.
π Staying Current¶
Syncing is a local command, not a scheduled job β nothing needs a write-scoped token on a timer:
- π€ Renovate opens a PR when the template's
refhas a newer release - π
/rhiza:updateapplies it: fetch the bundles, three-way merge, open the PR - π Only template-owned paths are staged β
.rhiza/template.lockis the list - π―
excludepatterns and local edits both survive - π
/rhiza:status --checkreports drift without changing anything
π οΈ Makefile: Your Command Center¶
make install # Setup project with uv
make test # Run pytest test suite
make fmt # Run pre-commit hooks
make book # Build the companion book
make book # Build companion book
make presentation # Generate slides from PRESENTATION.md
make marimo # Launch Marimo notebook server
Note: Releasing is driven by the rhiza-claude /release command, which bumps the version, regenerates the changelog, and creates the tag.
Tip: Run make help to see all available targets
π Marimo Integration¶
Marimo β Modern interactive Python notebooks
Features¶
- π Reactive execution
- π Pure Python (no JSON)
- π¦ Self-contained dependencies
- π¨ Built-in visualizations
- π» VS Code extension support
Notebooks stored in docs/notebooks/ with inline dependency management.
π Release Workflow¶
Release (via rhiza-claude /release)¶
/release
# β Derives the next version
# β Bumps pyproject.toml
# β Regenerates CHANGELOG.md
# β Creates the git tag locally
Pushing the tag triggers the release workflow. Releasing is not a make target.
Check Status¶
Release Automation¶
β Builds Python package β Creates GitHub release β Publishes to PyPI (if public) β Publishes devcontainer image (optional)
π³ Dev Container Features¶
What You Get¶
- π Python 3.14 runtime
- β‘ UV package manager
- π§ All project dependencies
- π§ͺ Pre-commit hooks
- π Marimo integration
- π SSH agent forwarding
- π Port 8080 forwarding
Usage¶
VS Code: Reopen in Container Codespaces: Create codespace on GitHub
π§ Customization¶
Your own targets, in local.mk¶
The Makefile is template-owned and -includes local.mk, which no sync
touches. An explicit rule beats its %: catch-all, so shadowing extends a task:
# local.mk β committed
install: $(UVX)
@sudo apt-get update && sudo apt-get install -y graphviz
@$(UVX) $(RHIZA_TASK) install
train-model: ## Train the ML model
@uv run python scripts/train.py
Settings go in pyproject.toml's [tool.rhiza-task] table.
π¨ Documentation Customization¶
The docs site (MkDocs + zensical)¶
Override anything from the base config in your own mkdocs.yml:
API pages come from mkdocstrings; extra packages go in the
mkdocs-extra-packages setting.
Presentations (Marp)¶
Edit PRESENTATION.md and run:
make presentation # Generate HTML
make presentation-pdf # Generate PDF
make presentation-serve # Interactive preview
βοΈ Configuration Variables¶
Control Python versions via repository variables:
PYTHON_MAX_VERSION¶
- Default:
'3.14' - Tests on 3.11, 3.12, 3.13, 3.14
- Set to
'3.13'to exclude 3.14
PYTHON_DEFAULT_VERSION¶
- Default:
'3.14' - Used in release, pre-commit, book workflows
- Set to
'3.12'for compatibility
Set in: Repository Settings β Secrets and variables β Actions β Variables
π Code Quality Tools¶
Pre-commit Hooks¶
- β YAML validation
- β TOML validation
- β Markdown formatting
- β Trailing whitespace
- β End-of-file fixes
- β GitHub workflow validation
Ruff¶
- Fast Python linter
- Replaces flake8, isort, pydocstyle
- Auto-fixing capabilities
- Extensive rule selection
π§ͺ Testing Philosophy¶
What Gets Tested¶
- π README code blocks
- π§ Shell scripts (bump, release)
- π― Makefile targets
- π Repository structure
- π Marimo notebooks
Test Command¶
Runs pytest with coverage reporting and HTML output.
π CI/CD Workflows¶
10 Automated Workflows¶
- CI β Test matrix across Python versions
- PRE-COMMIT β Validate code quality
- DEPTRY β Check dependency usage
- BOOK β Build documentation
- MARIMO β Validate notebooks
- DOCKER β Build and publish images
- DEVCONTAINER β Validate dev environment
- RELEASE β Automated releases
- SYNC β Template synchronization
- RHIZA β Self-injection test
π¦ Package Publishing¶
PyPI Publication¶
Automatic if configured as Trusted Publisher:
- Register package on PyPI
- Add GitHub Actions as trusted publisher
- Release workflow publishes automatically
Private Packages¶
Add to pyproject.toml:
π― Real-World Usage¶
Perfect For:¶
- π New Python projects
- π Standardizing existing projects
- π₯ Team templates
- π Educational projects
- π’ Corporate standards
Not Ideal For:¶
- β Non-Python projects
- β Projects requiring exotic configurations
- β One-off scripts
ποΈ Architecture Decisions¶
Why Makefile?¶
- β Universal (no language-specific tools)
- β Self-documenting
- β Easy to extend
- β Works everywhere
Why UV?¶
- β‘ 10-100x faster than pip
- π¦ Handles entire Python ecosystem
- π Lock files for reproducibility
- π― Single tool for everything
π€ Contributing¶
How to Contribute¶
- π΄ Fork the repository
- πΏ Create feature branch
- βοΈ Make your changes
- β
Run
make testandmake fmt - π€ Submit pull request
What to Contribute¶
- π New templates
- π Bug fixes
- π Documentation improvements
- π‘ Feature suggestions
π Project Stats¶
- π Python Versions: 3.11, 3.12, 3.13, 3.14
- π License: MIT
- π·οΈ Current Version: 0.3.0
- π§ Templates: 20+ configuration files
- π€ Workflows: 10 GitHub Actions
- β Badge:
π Useful Links¶
- π Repository: github.com/jebel-quant/rhiza
- π Issues: github.com/jebel-quant/rhiza/issues
- π Codespaces: Open in GitHub Codespaces
- π Documentation: Auto-generated with
make book
π Acknowledgments¶
Built With¶
- GitHub Actions β CI/CD automation
- UV β Fast Python package management
- Ruff β Fast Python linting
- Pytest β Testing framework
- Marimo β Interactive notebooks
- Marp β This presentation!
- MkDocs + zensical β The docs site
- mkdocstrings β API documentation
π‘ Getting Started Today¶
Three Simple Steps¶
- Install:
/plugin install rhiza@rhiza-claudein Claude Code - Point:
/rhiza:initwrites.rhiza/template.ymlβ review and merge - Sync:
/rhiza:updatebrings the template content in
Or Explore First¶
# Open in Codespaces
# β Click "Create codespace on main"
# Or clone locally
git clone https://github.com/jebel-quant/rhiza.git
cd rhiza
make install
make test
π Thank You!¶
Questions?¶
Rhiza β Your foundation for modern Python projects
From the Greek αΏ₯Ξ―ΞΆΞ± (root) β because every great project needs strong roots
π Quick Reference Card¶
# Setup (in Claude Code)
# /rhiza:init # become rhiza-managed
# /rhiza:update # sync the template content
# Development
make install # Install dependencies
make test # Run tests
make fmt # Format & lint
# Documentation
make book # Companion book
make book # Companion book
make presentation # Generate slides
# Release (driven by the rhiza-claude /release command)
make workflow-status # Show recent runs for the release workflow
# Notebooks
make marimo # Interactive notebooks
Ready to Root Your Project?¶
Get Started: github.com/jebel-quant/rhiza