π± 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
- Template synchronization
π― Quick Start
1. Automated Injection (Recommended)
This creates .github/template.yml and syncs templates automatically.
2. Manual Integration
# Clone Rhiza
git clone https://github.com/jebel-quant/rhiza.git /tmp/rhiza
# Copy sync mechanism
cp /tmp/rhiza/.github/template.yml .github/
cp /tmp/rhiza/.rhiza/scripts/sync.sh .rhiza/scripts/
# Sync templates
./.rhiza/scripts/sync.sh
π Template Synchronization
Templates stay up-to-date with Rhiza's latest improvements:
Configuration: .github/template.yml
repository: Jebel-Quant/rhiza
ref: v0.7.1
include: |
.github/workflows/*.yml
.pre-commit-config.yaml
ruff.toml
pytest.ini
exclude: |
.rhiza/scripts/customisations/*
π Automated Sync Workflow
The sync.yml workflow keeps your project current:
- π Runs weekly (configurable)
- π Fetches latest templates from Rhiza
- π Applies only included files
- π― Respects exclude patterns
- π Creates pull request with changes
- π€ Fully automated
Manual trigger: GitHub Actions β "Sync Templates" β "Run workflow"
π οΈ Makefile: Your Command Center
make install # Setup project with uv
make test # Run pytest test suite
make fmt # Run pre-commit hooks
make docs # Generate API documentation
make book # Build companion book
make presentation # Generate slides from PRESENTATION.md
make marimo # Launch Marimo notebook server
make bump # Interactive version bump
make release # Tag and release
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 book/marimo/ with inline dependency management.
π Release Workflow
One-Step Publish (Recommended)
Two-Step Process
# 1. Bump version
make bump
# β Interactive prompts for patch/minor/major
# β Updates pyproject.toml
# β Commits and pushes changes
# 2. Create release
make release
# β Creates git tag
# β Pushes tag to GitHub
# β Triggers release workflow
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
Build Extras
Create .rhiza/scripts/customisations/build-extras.sh:
#!/bin/bash
set -euo pipefail
# Install system dependencies
sudo apt-get update
sudo apt-get install -y graphviz
# Your custom setup here
Runs during: make install, make test, make book, make docs
π¨ Documentation Customization
API Documentation (pdoc)
Companion Book (minibook)
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 docs
π 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!
- pdoc β API documentation
- minibook β Companion book
π‘ Getting Started Today
Three Simple Steps
- Try it:
uvx rhiza .in your project - Review: Check the generated
.github/template.yml - Sync: Run
./.rhiza/scripts/sync.sh
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
uvx rhiza . # Auto-inject Rhiza
# Development
make install # Install dependencies
make test # Run tests
make fmt # Format & lint
# Documentation
make docs # API documentation
make book # Companion book
make presentation # Generate slides
# Release
make bump # Bump version
make release # Create release
# Notebooks
make marimo # Interactive notebooks
Ready to Root Your Project?
Get Started: github.com/jebel-quant/rhiza