Skip to main content

Rhiza Logo rhiza-tools

Synced with Rhiza

PyPI version License: MIT Coverage Downloads CodeFactor

Extra utilities and tools serving the mothership rhiza.

📖 New to Rhiza? Check out the Getting Started Guide for a beginner-friendly introduction!

This package provides additional commands for the Rhiza ecosystem, such as version bumping, release management, and documentation helpers. It can be used as a plugin for rhiza-cli or as a standalone tool.

Installation

As a Rhiza Plugin (Recommended)

You can install rhiza-tools alongside rhiza-cli using uvx or pip. This automatically registers the tools as subcommands under rhiza tools.

Using uvx (run without installation)

uvx "rhiza[tools]" tools --help

Using pip

pip install "rhiza[tools]"

Standalone Usage

You can also use rhiza-tools independently if you don't need the full rhiza CLI.

Using uvx

uvx rhiza-tools --help

Using pip

pip install rhiza-tools

Commands

bump

Bump the version of the project in pyproject.toml using semantic versioning. Supports interactive selection, explicit version targets, and prerelease types.

Usage:

# Interactive (prompts for bump type)
rhiza-tools bump

# Explicit bump type
rhiza-tools bump patch
rhiza-tools bump minor
rhiza-tools bump major

# Explicit version
rhiza-tools bump 2.0.0

# Prerelease types
rhiza-tools bump alpha
rhiza-tools bump beta
rhiza-tools bump rc

Arguments:

  • VERSION - The version to bump to. Can be an explicit version (e.g., 1.0.1), a bump type (patch, minor, major), a prerelease type (alpha, beta, rc, dev), or omitted for interactive selection.

Options:

  • --dry-run - Show what would change without actually modifying files.
  • --commit - Automatically commit the version change to git.
  • --push - Push changes to remote after commit (implies --commit).
  • --branch BRANCH - Branch to perform the bump on (switches back after).
  • --allow-dirty - Allow bumping even with uncommitted changes.
  • --verbose, -v - Show detailed output from bump-my-version.

release

Push a release tag to remote to trigger the automated release workflow. Optionally bumps the version before releasing.

Usage:

# Interactive (prompts for bump and push)
rhiza-tools release

# Dry-run preview
rhiza-tools release --dry-run

# Bump and release in one step
rhiza-tools release --bump MINOR --push

# Interactive bump selection with dry-run preview
rhiza-tools release --with-bump --push --dry-run

# Non-interactive (for CI/CD)
rhiza-tools release --bump PATCH --push --non-interactive

Options:

  • --bump TYPE - Bump type (MAJOR, MINOR, PATCH) to apply before release.
  • --with-bump - Interactively select bump type before release (works with --dry-run).
  • --push - Push changes to remote (default: prompt in interactive mode).
  • --dry-run - Show what would happen without making any changes.
  • --non-interactive, -y - Skip all confirmation prompts (for CI/CD).

rollback

Reverse a release and/or version bump. Deletes the release tag locally and on the remote, and optionally reverts the version-bump commit. Uses git revert (not git reset), so it is safe even after the changes have been pushed.

Usage:

# Interactive (choose from recent tags)
rhiza-tools rollback

# Preview a specific tag's rollback
rhiza-tools rollback v1.2.3 --dry-run

# Also revert the version-bump commit, no prompts (for CI/CD)
rhiza-tools rollback v1.2.3 --revert-bump --non-interactive

Options:

  • --revert-bump - Also revert the version-bump commit associated with the tag.
  • --dry-run - Show what would happen without making any changes.
  • --non-interactive, -y - Skip all confirmation prompts (for CI/CD).
  • --verbose - Enable verbose debug output.

update-readme

Update README.md with the current output from make help.

Usage:

# As plugin
rhiza tools update-readme

# Standalone
rhiza-tools update-readme

Options:

  • --dry-run - Print what would happen without actually changing files.

generate-coverage-badge

Generate a coverage badge JSON file from a pytest-cov coverage report. The badge color adjusts automatically based on the coverage percentage.

Usage:

# Default paths
rhiza-tools generate-coverage-badge

# Custom paths
rhiza-tools generate-coverage-badge \
    --coverage-json tests/coverage.json \
    --output assets/badge.json

Options:

  • --coverage-json PATH - Path to the coverage.json file (default: _tests/coverage.json).
  • --output PATH - Path to output badge JSON (default: _book/tests/coverage-badge.json).

