Skip to content

Commit d17f9be

Browse files
Add CLI dependency update option (#1222)
1 parent 2c1933c commit d17f9be

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

polaris

+25-5
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,39 @@
2121
set -e
2222

2323
dir=${0%/*}
24+
repair=false
25+
for arg in "$@"; do
26+
if [ "$arg" == "--repair" ]; then
27+
repair=true
28+
shift
29+
break
30+
fi
31+
done
32+
33+
34+
if [ ! -d "${dir}"/polaris-venv ] || [ "$repair" == true ]; then
35+
if [ ! -d ${dir}/polaris-venv ]; then
36+
echo "Performing first-time setup for the Python client..."
37+
python3 -m venv "${dir}"/polaris-venv
38+
else
39+
echo "Repair dependencies for the Python client..."
40+
fi
2441

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

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

3550
deactivate
36-
echo "First time setup complete."
51+
52+
if [ ! -d ${dir}/polaris-venv ]; then
53+
echo "First time setup complete."
54+
else
55+
echo "Dependencies repaired."
56+
fi
3757
fi
3858

3959
cd "$dir"

0 commit comments

Comments
 (0)