Simple task manager for a Python project.
Use your favorite virtualenv and python package manager. For instance, using pip:
pip install pyleiter
Make sure your project has a 'pyproject.toml' file and add a section like the one below:
[tool.pyleiter.commands]
format = { command = "ruff format src", help = "Applies ruff format to project"}
lint = { command = "ruff check src", help = "Runs project formatter and linter" }
Where each line corresponds to a command you want to register for your program.
After that, you can use pyleiter with the registered commands:
pyleiter format
Add this to your favorite shell (only tested in bash) configuration file. For instance, in ~/.bashrc:
_pyleiter_completions()
{
OPTIONS=$(pyleiter 2>&1 >/dev/null | grep -Po '{.*}' | tr -d '[{}]' | tr ',' ' ')
SUGGESTIONS=$(compgen -W "$OPTIONS" "${COMP_WORDS[1]}")
if [[ "$SUGGESTIONS" != "${COMP_WORDS[1]}" ]]; then
COMPREPLY=($(compgen -W "$OPTIONS" "${COMP_WORDS[1]}"))
fi
}
complete -F _pyleiter_completions pyleiter
Simply because every project requires simple maintenance scripts, and it is often done without a standardized way for Python projects.
By using a tool that leverages pyproject.toml
, we can keep the configuration centralized.