version-matrix

Emit supported Python versions from pyproject.toml as a JSON array. Primarily used in GitHub Actions to compute the CI test matrix.

Usage:

# Default candidates
rhiza-tools version-matrix

# Custom pyproject path
rhiza-tools version-matrix --pyproject /path/to/pyproject.toml

# Custom candidate versions
rhiza-tools version-matrix --candidates "3.10,3.11,3.12"

Options:

  • --pyproject PATH - Path to pyproject.toml (default: pyproject.toml).
  • --candidates TEXT - Comma-separated list of candidate Python versions (default: 3.11,3.12,3.13,3.14).

analyze-benchmarks

Analyze pytest-benchmark results and generate an interactive HTML visualization. Prints a table of benchmark names, mean runtimes, and operations per second.

Usage:

# Default paths
rhiza-tools analyze-benchmarks

# Custom paths
rhiza-tools analyze-benchmarks \
    --benchmarks-json tests/benchmarks.json \
    --output-html reports/benchmarks.html

Options:

  • --benchmarks-json PATH - Path to benchmarks.json file (default: _benchmarks/benchmarks.json).
  • --output-html PATH - Path to save HTML visualization (default: _benchmarks/benchmarks.html).

pip-audit

Run pip-audit with a tiered vulnerability policy. Vulnerabilities in runtime dependencies fail the command; findings in build tooling (pip, setuptools, wheel, distribute) warn without failing. Any arguments after the command are forwarded verbatim to pip-audit.

Usage:

# Audit the current environment
rhiza-tools pip-audit

# Forward flags through to pip-audit
rhiza-tools pip-audit --ignore-vuln CVE-2024-1234

Options:

  • --verbose, -v - Show verbose debug output.
  • Any other arguments are forwarded to pip-audit.

suppression-audit

Scan the codebase for inline suppression comments (# noqa, # nosec, # type: ignore, # pragma: no cover, # noinspection) and print a per-file report, an ASCII histogram, and a suppression-density letter grade.

Usage:

# Report suppressions and grade
rhiza-tools suppression-audit

# Also fail on stale CVE-tagged # nosec comments
rhiza-tools suppression-audit --fail-stale-nosec-cve

Options:

  • --fail-stale-nosec-cve - Fail when # nosec comments reference CVEs that pip-audit no longer reports.
  • --verbose, -v - Show verbose debug output.
  • Any other arguments are forwarded to pip-audit (for the stale-CVE gate).

Development

Prerequisites

  • Python 3.11 or higher
  • uv package manager (recommended) or pip
  • Git

Setup Development Environment

# Clone the repository
git clone https://github.com/Jebel-Quant/rhiza-tools.git
cd rhiza-tools

# Install dependencies
make install

# Run tests
make test

Community

License

This project is licensed under the MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rhiza_tools-0.8.1.tar.gz (370.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rhiza_tools-0.8.1-py3-none-any.whl (69.5 kB view details)

Uploaded Python 3

File details

Details for the file rhiza_tools-0.8.1.tar.gz.

File metadata

  • Download URL: rhiza_tools-0.8.1.tar.gz
  • Upload date:
  • Size: 370.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for rhiza_tools-0.8.1.tar.gz
Algorithm Hash digest
SHA256 87aaee26328bd01cbf3638cb02c27e88248a36d259763632b27a98e4126d4366
MD5 30123fb8d9e988ffd6944160999c74b9
BLAKE2b-256 d8a73a1b632e1726f4e4da8c4573d458a8001cf0cb76d384ed187c8f77ff3d85

See more details on using hashes here.

Provenance

The following attestation bundles were made for rhiza_tools-0.8.1.tar.gz:

Publisher: rhiza_release.yml on Jebel-Quant/rhiza-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rhiza_tools-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: rhiza_tools-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 69.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for rhiza_tools-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a7400a9f15e4d217d2bc1ef65b5606ec225f3a35be131a42833585cd905db164
MD5 37b56ebe5e4987601e77f2e8b2ddf73e
BLAKE2b-256 2778d01ba110bb563bdd601714bd6609c72fd012a46998b165f0075efd13e6bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for rhiza_tools-0.8.1-py3-none-any.whl:

Publisher: rhiza_release.yml on Jebel-Quant/rhiza-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.8.1 This release

2 files

0.7.3

2 files

0.7.0

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.6

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.4

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page