Skip to content

Python CLI

Workflow: python-cli.yml

Use this to validate a Python CLI with uv, Ruff, and pytest, including packages stored in subdirectories and uv workspaces. A pyproject.toml and the selected dependency group are required.

name: Python checks
on: [pull_request]
permissions:
contents: read
jobs:
quality:
uses: RuchirChawdhry/ci-workflows/.github/workflows/python-cli.yml@main
with:
python-version: '3.14.7'
cli-command: markbox

Replace @main with a reviewed SHA for production.

Input Default Description
python-version 3.14.7 Python to install
runs-on ubuntu-slim Runner label
project-path . Directory containing the project’s pyproject.toml
dev-group dev Additional uv dependency group to sync
test-command pytest -q Command run in the uv environment, or '' to skip
workspace-package empty Optional uv workspace member name to sync
cli-command empty Optional installed executable to invoke with --help

The shared python-checks composite action installs the project using uv sync --group dev by default, runs ruff check ., ruff format --check ., the configured test command within the uv environment, and optionally the CLI help command. All checks operate in project-path.

For broader interpreter discovery, see the Compatibility Explorer.

jobs:
checks:
uses: RuchirChawdhry/ci-workflows/.github/workflows/python-cli.yml@<PINNED_SHA>
with:
project-path: packages/widget
workspace-package: widget
dev-group: quality
test-command: pytest -q tests/unit

For independent nested projects, omit workspace-package. For a uv workspace, set it to the workspace member’s package name so dependency syncing targets that member rather than the workspace root. The group is added to uv’s configured defaults. Set test-command: '' to skip tests explicitly. The full Python CLI guide has usage details.