TaskyPi can turn your pyproject.toml into a Makefile too
This blogpost originally appeared as a YouTube video here
I recently discovered TaskiPy, a tool that lets you define task automation directly in your pyproject.toml file—essentially turning it into a Makefile alternative.
I came across this while working on a PR for the Altair library, where their developer documentation instructs contributors to run commands using TaskiPy.
Basic Setup
TaskiPy works by adding a [tool.taskipy.tasks] section to your pyproject.toml:
[tool.taskipy.tasks]
lint = "ruff check ."
format = "black ."
print = "echo hello"
You can then list available tasks with:
task -l
And run them with:
task print
# Output: hello
Chaining Commands
You can chain multiple tasks together:
[tool.taskipy.tasks]
lint = "ruff check ."
format = "black ."
rough_check = "task lint && task format"
Variables
TaskiPy supports variables:
[tool.taskipy.variables]
name = "Vincent"
[tool.taskipy.tasks]
print = "echo Hello {name}"
task print
# Output: Hello Vincent
Pre and Post Hooks
You can define setup and teardown steps using pre_ and post_ prefixes:
[tool.taskipy.tasks]
print = "echo Hello Vincent"
pre_print = "echo something beforehand"
post_print = "echo something afterwards"
When you run task print, all three commands execute in order.
Note: If you pass extra arguments to a task (e.g., task print "echo some more"), the pre and post hooks are skipped, and your arguments are appended to the main command.
Use TaskiPy?
The main advantage is consolidation—you don't need separate Makefiles or Just files. This is particularly useful because:
makeisn't always available on Windowsjustisn't commonly pre-installed on Linux systems- If someone is working on your Python project, they already have access to
pyproject.toml
There are two notable downsides:
- Multi-line commands can be awkward since TOML configuration leans toward one-liners
- Bootstrap problem: While you eliminate the need for
makeorjustto be pre-installed, you now require TaskiPy (or uv) to be installed first. TaskiPy cannot install itself, so it's not entirely a free lunch.