Skip to content

Commit 123af60

Browse files
committed
build(python): switch to pipx for better virtual env isolation
1 parent c9ebf48 commit 123af60

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

json/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,20 @@ RUN apk -U upgrade \
2121
jq=1.8.0-r0 \
2222
npm=11.3.0-r0 \
2323
openssl=3.5.1-r0 \
24+
pipx=1.7.1-r0 \
2425
py3-pip=25.1.1-r0 \
2526
python3=3.12.11-r0 \
26-
&& if apk -u list | grep -q -e . ; then \
27-
apk -u list ; \
27+
&& if apk -u list | tee -a /dev/stderr | grep -q -e . ; then \
2828
exit 1 ; \
2929
fi \
3030
&& apk cache clean \
3131
&& rm -rf /var/cache/apk/*
3232

33-
RUN pip3 install --no-cache-dir --upgrade --break-system-packages \
33+
RUN pipx ensurepath --global \
34+
&& pipx install --global \
3435
csvkit==2.1.0 \
3536
json2yaml==1.2.0 \
36-
&& msg="$(pip3 list --outdated | grep -i -e '^json2yaml ' || true)" \
37-
&& if [ -n "${msg}" ]; then \
38-
>&2 echo "ERROR: outdated: ${msg}" ; \
37+
&& if pipx upgrade-all --global | tee -a /dev/stderr | grep -q -e . ; then \
3938
exit 1 ; \
4039
fi
4140

json/docker-compose.test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ services:
1919
npm --version # npm
2020
openssl --version # openssl
2121
pip --version # py3-pip
22+
pipx --version # pipx
2223
python --version # python3
2324
'

0 commit comments

Comments
 (0)