Skip to main content

Parallel command runner

Project description

par-run

License: MIT PyPI version Python Versions

Ever needed to run groups of long-ish running commands in parallel groups? Then this is for you. par-run gives both a CLI and web interface to running groups of commands in parallel.

Getting Started

pip install par-run
par-run run

This expects a file call toml file, by default the pyproject.toml or you can override with the --file option

[tool.par-run]
desc = "par-run from pyproject.toml"

[[tool.par-run.groups]]
name = "Formatting"
desc = "Code formatting commands."
timeout = 5
retries = 3 

  [[tool.par-run.groups.commands]]
  name = "ruff_fmt"
  exec = "ruff format src py_tests"
  # Define an empty extras using standard table notation, or simply omit it if it's always empty

  [[tool.par-run.groups.commands]]
  name = "ruff_fix"
  exec = "ruff check --fix src py_tests"
  # Define an empty extras using standard table notation, or simply omit it if it's always empty


[[tool.par-run.groups]]
name = "Quality"
desc = "Code Quality Tools. No code mutation"
timeout = 5
retries = 3

  [[tool.par-run.groups.commands]]
  name = "ruff_lint"
  exec = "ruff check src py_tests"
  # extras omitted as it's empty

  [[tool.par-run.groups.commands]]
  name = "mypy"
  exec = "mypy src"
  setenv = {NODE_ENV = "production", ENABLE_LOGS = "true"}

  [[tool.par-run.groups.commands]]
  name = "pytest"
  exec = "pytest py_tests"
  setenv = {NODE_ENV = "production", ENABLE_LOGS = "true"}


[[tool.par-run.groups]]
name = "ENV"
desc = "Code Quality Tools. No code mutation"
timeout = 5
retries = 3

  [[tool.par-run.groups.commands]]
  name = "full_env"
  exec = "env"
  setenv = {MY_VAR = "production", ENABLE_LOGS = "true"}

  [[tool.par-run.groups.commands]]
  name = "my_var"
  exec = "echo \"MY_VAR=$MY_VAR\", \"ENABLE_LOGS=$ENABLE_LOGS\""
  setenv = {MY_VAR = "production", ENABLE_LOGS = "true"}

The tool will execute each group in parallel collating the the output until each command has completed before writing to the console. If you do not want to wait then it's possible to get the output as it's produced with the --style recv param.

There is also a web component included, in order to us ensure to install the optional web component

pip install par-run[web]
par-run web --help

This will add a new sub command with options to start/stop/restart the web service and see the commands updating to the web server on 8081

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

par_run-0.2.1.tar.gz (71.3 kB view details)

Uploaded Source

Built Distribution

par_run-0.2.1-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file par_run-0.2.1.tar.gz.

File metadata

  • Download URL: par_run-0.2.1.tar.gz
  • Upload date:
  • Size: 71.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.2

File hashes

Hashes for par_run-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b8000f6f5cb4b1de35a953796ffcfa592373179d3823e68cf41922023e20e472
MD5 2aa9a4e971085a634442d24f9f8ded96
BLAKE2b-256 83d7e76292d35afbad6c296f479fa14c3f4e8ff93dcb70c369fbfd91ae0fceaf

See more details on using hashes here.

File details

Details for the file par_run-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: par_run-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.2

File hashes

Hashes for par_run-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 65051354196a015fce72fbc932cf11e9b80327ffddc68d4cbc1a49d7a46f0285
MD5 489fbb155ca894f3346b47a0d2afffb4
BLAKE2b-256 3c9b04a83af0c0ef8a3900fe8d52183b98fac3d5260bd7611260bdbae926394c

See more details on using hashes here.

Supported by

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