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.2.tar.gz (74.0 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.2-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: camas-0.1.2.tar.gz
  • Upload date:
  • Size: 74.0 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.2.tar.gz
Algorithm Hash digest
SHA256 c8f549d55645f88d991ffb00633361a311b9e93da9a03c69069ee1900d456ed5
MD5 520af4be6d322472623a619a62f8e193
BLAKE2b-256 f06cc25cce111c796cdf711d878db75a32991ceaf53732d9d23a1c651b1672d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for camas-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: camas-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 21.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 58e48eb94dcc7570ef0b72f1bd4d3df5e6a402953832958691dfcc66c63cbca1
MD5 2ed652de912ccd94d48c51633a20e167
BLAKE2b-256 5e3509e53735d2c0f5d745672f0837c1ff22fb7dce6ffe8509804affc15a3c54

See more details on using hashes here.

Provenance

The following attestation bundles were made for camas-0.1.2-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