Taskipy
Taskipy is a task runner for Python projects that streamlines development workflows by defining and executing automation tasks. It uses a `pyproject.toml` file for configuration, offering an `npm run-script`-inspired interface for common operations like linting, testing, and building. The current version is 1.14.1, with a consistent release cadence addressing bug fixes and minor features.
Warnings
- breaking The `psutil` dependency version constraint was updated in Taskipy 1.14.1 to allow versions greater than 6. Older Taskipy versions (prior to 1.14.1) might have had tighter constraints (e.g., `<7`), potentially leading to conflicts if `psutil` was updated independently to version 7 or higher.
- gotcha Command-line arguments passed to a task are *not* automatically propagated to `pre_` and `post_` hooks. These hooks run without the arguments meant for the main task.
- gotcha By default, tasks run from the current working directory where `task` is invoked, not necessarily from the project root where `pyproject.toml` resides. This can lead to unexpected behavior if tasks depend on relative paths.
- gotcha Defining multi-line commands directly within `pyproject.toml` can be awkward due to TOML's syntax favoring single-line string values.
- gotcha Taskipy itself needs to be installed first. It doesn't solve the initial 'bootstrapping problem' of how to run the very first setup command if `make` or `just` are being replaced.
Install
-
pip install taskipy -
poetry add --dev taskipy -
conda install -c conda-forge taskipy
Imports
- main
from taskipy.cli import main
- TaskRunner
from taskipy.task_runner import TaskRunner
Quickstart
# pyproject.toml
[tool.taskipy.tasks]
hello = "echo Hello, Taskipy!"
greet = { cmd = "python -c 'import os; print(f\"Hello, {os.environ.get(\"USER\", \"World\")}\")'", help = "Greets the current user" }
# In your terminal, from project root:
# task -l
# task hello
# task greet