Skip to content

Commit

Permalink
ci(nox): Add pre-commit installation.
Browse files Browse the repository at this point in the history
  • Loading branch information
teald committed Dec 5, 2024
1 parent 9bbfc98 commit e939ead
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def devenv(session: nox.Session):
venv_path = create_venv(session)
venv_python = venv_path / "bin" / "python"
install_dependencies(session, target_python=venv_python)
session.notify("install_pre_commit_hooks")


@nox.session(venv_backend="none")
Expand Down Expand Up @@ -130,10 +131,20 @@ def devconda(session: nox.Session):

install_dependencies(session, target_python=python_path)

session.notify("install_pre_commit_hooks")


@nox.session(venv_backend="none")
def remove_devconda_environment(session: nox.Session):
"""Remove existing dragons_dev environment generated by devconda session."""
session.run(
"conda", "remove", "--name", "dragons_dev", "--all", "-y", external=True
)


@nox.session
def install_pre_commit_hooks(session: nox.Session):
"""Install pre-commit hooks; happens after devshell/devconda runs."""
session.install("pre-commit")

session.run("pre-commit", "install")

0 comments on commit e939ead

Please sign in to comment.