Registry / devops / taskipy

taskipy

JSON →
library1.14.1pypypi✓ verified 23d ago

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 taskipy
INSTALL
IMPORT
SIG · TASKIPY
T
taskipy
devopspythonv1.14.1
Install
2.0s avg
Import
148ms
Disk
19MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.14.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.0s · import 0.148s · 21MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

main
from taskipy.cli import main
Taskipy is primarily a CLI tool. This is the entry point for programmatic execution of the CLI.
TaskRunner
from taskipy.task_runner import TaskRunner
The core class for executing tasks programmatically, though direct use is less common for end-users than CLI interaction.

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.

# 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
task --version
Debug
Known issues
breakingThe `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.
fix
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.
affects: <1.14.1
gotchaCommand-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.
fix
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.
affects: All versions
gotchaBy 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.
fix
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 = "."`.
affects: All versions
gotchaDefining multi-line commands directly within `pyproject.toml` can be awkward due to TOML's syntax favoring single-line string values.
fix
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"`.
affects: All versions
gotchaTaskipy 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.
fix
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.
affects: All versions
Errors
Common errors & fixes
command not found: taskipy
The `taskipy` package is either not installed in the current environment, or its executable location is not in the system's PATH.
fix
Run `pip install taskipy` to install the package. If using a virtual environment, ensure it is activated.
taskipy: error: argument task: invalid choice: 'non-existent-task' (choose from 'lint', 'test')
The task name specified in the command does not match any of the tasks defined in the `[tool.taskipy.tasks]` section of your `pyproject.toml` file.
fix
Correct the task name in your command or add the missing task definition to your `pyproject.toml` file under `[tool.taskipy.tasks]`.
Invalid configuration in pyproject.toml: 'tasks' must be a dict.
The `tasks` key within `[tool.taskipy]` in your `pyproject.toml` is incorrectly formatted or contains a syntax error, preventing `taskipy` from parsing it as a dictionary.
fix
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.
taskipy: error: unrecognized arguments: --invalid-option
You are attempting to pass an argument directly to `taskipy` itself (before the task name) that it does not recognize as a valid global option.
fix
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.
taskipy: command not found
The taskipy executable is not found in your system's PATH, usually because it's not installed or the virtual environment where it's installed is not active.
fix
Install taskipy using pip, or activate the virtual environment where it's installed: `pip install taskipy` or `source .venv/bin/activate`
Upgrade
Version history
1.14.1latest on PyPI · released Nov 26, 2024
Audit
Dependencies
pythonrequiredRequired Python version.
psutilrequiredUsed for process management and system utilities; allows Taskipy to manage child processes reliably.
tomlioptionalRequired for parsing TOML files (pyproject.toml) on Python versions older than 3.11 (which includes `tomllib` in stdlib).
mslexoptionalWindows-specific dependency for shell command parsing.
coloramaoptionalUsed for colored terminal output, primarily on Windows systems.
Agent activity
12 hits · last 30 days
node
10
Resources