Skip to content

Commit de86942

Browse files
authored
- Replace pip3 with uv pip in pipinstall and pipuninstall, using uv venv to create the plugin venv and --python to target it directly without requiring shell activation. (#2902)
- Set UV_CACHE_DIR to /gems/uv/ so the runtime uv cache persists on the gems volume across container restarts.
1 parent 2ea6e22 commit de86942

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

openc3/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ RUN mkdir /gems && chown openc3:openc3 /gems \
5858

5959
ENV HOME=/openc3
6060
ENV XDG_CACHE_HOME=/tmp/.cache
61+
ENV UV_CACHE_DIR=/gems/uv/
6162
USER ${USER_ID}:${GROUP_ID}

openc3/bin/pipinstall

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#!/bin/sh
2-
python3 -m venv $PYTHONUSERBASE
3-
source $PYTHONUSERBASE/bin/activate
4-
echo "pip3 install $@"
5-
pip3 install "$@"
2+
uv venv "$PYTHONUSERBASE"
3+
echo "uv pip install $@"
4+
uv pip install --python "$PYTHONUSERBASE" "$@"
65
if [ $? -eq 0 ]; then
76
echo "Command succeeded"
87
else
98
echo "Command failed - retrying with --no-index"
10-
pip3 install --no-index "$@"
11-
if [ $? -eq 0 ]; then
12-
echo "ERROR: pip3 install failed"
9+
uv pip install --python "$PYTHONUSERBASE" --no-index "$@"
10+
if [ $? -ne 0 ]; then
11+
echo "ERROR: uv pip install failed"
1312
fi
1413
fi

openc3/bin/pipuninstall

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#!/bin/sh
2-
python3 -m venv $PYTHONUSERBASE
3-
source $PYTHONUSERBASE/bin/activate
4-
echo "pip3 uninstall $@"
5-
pip3 uninstall "$@"
2+
echo "uv pip uninstall $@"
3+
uv pip uninstall --python "$PYTHONUSERBASE" "$@"
64
if [ $? -eq 0 ]; then
75
echo "Command succeeded"
86
else
9-
echo "ERROR: pip3 uninstall failed"
7+
echo "ERROR: uv pip uninstall failed"
108
fi

0 commit comments

Comments
 (0)