Spaces:
Sleeping
Sleeping
File size: 778 Bytes
beb32ed 13a7d69 beb32ed 13a7d69 beb32ed 13a7d69 beb32ed 13a7d69 beb32ed |
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 37 38 39 40 41 42 43 |
"""Clean tasks for the project."""
# %% IMPORTS
from invoke import task
from invoke.context import Context
# %% TASKS
@task
def install(ctx: Context) -> None:
"""Clean the install."""
ctx.run("rm -rf .venv/")
@task
def mypy(ctx: Context) -> None:
"""Clean the mypy cache."""
ctx.run("rm -rf .mypy_cache/")
@task
def ruff(ctx: Context) -> None:
"""Clean the ruff cache."""
ctx.run("rm -rf .ruff_cache/")
@task
def python(ctx: Context) -> None:
"""Clean python files and folders."""
ctx.run("find . -type d -name __pycache__ -delete")
@task(pre=[mypy, ruff, python], default=True)
def all(_: Context) -> None:
"""Run all clean tasks."""
@task(pre=[install, all])
def reset(_: Context) -> None:
"""Reset the project state."""
|