Skip to content

Commit e99738d

Browse files
authored
[sonic-utilities] Test and build Python 3 package, but don't fail build yet (sonic-net#185)
In preparation for moving sonic-utilities to Python 3, in the sonic-utilities build script, we install all the Python 3 dependencies and attempt to test and build the Python 3 version of the package. This will ensure we can see the Python 3 build/test success status in the PR check build output. However, we will not fail the build job yet if the Python 3 test or build fails.
1 parent a22ee3c commit e99738d

File tree

1 file changed

+12
-0
lines changed
  • scripts/common/sonic-utilities-build

1 file changed

+12
-0
lines changed

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

+12
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,22 @@ cat <<EOF > build_sonic_utilities.sh
77
ls -lrt
88
99
sudo pip2 install --upgrade setuptools
10+
sudo pip3 install --upgrade setuptools
1011
sudo pip2 install buildimage/target/python-wheels/swsssdk-2.0.1-py2-none-any.whl
12+
sudo pip3 install buildimage/target/python-wheels/swsssdk-2.0.1-py3-none-any.whl
1113
sudo pip2 install buildimage/target/python-wheels/sonic_py_common-1.0-py2-none-any.whl
14+
sudo pip3 install buildimage/target/python-wheels/sonic_py_common-1.0-py3-none-any.whl
1215
sudo pip2 install buildimage/target/python-wheels/sonic_config_engine-1.0-py2-none-any.whl
16+
sudo pip3 install buildimage/target/python-wheels/sonic_config_engine-1.0-py3-none-any.whl
1317
sudo pip2 install buildimage/target/python-wheels/sonic_yang_mgmt-1.0-py2-none-any.whl
18+
sudo pip3 install buildimage/target/python-wheels/sonic_yang_mgmt-1.0-py3-none-any.whl
1419
1520
sudo pip3 install buildimage/target/python-wheels/sonic_yang_models-1.0-py3-none-any.whl
1621
1722
sudo dpkg -i buildimage/target/debs/buster/libyang_1.0.73_amd64.deb
1823
sudo dpkg -i buildimage/target/debs/buster/libyang-cpp_1.0.73_amd64.deb
1924
sudo dpkg -i buildimage/target/debs/buster/python2-yang_1.0.73_amd64.deb
25+
sudo dpkg -i buildimage/target/debs/buster/python3-yang_1.0.73_amd64.deb
2026
2127
# Below is required for swsscommon
2228
sudo dpkg -i buildimage/target/debs/buster/{libnl-3-200_*.deb,libnl-genl-3-200_*.deb,libnl-nf-3-200_*.deb,libnl-route-3-200_*.deb,libhiredis0.14_*.deb}
@@ -26,6 +32,12 @@ sudo dpkg -i buildimage/target/debs/buster/python3-swsscommon_1.0.0_amd64.deb
2632
2733
cd sonic-utilities
2834
35+
# Run unit tests
36+
sudo python3 setup.py test || true
37+
38+
# Build the Python wheel
39+
sudo python3 setup.py bdist_wheel || true
40+
2941
# Run unit tests
3042
sudo python2 setup.py test
3143

0 commit comments

Comments
 (0)