From 494fea50ced7224322f382796f1904742e6a6b69 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 31 Jul 2021 20:47:28 +0800 Subject: [PATCH] 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 --- src/tools/setup-virtualenv.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/setup-virtualenv.sh b/src/tools/setup-virtualenv.sh index af945e2c5a4..e9a1c6ddfbe 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 -- 2.39.5