Skip to content

[Dependencies] Pin pip3 version #7450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

[Dependencies] Pin pip3 version #7450

wants to merge 2 commits into from

Conversation

jleveque
Copy link
Contributor

@jleveque jleveque commented Apr 27, 2021

Why I did it

A new version of pip (21.1) was released on 4/24, and it appears to have introduced new behavior which is causing the build to break. New log messages such as the following are seen in the build log:

WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/9617> 
WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/9617> 
WARNING: Value for scheme.scripts does not match. Please report this to <https://github.com/pypa/pip/issues/9617> 
WARNING: Value for scheme.data does not match. Please report this to <https://github.com/pypa/pip/issues/9617> 

And the build is failing with errors like:

Requirement already satisfied: sonic-yang-mgmt in /usr/local/lib/python3.7/dist-packages (from sonic-utilities==1.2) (1.0) 
Collecting pexpect==4.8.0 
Downloading pexpect-4.8.0-py2.py3-none-any.whl (59 kB) 
ERROR: Cannot install sonic-utilities==1.2 because these package versions have conflicting dependencies. 
The conflict is caused by: 
sonic-utilities 1.2 depends on netifaces==0.10.7 
The user requested (constraint) netifaces==0.10.9 
To fix this you could try to: 
1. loosen the range of package versions you've specified 
2. remove package versions to allow pip attempt to solve the dependency conflict 

Until we can resolve these issues, pin the version to the last known good version, 21.0.1 in Buster environments, and 20.3.4 in Stretch environments.


Update: This appears to be due to netifaces version 0.10.9 being installed in docker-sonic-vs, whereas sonic-utilities explicitly requires 0.10.7 in its setup.py file. Older versions of pip did not error out here, but 21.1 does.

sonic-net/sonic-utilities#1530 may solve this issue by relaxing the dependencies, therefore this PR may not be necessary.

@jleveque jleveque requested review from lguohan and qiluo-msft April 27, 2021 20:12
@jleveque jleveque self-assigned this Apr 27, 2021
@jleveque jleveque added the dependencies Pull requests that update a dependency file label Apr 27, 2021
@lguohan
Copy link
Collaborator

lguohan commented Apr 27, 2021

can you look into the docker-sonic-vs/Dockerfile.j2, the build breaks there.

@jleveque
Copy link
Contributor Author

can you look into the docker-sonic-vs/Dockerfile.j2, the build breaks there.

docker-sonic-vs uses docker-config-engine-buster as its parent, which in turn uses docker-base-buster as its parent, so this PR should cover it, also.

@jleveque jleveque changed the title [Dependencies] Pin pip3 version to 21.0.1 [Dependencies] Pin pip3 version Apr 27, 2021
@@ -395,7 +395,7 @@ RUN export VERSION=1.14.2 \
&& echo 'export PATH=$PATH:$GOROOT/bin' >> /etc/bash.bashrc \
&& rm go$VERSION.linux-*.tar.gz

RUN pip3 install --upgrade pip
RUN pip3 install --upgrade 'pip==21.0.1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With 21.0.1, sonic_yang_models build is broken.

----------------------------- Captured stdout call -----------------------------
Failed: pyang -f tree ./yang-models/*.yang > ./yang-models/sonic_yang_tree
----------------------------- Captured stderr call -----------------------------
./yang-models/sonic-acl.yang:8: error: module "ietf-inet-types" not found in search path

Can we use version 20.3.4 for buster also?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you ask? Can you please provide some reasoning?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build failure is seen for sonic_yang_models package with pip versions higher than 20.3.4.

The error can be seen in #7407 also.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you verified that pip is the problem here? Why was this error not seen when using pip 21.0, which has been available since January?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I have verified that pip version is the issue here. The build goes through fine when using 20.3.4. With version 21, they made a change in pip that breaks pyang.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me try again with the latest to ensure the build really goes through

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad! When verifying build for version 21.0.1, I still ended up with 21.1.

The breakage came with 21.1. We are good with 21.0.1.

Sorry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries! Good to know. Thanks for confirming!

@jleveque
Copy link
Contributor Author

Closing as this appears to have been fixed by sonic-net/sonic-utilities#1530

@jleveque jleveque closed this Jun 18, 2021
@jleveque jleveque deleted the pip_pip3 branch June 18, 2021 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants