]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/setup-virtualenv: s/virtualenv/python -m venv/
authorKefu Chai <kchai@redhat.com>
Sat, 31 Jul 2021 12:47:28 +0000 (20:47 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 31 Jul 2021 13:16:56 +0000 (21:16 +0800)
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 <kchai@redhat.com>
src/tools/setup-virtualenv.sh

index af945e2c5a46fba68beb2aca06aadebbf3fac297..e9a1c6ddfbe4db774e95f8832b70f20b718937b1 100755 (executable)
@@ -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