Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions polaris
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,39 @@
set -e

dir=${0%/*}
repair=false
for arg in "$@"; do
if [ "$arg" == "--repair" ]; then
repair=true
shift
break
fi
done


if [ ! -d "${dir}"/polaris-venv ] || [ "$repair" == true ]; then
if [ ! -d ${dir}/polaris-venv ]; then
echo "Performing first-time setup for the Python client..."
python3 -m venv "${dir}"/polaris-venv
else
echo "Repair dependencies for the Python client..."
fi

if [ ! -d "${dir}"/polaris-venv ]; then
echo "Performing first-time setup for the Python client..."
rm -f "${dir}"/poetry.lock
python3 -m venv "${dir}"/polaris-venv
. "${dir}"/polaris-venv/bin/activate
pip install -r regtests/requirements.txt
pip install --upgrade pip
pip install --upgrade -r regtests/requirements.txt

cp "${dir}"/client/python/pyproject.toml "${dir}"
pushd "$dir" && poetry install ; popd

deactivate
echo "First time setup complete."

if [ ! -d ${dir}/polaris-venv ]; then
echo "First time setup complete."
else
echo "Dependencies repaired."
fi
fi

cd "$dir"
Expand Down