Skip to content

Commit

Permalink
[build]: Upgrade pip3 before pip2 (sonic-net#5743)
Browse files Browse the repository at this point in the history
Upgrading pip3 after pip2 caused the pip command to be aliased to the pip3 command. However, since we are still transitioning from Python 2 to Python 3, most pip commands in the codebase are expecting pip to alias to pip2. The proper solution here is to explicitly call pip2 and pip3, and no longer call pip, however this will require extensive changes and testing, so to quickly fix this issue, we upgraded pip2 after pip3 to ensure that pip2 is installed after pip3.
  • Loading branch information
jleveque authored and santhosh-kt committed Feb 25, 2021
1 parent a38c20e commit d0932d7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dockers/docker-config-engine-buster/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ RUN apt-get update && \
python-setuptools \
python3-setuptools

RUN pip2 install --upgrade pip
RUN pip3 install --upgrade pip
RUN pip2 install --upgrade pip
RUN apt-get purge -y python-pip python3-pip

# For sonic-config-engine Python 3 package
Expand Down
2 changes: 1 addition & 1 deletion sonic-slave-buster/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ RUN export VERSION=1.14.2 \
&& echo 'export PATH=$PATH:$GOROOT/bin' >> /etc/bash.bashrc \
&& rm go$VERSION.linux-*.tar.gz

RUN pip2 install --upgrade pip
RUN pip3 install --upgrade pip
RUN pip2 install --upgrade pip
RUN apt-get purge -y python-pip python3-pip

# For building Python packages
Expand Down
2 changes: 1 addition & 1 deletion sonic-slave-stretch/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ RUN export VERSION=1.14.2 \
&& echo 'export PATH=$PATH:$GOROOT/bin' >> /etc/bash.bashrc \
&& rm go$VERSION.linux-*.tar.gz

RUN pip2 install --upgrade pip
RUN pip3 install --upgrade pip
RUN pip2 install --upgrade pip
RUN apt-get purge -y python-pip python3-pip

# For p4 build
Expand Down

0 comments on commit d0932d7

Please sign in to comment.