From 99c463d56df9e82e5f81e695a8e7b97a4a6fdfbc Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Thu, 19 Feb 2015 13:05:15 -0600 Subject: [PATCH] Recent virtualenv review cleanups This is a follow-on to comments in https://review.openstack.org/156356 and https://review.openstack.org/#/c/151513/ * Remove work-around for /var/cache/pip * Remove WHEELHOUSE setting in tools/build_wheels.sh and use the pip default directory '/wheelhouse' * Remove bogus MySQL-python install * Removed unused bits and clean up pip commands in from tools/build_venvs.sh Closes-Bug: #1423720 Change-Id: I0283b0dff9146b1b63bd821358505a93566270c6 --- files/rpms-suse/devlibs | 2 +- lib/databases/postgresql | 2 +- stack.sh | 8 +------- tools/build_venv.sh | 19 +++---------------- tools/build_wheels.sh | 4 ---- 5 files changed, 6 insertions(+), 29 deletions(-) diff --git a/files/rpms-suse/devlibs b/files/rpms-suse/devlibs index dbcd6af95b..c9238252af 100644 --- a/files/rpms-suse/devlibs +++ b/files/rpms-suse/devlibs @@ -1,6 +1,6 @@ libffi-devel # pyOpenSSL libopenssl-devel # pyOpenSSL libxml2-devel # lxml -libxslt-dev # lxml +libxslt-devel # lxml postgresql-devel # psycopg2 python-devel # pyOpenSSL diff --git a/lib/databases/postgresql b/lib/databases/postgresql index dfda9adbaf..e891a08754 100644 --- a/lib/databases/postgresql +++ b/lib/databases/postgresql @@ -102,7 +102,7 @@ EOF fi # Install Python client module - pip_install MySQL-python psycopg2 + pip_install psycopg2 } function database_connection_url_postgresql { diff --git a/stack.sh b/stack.sh index 6002cf9d17..f597f78c36 100755 --- a/stack.sh +++ b/stack.sh @@ -677,14 +677,8 @@ source $TOP_DIR/tools/fixup_stuff.sh # Virtual Environment # ------------------- -# Temporary hack for testing -# This belongs in d-g functions.sh setup_host() or devstack-vm-gate.sh -if [[ -d /var/cache/pip ]]; then - sudo chown -R $STACK_USER:$STACK_USER /var/cache/pip -fi - # Pre-build some problematic wheels -if [[ ! -d ${WHEELHOUSE:-} ]]; then +if [[ -n ${WHEELHOUSE:-} && ! -d ${WHEELHOUSE:-} ]]; then source $TOP_DIR/tools/build_wheels.sh fi diff --git a/tools/build_venv.sh b/tools/build_venv.sh index ad9508056b..11d1d35208 100755 --- a/tools/build_venv.sh +++ b/tools/build_venv.sh @@ -34,26 +34,13 @@ if [[ -z "$TOP_DIR" ]]; then source $TOP_DIR/stackrc - trap err_trap ERR - fi -# Exit on any errors so that errors don't compound -function err_trap { - local r=$? - set +o xtrace - - rm -rf $TMP_VENV_PATH - - exit $r -} - # Build new venv virtualenv $VENV_DEST # Install modern pip -$VENV_DEST/bin/pip install -U pip +PIP_VIRTUAL_ENV=$VENV_DEST pip_install -U pip -for pkg in ${MORE_PACKAGES}; do - pip_install_venv $VENV_DEST $pkg -done +# Install additional packages +PIP_VIRTUAL_ENV=$VENV_DEST pip_install ${MORE_PACKAGES} diff --git a/tools/build_wheels.sh b/tools/build_wheels.sh index c87b6dafe6..31398f9b0e 100755 --- a/tools/build_wheels.sh +++ b/tools/build_wheels.sh @@ -36,10 +36,6 @@ fi # Get additional packages to build MORE_PACKAGES="$@" -# Set a fall-back default, assume that since this script is being called -# package builds are to happen even if WHEELHOUSE is not configured -export WHEELHOUSE=${WHEELHOUSE:-.wheelhouse} - # Exit on any errors so that errors don't compound function err_trap { local r=$?