-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
import: add bin/setup / bin/clean for convenience
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
upfind () { | ||
if [ "$(realpath `dirname $1`)" == "/" ]; then | ||
echo "ERROR: no $(basename $1) found in any parent directory." | ||
exit 1 | ||
fi | ||
ls -d $1 2>/dev/null || upfind ../$1 | ||
} | ||
|
||
if [ "${DISABLE_PROJECT_VENV_AUTO_CREATION:-}" == "" ]; then | ||
if [ ! -x ./venv/bin/python ]; then | ||
if hash pyenv 2>/dev/null; then | ||
pyenv exec python -m venv venv | ||
else | ||
pythonVersion=$(cat $(upfind .python-version)) | ||
pythonExecutable=python$pythonVersion | ||
if ! hash $pythonExecutable 2>/dev/null; then | ||
echo "ERROR: missing pyenv or $pythonExecutable" | ||
exit 1 | ||
fi | ||
$pythonExecutable -m venv venv | ||
fi | ||
./venv/bin/pip install -U pip | ||
fi | ||
source ./venv/bin/activate | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
cd "$(dirname "$0")/.." | ||
. bin/_load-venv | ||
|
||
pip install -U pip | ||
pip install poetry | ||
poetry install |