~javiljoen/yatte

A simple task runner
Improve CLI help and man page
Add/improve docstrings and type annotations
Set up infrastructure for generating docs

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~javiljoen/yatte
read/write
git@git.sr.ht:~javiljoen/yatte

You can also use your local clone with git send-email.

#yatte

A simple task runner

#Quickstart

Install the package:

pip install git+https://git.sr.ht/~javiljoen/yatte#egg=yatte

Create a file named tasks.py containing some functions decorated with @task:

from yatte import task
from yatte.utils import run

@task('greet')
def hello():
    "Greet the world"
    print("Hello, world!")

@task('list-files')
def list_files(directory):
    "List the files in the directory"
    run(f"ls {directory}")

Then call yatte by itself to list the tasks:

yatte
greet                   Greet the world
list-files directory    List the files in the directory

And yatte {task} to execute the given task:

yatte list-files .
$ ls .
pyproject.toml README.md tasks.py

See yatte --help for more details.

To get tab-completion of tasks for the Fish shell, copy scripts/completions/yatte.fish from the project repo to ~/.config/fish/completions/.

#Development

Install the package in development mode, from the root of the source directory:

pip install flit
flit install -s

Project-related tasks defined in tasks.py can now be run via yatte itself:

yatte
yatte fmt  # etc.

To add a pre-commit hook to check the code when committing, write the following to .git/hook/pre-commit and chmod +x it:

#!/bin/sh -e
yatte check

Note: The wiki task has the following non-Python dependencies: