Skip to content

Commit

Permalink
base: Rework Python dependency installation
Browse files Browse the repository at this point in the history
This commit reworks the Python dependency installation step to:

1. Fix incorrect pip upgrade implementation -- pip cannot upgrade
   itself and must be called via Python executable. This is especially
   important because the package dependency resolver was reworked in
   the pip 20.3 and the installation step requires the reworked
   dependency resolver in order to automatically resolve conflicts.

2. Specify all requirements in single `pip install` run so that the
   package dependency resolver can resolve any conflicts among all the
   requirements.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
  • Loading branch information
stephanosio committed Dec 15, 2022
1 parent 5419d69 commit ab43e90
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,13 @@ RUN wget ${WGET_ARGS} https://github.com/Kitware/CMake/releases/download/v${CMAK
rm -f ./cmake-${CMAKE_VERSION}-Linux-${HOSTTYPE}.sh

# Install Python dependencies
RUN pip3 install wheel pip -U &&\
pip3 install -r https://raw.githubusercontent.com/zephyrproject-rtos/zephyr/master/scripts/requirements.txt && \
pip3 install -r https://raw.githubusercontent.com/zephyrproject-rtos/mcuboot/master/scripts/requirements.txt && \
pip3 install west &&\
pip3 install sh &&\
pip3 install awscli PyGithub junitparser pylint \
statistics numpy \
imgtool \
protobuf \
GitPython
RUN python3 -m pip install -U pip && \
pip3 install -U wheel setuptools && \
pip3 install \
-r https://raw.githubusercontent.com/zephyrproject-rtos/zephyr/master/scripts/requirements.txt \
-r https://raw.githubusercontent.com/zephyrproject-rtos/mcuboot/master/scripts/requirements.txt \
awscli GitPython imgtool junitparser numpy protobuf PyGithub \
pylint sh statistics west

# Clean up stale packages
RUN apt-get clean -y && \
Expand Down

0 comments on commit ab43e90

Please sign in to comment.