don't use pip -e install for libraries

libraries in openstack shouldn't be installed editable, as it
causes all manner of issues (especially complicated by the use
of namespace packages). Install these globally as part of the
devstack installation process.

Change-Id: I11acb169e74069be0618e57496ff342f9e788493
This commit is contained in:
Sean Dague 2014-03-31 10:35:43 -04:00
parent 31f7475baf
commit 099e5e3f81
5 changed files with 33 additions and 33 deletions

View File

@ -40,7 +40,6 @@ source $TOP_DIR/lib/rpc_backend
source $TOP_DIR/lib/tls
source $TOP_DIR/lib/oslo
source $TOP_DIR/lib/horizon
source $TOP_DIR/lib/keystone
source $TOP_DIR/lib/glance
@ -84,7 +83,6 @@ if [[ -d $TOP_DIR/extras.d ]]; then
fi
# Clean projects
cleanup_oslo
cleanup_cinder
cleanup_glance
cleanup_keystone

View File

@ -1239,6 +1239,19 @@ function pip_install {
&& $SUDO_PIP rm -rf ${pip_build_tmp}
}
# this should be used if you want to install globally, all libraries should
# use this, especially *oslo* ones
function setup_install {
local project_dir=$1
setup_package_with_req_sync $project_dir
}
# this should be used for projects which run services, like all services
function setup_develop {
local project_dir=$1
setup_package_with_req_sync $project_dir -e
}
# ``pip install -e`` the package, which processes the dependencies
# using pip before running `setup.py develop`
#
@ -1247,8 +1260,9 @@ function pip_install {
#
# Uses globals ``TRACK_DEPENDS``, ``REQUIREMENTS_DIR``, ``UNDO_REQUIREMENTS``
# setup_develop directory
function setup_develop {
function setup_package_with_req_sync {
local project_dir=$1
local flags=$2
# Don't update repo if local changes exist
# Don't use buggy "git diff --quiet"
@ -1260,7 +1274,7 @@ function setup_develop {
$SUDO_CMD python update.py $project_dir)
fi
setup_develop_no_requirements_update $project_dir
setup_package $project_dir $flags
# We've just gone and possibly modified the user's source tree in an
# automated way, which is considered bad form if it's a development
@ -1281,12 +1295,15 @@ function setup_develop {
# using pip before running `setup.py develop`
# Uses globals ``STACK_USER``
# setup_develop_no_requirements_update directory
function setup_develop_no_requirements_update {
function setup_package {
local project_dir=$1
local flags=$2
pip_install -e $project_dir
pip_install $flags $project_dir
# ensure that further actions can do things like setup.py sdist
safe_chown -R $STACK_USER $1/*.egg-info
if [[ "$flags" == "-e" ]]; then
safe_chown -R $STACK_USER $1/*.egg-info
fi
}

View File

@ -46,7 +46,7 @@ function install_infra {
# Install pbr
git_clone $PBR_REPO $PBR_DIR $PBR_BRANCH
setup_develop $PBR_DIR
setup_install $PBR_DIR
}
# Restore xtrace

View File

@ -34,44 +34,29 @@ TASKFLOW_DIR=$DEST/taskflow
# install_oslo() - Collect source and prepare
function install_oslo {
# TODO(sdague): remove this once we get to Icehouse, this just makes
# for a smoother transition of existing users.
cleanup_oslo
git_clone $CLIFF_REPO $CLIFF_DIR $CLIFF_BRANCH
setup_develop $CLIFF_DIR
setup_install $CLIFF_DIR
git_clone $OSLOCFG_REPO $OSLOCFG_DIR $OSLOCFG_BRANCH
setup_develop $OSLOCFG_DIR
setup_install $OSLOCFG_DIR
git_clone $OSLOMSG_REPO $OSLOMSG_DIR $OSLOMSG_BRANCH
setup_develop $OSLOMSG_DIR
setup_install $OSLOMSG_DIR
git_clone $OSLORWRAP_REPO $OSLORWRAP_DIR $OSLORWRAP_BRANCH
setup_develop $OSLORWRAP_DIR
setup_install $OSLORWRAP_DIR
git_clone $OSLOVMWARE_REPO $OSLOVMWARE_DIR $OSLOVMWARE_BRANCH
setup_develop $OSLOVMWARE_DIR
setup_install $OSLOVMWARE_DIR
git_clone $PYCADF_REPO $PYCADF_DIR $PYCADF_BRANCH
setup_develop $PYCADF_DIR
setup_install $PYCADF_DIR
git_clone $STEVEDORE_REPO $STEVEDORE_DIR $STEVEDORE_BRANCH
setup_develop $STEVEDORE_DIR
setup_install $STEVEDORE_DIR
git_clone $TASKFLOW_REPO $TASKFLOW_DIR $TASKFLOW_BRANCH
setup_develop $TASKFLOW_DIR
}
# cleanup_oslo() - purge possibly old versions of oslo
function cleanup_oslo {
# this means we've got an old oslo installed, lets get rid of it
if ! python -c 'import oslo.config' 2>/dev/null; then
echo "Found old oslo.config... removing to ensure consistency"
local PIP_CMD=$(get_pip_command)
pip_install oslo.config
sudo $PIP_CMD uninstall -y oslo.config
fi
setup_install $TASKFLOW_DIR
}
# Restore xtrace

View File

@ -40,10 +40,10 @@ function install_stackforge {
cleanup_stackforge
git_clone $WSME_REPO $WSME_DIR $WSME_BRANCH
setup_develop_no_requirements_update $WSME_DIR
setup_package $WSME_DIR
git_clone $PECAN_REPO $PECAN_DIR $PECAN_BRANCH
setup_develop_no_requirements_update $PECAN_DIR
setup_package $PECAN_DIR
}
# cleanup_stackforge() - purge possibly old versions of stackforge libraries