Skip to content

🌱 Rhiza

Reusable Configuration Templates for Modern Python Projects

w:200

αΏ₯Ξ―ΞΆΞ± (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

### πŸš€ Automation - GitHub Actions workflows - Pre-commit hooks - Automated releases - Version bumping ### πŸ§ͺ Testing - pytest configuration - CI test matrix - Code coverage - Documentation tests
### πŸ“š Documentation - API docs with pdoc - Companion book with minibook - Presentation slides with Marp - Interactive notebooks ### πŸ”§ Developer Experience - Dev containers - VS Code integration - GitHub Codespaces ready - SSH agent forwarding

πŸ“ Available Templates

🌱 Core Project Configuration

  • .gitignore β€” Python project defaults
  • .editorconfig β€” Consistent coding standards
  • ruff.toml β€” Linting and formatting
  • pytest.ini β€” Testing framework
  • Makefile β€” Common development tasks
  • CODE_OF_CONDUCT.md & CONTRIBUTING.md

πŸ“ Available Templates (cont.)

πŸ”§ Developer Experience

  • .devcontainer/ β€” VS Code dev containers
  • .pre-commit-config.yaml β€” Pre-commit hooks
  • docker/ β€” Dockerfile templates

πŸš€ CI/CD & Automation

  • .github/workflows/ β€” GitHub Actions
  • Automated testing & releases
  • Documentation generation
  • Template synchronization

🎯 Quick Start

cd /path/to/your/project
uvx rhiza .

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

make marimo  # Start notebook server

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

make publish
# β†’ Bumps version + creates tag + pushes
# β†’ Triggers release workflow

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

make release-status
# β†’ Shows workflow run history
# β†’ Shows latest release details

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)

mkdir -p book/pdoc-templates
# Add custom Jinja2 templates

Companion Book (minibook)

mkdir -p book/minibook-templates
# Create custom.html.jinja2

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

make test

Runs pytest with coverage reporting and HTML output.


🌐 CI/CD Workflows

10 Automated Workflows

  1. CI β€” Test matrix across Python versions
  2. PRE-COMMIT β€” Validate code quality
  3. DEPTRY β€” Check dependency usage
  4. BOOK β€” Build documentation
  5. MARIMO β€” Validate notebooks
  6. DOCKER β€” Build and publish images
  7. DEVCONTAINER β€” Validate dev environment
  8. RELEASE β€” Automated releases
  9. SYNC β€” Template synchronization
  10. RHIZA β€” Self-injection test

πŸ“¦ Package Publishing

PyPI Publication

Automatic if configured as Trusted Publisher:

  1. Register package on PyPI
  2. Add GitHub Actions as trusted publisher
  3. Release workflow publishes automatically

Private Packages

Add to pyproject.toml:

classifiers = [
    "Private :: Do Not Upload",
]


🎯 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

  1. 🍴 Fork the repository
  2. 🌿 Create feature branch
  3. ✍️ Make your changes
  4. βœ… Run make test and make fmt
  5. πŸ“€ 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: Created with Rhiza


πŸ™ 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

  1. Try it: uvx rhiza . in your project
  2. Review: Check the generated .github/template.yml
  3. 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

w:300