My personal task runner.
- Copy
taskand__tasklib__.pyto the root of your project - Create a
__task__.pysomewhere in your project likefoo/__task__.py.from __tasklib__ import TaskContext, TaskBuilder def _hello(ctx: TaskContext): ctx.log.info("Hello") def configure(builder: TaskBuilder): module_name = "foo" builder.add_task(module_name, "hello", _hello) builder.add_task(module_name, "world", lambda ctx: ctx.log.info("World"))
Bash/Git Bash
- Run
taskto see what's available$ ./task 2024-01-20 17:26:44,216 - task - INFO - Processing tasks usage: task [-h] [task ...] arguments: hello world options: -h, --help show this help message and exit -v, --verbose enabled debug logging - Run
taskwith several targets$ ./task hello world 2024-01-20 17:26:57,368 - task - INFO - Processing tasks 2024-01-20 17:26:57,374 - foo - INFO - Hello 2024-01-20 17:26:57,374 - foo - INFO - World