Skip to main content

Generic parallel/sequential task runner

Project description

Camas

Generic parallel/sequential task runner with a live tree-style TUI.

CI

Install

uv add camas

or

pip install camas

Quick start

Camas takes a typed Python expression describing a tree of Task, Sequential, and Parallel nodes and runs it, streaming progress into a live tree in your terminal.

Run two checks in parallel:

python -m camas 'Parallel(tasks=(Task("ruff check ."), Task("mypy .")))'

A typical CI pipeline — format-check, then checks in parallel, then tests:

python -m camas 'Sequential(tasks=(
    Task("ruff format . --check"),
    Parallel(tasks=(Task("mypy ."), Task("pyright ."))),
    Task("pytest"),
))'

Run one task across a matrix of Python versions in parallel:

python -m camas 'Parallel(
    tasks=(Task("pytest --python {PY}"),),
    matrix={"PY": ("3.12", "3.13", "3.14")},
)'

Use --dry-run to print the task tree without executing it.

Library

The same building blocks are available as a library:

import asyncio
from camas import Parallel, Sequential, Task, run
from camas.effect.termtree import Termtree, TermtreeOptions

task = Sequential(tasks=(
    Task("ruff format . --check"),
    Parallel(tasks=(Task("mypy ."), Task("pyright ."))),
    Task("pytest"),
))

result = asyncio.run(run(task, effects=(Termtree(TermtreeOptions()),)))
raise SystemExit(result.returncode)

Task, Sequential, and Parallel are immutable NamedTuple values. A Sequential short-circuits on the first non-zero exit; a Parallel runs its children concurrently. Both accept an optional matrix mapping for variable expansion in task commands, names, and environments.

License

MIT

Project details


Download files

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

Source Distribution

camas-0.1.1.tar.gz (73.1 kB view details)

Uploaded Source

Built Distribution

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

camas-0.1.1-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file camas-0.1.1.tar.gz.

File metadata

  • Download URL: camas-0.1.1.tar.gz
  • Upload date:
  • Size: 73.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for camas-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4c38ff2f72a29d2af79bd6b0a8a1662d58015f57a9ba4d1bd8b307407e123d1a
MD5 fc528c0646e3356abd0e94a5dc1c683c
BLAKE2b-256 55065824f569f6d717ce510591327a272d14a4bf869d65b6a48af3e9a017ce99

See more details on using hashes here.

Provenance

The following attestation bundles were made for camas-0.1.1.tar.gz:

Publisher: ci.yaml on JPHutchins/camas

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

File details

Details for the file camas-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: camas-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for camas-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bce318f85b621b987a182383ed6232940d96dea4d8966a7205a60f8036b49a6b
MD5 1c48bb2149d0ab5a235081f95de393ad
BLAKE2b-256 0681155f9fa3f4dc19173af8b9cac562b2fc51cf0767e1182aec9ee7e0be8103

See more details on using hashes here.

Provenance

The following attestation bundles were made for camas-0.1.1-py3-none-any.whl:

Publisher: ci.yaml on JPHutchins/camas

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page