Skip to content

Commit

Permalink
dev: Add missing pre-commit executable warning to the venv installer (#…
Browse files Browse the repository at this point in the history
…204)

Running the pre-commit hooks locally eliminates the need to rebase onto
changes that the pre-commit-ci bot commits. This makes the PR process
smoother for contributors. But in case someone can't install or build
the pre-commit binary, this warning is not fatal to the venv installer.

Co-authored-by: Thomas Duvernay <td75013@hotmail.fr>
  • Loading branch information
adigitoleo and Patol75 authored Jul 31, 2024
1 parent a47ab70 commit 912583c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/venv_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ if [ $# -eq 0 ]; then # first install
warn "Python 3.10+ is required"; exit 1; }
$PYTHON_BINARY -m venv .venv-"${PWD##*/}"
upgrade
2>/dev/null 1>&2 command -v pre-commit || {
warn "Skipping installation of pre-commit hooks, which requires the pre-commit command.";
warn "To install them later, run `pre-commit install` in the local PyDRex clone."
}
2>/dev/null 1>&2 command -v pre-commit && pre-commit install
echo "/.venv-${PWD##*/}" >>.git/info/exclude
echo "/requirements.txt" >>.git/info/exclude
Expand Down

0 comments on commit 912583c

Please sign in to comment.