resume / tasks /installs.py
Médéric Hurier (Fmind)
refactoring
13a7d69
raw
history blame
824 Bytes
"""Install tasks for the project."""
# %% IMPORTS
from invoke import task
from invoke.context import Context
# %% TASKS
@task
def venv(ctx: Context) -> None:
"""Create a virtual environment."""
ctx.run("python3 -m venv .venv/")
ctx.run(".venv/bin/pip install uv")
@task
def lock(ctx: Context) -> None:
"""Lock the main project dependencies."""
ctx.run("uv pip compile requirements-main.txt -o requirements.txt")
@task
def main(ctx: Context) -> None:
"""Install the main dependencies."""
ctx.run("uv pip install -r requirements.txt")
@task
def dev(ctx: Context) -> None:
"""Install the development dependencies."""
ctx.run("uv pip install -r requirements-dev.txt")
@task(pre=[venv, lock, main, dev], default=True)
def all(_: Context) -> None:
"""Run all install tasks."""