From bbcdbde679a890e5ca1d92444dab35c8d8f603d8 Mon Sep 17 00:00:00 2001 From: Benjamin Kane Date: Thu, 21 Oct 2021 11:52:49 -0700 Subject: [PATCH] replace virtualenv with venv --- README.md | 2 +- script/bootstrap | 11 +++++++---- script/cibuild | 4 +--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index aa10518..a1dc5d4 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Running through the following commands will install the latest release of OctoDN ```shell $ mkdir dns $ cd dns -$ virtualenv env +$ python -m venv env ... $ source env/bin/activate $ pip install octodns diff --git a/script/bootstrap b/script/bootstrap index b135122..543d7b7 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -15,15 +15,18 @@ if [ ! -d "$VENV_NAME" ]; then if [ -z "$VENV_PYTHON" ]; then VENV_PYTHON=$(command -v python3) fi - virtualenv --python="$VENV_PYTHON" "$VENV_NAME" + "$VENV_PYTHON" -m venv "$VENV_NAME" fi . "$VENV_NAME/bin/activate" -pip install -U 'pip>=10.0.1' -pip install -r requirements.txt +# We're in the venv now, so use the first Python in $PATH. In particular, don't +# use $VENV_PYTHON - that's the Python that *created* the venv, not the python +# *inside* the venv +python -m pip install -U 'pip>=10.0.1' +python -m pip install -r requirements.txt if [ "$ENV" != "production" ]; then - pip install -r requirements-dev.txt + python -m pip install -r requirements-dev.txt fi if [ ! -L ".git/hooks/pre-commit" ]; then diff --git a/script/cibuild b/script/cibuild index a2dc527..f356a84 100755 --- a/script/cibuild +++ b/script/cibuild @@ -8,9 +8,7 @@ script/bootstrap echo "## environment & versions ######################################################" python --version -pip --version -VVER=$(virtualenv --version) -echo "virtualenv $VVER" +python -m pip --version if [ -z "$VENV_NAME" ]; then VENV_NAME="env"