wip
This commit is contained in:
34
.remoteenv
Normal file
34
.remoteenv
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
POETRY='exit 99'
|
||||
|
||||
if type -P poetry >/dev/null; then
|
||||
POETRY='poetry'
|
||||
|
||||
else
|
||||
if ! type -P pip3 >/dev/null; then
|
||||
echo "Neither pip3 nor poetry is available on this host: $(hostname)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! test -d '.poetry_pypath/poetry'; then
|
||||
# NOTE: .poetry_pypath should be ignored during remote-exec [pull]
|
||||
echo "Poetry not found, downloading it to .poetry_pypath/ ..."
|
||||
pip3 install -t '.poetry_pypath' poetry || exit $?
|
||||
fi
|
||||
|
||||
export PYTHONPATH=".poetry_pypath:$PYTHONPATH"
|
||||
POETRY='python3 -m poetry'
|
||||
fi
|
||||
|
||||
|
||||
if ! test -f "poetry.toml" ; then
|
||||
$POETRY config --local virtualenvs.in-project true
|
||||
fi
|
||||
|
||||
if ! test -d ".venv" ; then
|
||||
$POETRY install || exit $?
|
||||
fi
|
||||
|
||||
alias poetry="$POETRY"
|
||||
exec $POETRY shell
|
||||
Reference in New Issue
Block a user