Skip to content

Commit fe1d75c

Browse files
committed
Get the python version from the tea-env
1 parent 895c9da commit fe1d75c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

share/brewkit/python-venv.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,21 @@ cat <<EOF > ../bin/"$CMD_NAME"
3939
4040
export VIRTUAL_ENV="\$(cd "\$(dirname "\$0")"/.. && pwd)/venv"
4141
42+
TEA_PYTHON="\$(which python)"
43+
TEA_PYHOME="\$(dirname "\$TEA_PYTHON")"
44+
4245
cat <<EOSH > \$VIRTUAL_ENV/pyvenv.cfg
43-
home = \$TEA_PREFIX/python.org/v$PYTHON_VERSION_MAJ/bin
46+
home = \$TEA_PYHOME
4447
include-system-site-packages = false
45-
executable = \$TEA_PREFIX/python.org/v$PYTHON_VERSION_MAJ/bin/python
48+
executable = \$TEA_PYTHON
4649
EOSH
4750
48-
find "\$VIRTUAL_ENV"/bin -depth 1 -type f | xargs \
51+
find "\$VIRTUAL_ENV"/bin -depth 1 -type f | xargs \\
4952
sed -i.bak "1s|.*|#!\$VIRTUAL_ENV/bin/python|"
5053
5154
rm "\$VIRTUAL_ENV"/bin/*.bak
5255
53-
ln -sf "\$TEA_PREFIX"/python.org/v$PYTHON_VERSION_MAJ/bin/python "\$VIRTUAL_ENV"/bin/python
56+
ln -sf "\$TEA_PYTHON" "\$VIRTUAL_ENV"/bin/python
5457
5558
exec "\$VIRTUAL_ENV"/bin/$CMD_NAME "\$@"
5659

0 commit comments

Comments
 (0)