From: Kefu Chai Date: Sat, 31 Jul 2021 12:47:28 +0000 (+0800) Subject: tools/setup-virtualenv: s/virtualenv/python -m venv/ X-Git-Tag: v16.2.7~120^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ff7892a7fb128800b84d46d6627f055ce434f36a;p=ceph.git tools/setup-virtualenv: s/virtualenv/python -m venv/ so we don't need to use virtualenv python package for creating a virtualenv, the "venv" module in Python3 would suffice. see also https://docs.python.org/3/library/venv.html Signed-off-by: Kefu Chai (cherry picked from commit 494fea50ced7224322f382796f1904742e6a6b69) --- diff --git a/src/tools/setup-virtualenv.sh b/src/tools/setup-virtualenv.sh index af945e2c5a46..e9a1c6ddfbe4 100755 --- a/src/tools/setup-virtualenv.sh +++ b/src/tools/setup-virtualenv.sh @@ -40,11 +40,11 @@ TEMP=$($GETOPT --options "h" --long "help,python:" --name "$SCRIPTNAME" -- "$@") test $? != 0 && usage eval set -- "$TEMP" -PYTHON_OPTION="" +PYTHON=python3 while true ; do case "$1" in -h|--help) usage ;; # does not return - --python) PYTHON_OPTION="--python=$2" ; shift ; shift ;; + --python) PYTHON="$2" ; shift ; shift ;; --) shift ; break ;; *) echo "Internal error" ; exit 1 ;; esac @@ -57,7 +57,7 @@ if [ -z "$DIR" ] ; then fi rm -fr $DIR mkdir -p $DIR -virtualenv $PYTHON_OPTION $DIR +$PYTHON -m venv $DIR . $DIR/bin/activate if pip --help | grep -q disable-pip-version-check; then