From e6aa3b875136a26235f81b740976b26a85399f13 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Wed, 13 Apr 2022 11:40:06 +0800 Subject: [PATCH] [Build]: Fix pip version constraint conflict issue (#10525) Why I did it [Build]: Fix pip version constraint conflict issue When a version is specified in the constraint file, if upgrading the version in build script, it will have conflict issue. How I did it If a specified version has specified in pip command line, then the version constraint will be skipped. --- src/sonic-build-hooks/scripts/buildinfo_base.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sonic-build-hooks/scripts/buildinfo_base.sh b/src/sonic-build-hooks/scripts/buildinfo_base.sh index 3873d13629..e1ef80b011 100755 --- a/src/sonic-build-hooks/scripts/buildinfo_base.sh +++ b/src/sonic-build-hooks/scripts/buildinfo_base.sh @@ -169,6 +169,10 @@ run_pip_command() elif [[ "$para" == *.whl ]]; then package_name=$(echo $para | cut -d- -f1 | tr _ .) $SUDO sed "/^${package_name}==/d" -i $tmp_version_file + elif [[ "$para" == *==* ]]; then + # fix pip package constraint conflict issue + package_name=$(echo $para | cut -d= -f1) + $SUDO sed "/^${package_name}==/d" -i $tmp_version_file fi done