Parallel command runner
Project description
par-run
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file par_run-0.5.0.tar.gz.
File metadata
- Download URL: par_run-0.5.0.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39a05c66fb470883c05c3e229e72ab26d0750015f2978c553031bf61cb2ee08f
|
|
| MD5 |
63fef8a4ed41f6bc399b3c10edb0fd3c
|
|
| BLAKE2b-256 |
b2ca1d07a8a2f331270a0264e3eb8a2d09c25944f6a0435df17e01536017498c
|
File details
Details for the file par_run-0.5.0-py3-none-any.whl.
File metadata
- Download URL: par_run-0.5.0-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8187d15df074142fc47fadf1a959a1deefdc007055c62f41194f26c67bc3db40
|
|
| MD5 |
d03d2c3dd65e611ac5b070b600bb714d
|
|
| BLAKE2b-256 |
2b27a01292605cf61d471f650b8a64677504e0920b550b1103b0f9e14c12a604
|