from invoke import task


@task
def update_deps(c):
    """https://hynek.me/til/pip-tools-and-pyproject-toml/"""
    pass


@task
def sync_env(c):
    """Synchronize dependencies."""
    c.run("pip-sync dev_requirements.txt requirements.txt")


@task
def install_pre_commit(c):
    """Installs pre-commit hooks into your environment."""
    c.run("pre-commit install --install-hooks")


@task
def build(c):
    """Builds wheel and source distributions of project."""
    pass


@task
def serve_dev(c):
    """Runs the FastAPI webservice"""
    c.run("uvicorn local_whisper.webservice:app --reload")
