@@ -8,10 +8,28 @@ check_sudo() {
88 fi
99}
1010
11+ activate_python_venv () {
12+ if [ " ${MILVUS_USE_PYTHON_VENV} " != " ON" ] ; then
13+ return 0
14+ fi
15+
16+ if [ -n " ${VIRTUAL_ENV} " ] ; then
17+ return 0
18+ fi
19+
20+ python3 -m venv " ${HOME} /.venv" || exit 1
21+ . " ${HOME} /.venv/bin/activate" || exit 1
22+ }
23+
1124install_linux_cmake_clang_toolchain () {
1225 echo ' Pip install clang toolchain.'
13- pip3 install --user -U pip scikit-build wheel
14- pip3 install --user cmake clang-tidy~=17.0 clang-format~=17.0
26+ if [ -n " ${VIRTUAL_ENV} " ] ; then
27+ pip3 install -U pip scikit-build wheel
28+ pip3 install cmake clang-tidy~=17.0 clang-format~=17.0
29+ else
30+ pip3 install --user -U pip scikit-build wheel
31+ pip3 install --user cmake clang-tidy~=17.0 clang-format~=17.0
32+ fi
1533}
1634
1735ensure_conan_default_profile () {
@@ -96,12 +114,17 @@ install_deps_for_ubuntu_common() {
96114 fi
97115
98116 ${SUDO} apt-get -y install gpg wget gcc g++ ccache make \
99- libssl-dev iwyu lcov git python3-pip clang-format clang-tidy
117+ libssl-dev iwyu lcov git python3-pip python3-venv clang-format clang-tidy
118+ activate_python_venv
100119 install_linux_cmake_clang_toolchain
101120 install_conan
102121
103122 echo ' Pip install docker for integration tests.'
104- pip3 install --user " docker>=7.0.0"
123+ if [ -n " ${VIRTUAL_ENV} " ] ; then
124+ pip3 install " docker>=7.0.0"
125+ else
126+ pip3 install --user " docker>=7.0.0"
127+ fi
105128}
106129
107130install_deps_for_ubuntu () {
@@ -111,11 +134,16 @@ install_deps_for_ubuntu() {
111134install_deps_for_fedora_common () {
112135 check_sudo
113136 ${SUDO} dnf -y install gcc gcc-c++ python2 gpg wget ccache make openssl-devel which lcov git rpm-build cpio python3-pip perl perl-core
137+ activate_python_venv
114138 install_linux_cmake_clang_toolchain
115139 install_conan
116140
117141 echo ' Pip install docker for integration tests.'
118- pip3 install --user " docker>=7.0.0"
142+ if [ -n " ${VIRTUAL_ENV} " ] ; then
143+ pip3 install " docker>=7.0.0"
144+ else
145+ pip3 install --user " docker>=7.0.0"
146+ fi
119147}
120148
121149install_deps_for_centos_8 () {
0 commit comments