-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
tasks.py
36 lines (25 loc) · 748 Bytes
/
tasks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""Tasks of the project."""
# %% IMPORTS
from invoke import task
from invoke.context import Context
# %% TASKS
@task
def clean(ctx: Context) -> None:
"""Clean the project."""
ctx.run("rm -rf .venv/")
ctx.run("rm -rf .mypy_cache/")
ctx.run("rm -rf .pytest_cache/")
ctx.run("find . -type f -name '*.py[co]' -delete")
ctx.run(r"find . -type d -name __pycache__ -exec rm -r {} \+")
@task
def install(ctx: Context) -> None:
"""Install the project."""
ctx.run("uv sync --all-groups")
@task
def hooks(ctx: Context) -> None:
"""Setup the project hooks."""
ctx.run("uv run pre-commit install")
@task
def test(ctx: Context) -> None:
"""Run the project unit tests."""
ctx.run("uv run pytest tests/")