Skip to content

Commit 7d95395

Browse files
authored
[sonic-utilities-build] Explicitly install 'mock' package and use Python 2 for 201911 branch (sonic-net#196)
Something changed recently which caused the sonic-utilities 201911 PR build to fail to install the `mock` package from PyPI implicitly. Here, we install version 3.0.5 (the latest version available for Python 2) of the package explicitly before building the sonic-utilities package. Also, explicitly call `pip2` and `python2` instead of `pip` and `python` just to ensure the proper versions are used.
1 parent 148ba9c commit 7d95395

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

scripts/common/sonic-utilities-build/build_201911.sh

+15-14
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,25 @@ ls -lrt
88
99
sudo apt-get install python-m2crypto
1010
sudo apt-get -y purge python-click
11-
sudo pip install --upgrade setuptools
12-
sudo pip install "click>=7.0"
13-
sudo pip install click-default-group==1.2
14-
sudo pip install tabulate
15-
sudo pip install natsort
16-
sudo pip install buildimage/target/python-wheels/swsssdk-2.0.1-py2-none-any.whl
17-
sudo pip install buildimage/target/python-wheels/sonic_py_common-1.0-py2-none-any.whl
18-
sudo pip install buildimage/target/python-wheels/sonic_config_engine-1.0-py2-none-any.whl
19-
sudo pip install mockredispy==2.9.3
20-
sudo pip install netifaces==0.10.9
21-
sudo pip install pytest-runner==4.4
22-
sudo pip install xmltodict==0.12.0
23-
sudo pip install jsondiff==1.2.0
11+
sudo pip2 install --upgrade setuptools
12+
sudo pip2 install "click>=7.0"
13+
sudo pip2 install click-default-group==1.2
14+
sudo pip2 install tabulate
15+
sudo pip2 install natsort
16+
sudo pip2 install buildimage/target/python-wheels/swsssdk-2.0.1-py2-none-any.whl
17+
sudo pip2 install buildimage/target/python-wheels/sonic_py_common-1.0-py2-none-any.whl
18+
sudo pip2 install buildimage/target/python-wheels/sonic_config_engine-1.0-py2-none-any.whl
19+
sudo pip2 install mock==3.0.5
20+
sudo pip2 install mockredispy==2.9.3
21+
sudo pip2 install netifaces==0.10.9
22+
sudo pip2 install pytest-runner==4.4
23+
sudo pip2 install xmltodict==0.12.0
24+
sudo pip2 install jsondiff==1.2.0
2425
2526
cd sonic-utilities
2627
2728
# Test building the Debian package
28-
sudo python setup.py --command-packages=stdeb.command bdist_deb
29+
sudo python2 setup.py --command-packages=stdeb.command bdist_deb
2930
3031
EOF
3132

0 commit comments

Comments
 (0)