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.
pip install taskipyVerified import paths — ran on the pinned version, not inferred.
Define tasks in your `pyproject.toml` under the `[tool.taskipy.tasks]` section. Each task is a key-value pair where the key is the task name and the value is the shell command. Tasks can also be defined as tables to include a `help` message or specify a `cwd`. Run tasks using the `task <task_name>` command in your terminal.
Upgrade Taskipy to 1.14.1 or newer (`pip install --upgrade taskipy`) to ensure compatibility with `psutil` versions >6. Confirm your `pyproject.toml` or `requirements.txt` allows a compatible `psutil` range.
If `pre_` or `post_` hooks require arguments, define them as separate, explicit tasks and call them with arguments directly, or use Taskipy's variable system if the arguments are static and can be templated.
Explicitly set the `cwd` (current working directory) for individual tasks or globally in `[tool.taskipy.settings]` to ensure tasks always run relative to a specific path, typically the project root. Example: `[tool.taskipy.tasks.mytask] cmd = "my_command", cwd = "."` or `[tool.taskipy.settings] cwd = "."`.
For complex, multi-line commands, consider moving them into a separate shell script (e.g., `.taskipy/scripts/my_complex_script.sh`) and then call that script from your `pyproject.toml` task: `complex_task = "./.taskipy/scripts/my_complex_script.sh"`.
Communicate the installation steps for Taskipy clearly (e.g., `pip install taskipy` or `poetry add --dev taskipy`) as part of your project's setup guide before instructing users to run `task` commands.
Run `pip install taskipy` to install the package. If using a virtual environment, ensure it is activated.
Correct the task name in your command or add the missing task definition to your `pyproject.toml` file under `[tool.taskipy.tasks]`.
Ensure the `[tool.taskipy.tasks]` section in `pyproject.toml` is correctly structured as a TOML dictionary, with task names as keys and commands as string values.
Remove the unrecognized argument, or if it is intended for the task, place it after the task name (e.g., `taskipy my-task --arg-for-task`). Check `taskipy --help` for valid global options.
Install taskipy using pip, or activate the virtual environment where it's installed: `pip install taskipy` or `source .venv/bin/activate`