Skip to content

Commit bea92fb

Browse files
authored
trying an approach to ensure correct version of python used in lambda build (#271)
1 parent 758d9aa commit bea92fb

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

scripts/dependencies.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,19 @@
22

33
set -euo pipefail
44

5+
# Use the python from PATH (set by setup-python)
6+
PYTHON_BIN="${PYTHON_BIN:-python}"
7+
8+
59
if ! [ -x "$(command -v poetry)" ]; then
610
if ! [ -x "$(command -v pipx)" ]; then
7-
python -m pip install --user pipx --isolated
8-
python -m pipx ensurepath
11+
$PYTHON_BIN -m pip install --user pipx --isolated
12+
$PYTHON_BIN -m pipx ensurepath
913
fi
10-
pipx install poetry
14+
pipx install poetry --python $PYTHON_BIN
1115
fi
16+
17+
# Ensure poetry uses the correct python environment
18+
poetry env use $PYTHON_BIN
19+
1220

0 commit comments

Comments
 (0)