Skip to main content

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

Release files for par-run 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for par-run 0.5.0
File Size Uploaded
par_run-0.5.0.tar.gz 25.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for par-run 0.5.0
File Interpreter ABI Platform
par_run-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.1 kB

Release files / par_run-0.5.0.tar.gz

Download URL par_run-0.5.0.tar.gz
Size 25.2 kB
Tags Source
SHA-256 checksum
How to use checksums
39a05c66fb470883c05c3e229e72ab26d0750015f2978c553031bf61cb2ee08f
BLAKE2b-256 checksum
How to use checksums
b2ca1d07a8a2f331270a0264e3eb8a2d09c25944f6a0435df17e01536017498c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.2

Release files / par_run-0.5.0-py3-none-any.whl

Download URL par_run-0.5.0-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8187d15df074142fc47fadf1a959a1deefdc007055c62f41194f26c67bc3db40
BLAKE2b-256 checksum
How to use checksums
2b27a01292605cf61d471f650b8a64677504e0920b550b1103b0f9e14c12a604
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release 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