Support editable virtualenv installation for development

An editable installation allows changes to be made to the source code
directly, and have those changes applied immediately without having to
reinstall.

    pip install -e /path/to/kolla-ansible

Change-Id: I023d96d25edd9d2fafd4415743e298af72a861a1
This commit is contained in:
Mark Goddard 2020-06-30 10:25:07 +01:00
parent 2a2a62000e
commit 5fb37ae584

View File

@ -73,7 +73,12 @@ function find_base_dir {
elif [[ ${dir_name} == "/usr/local/bin" ]]; then
BASEDIR=/usr/local/share/kolla-ansible
elif [[ -n ${VIRTUAL_ENV} ]] && [[ ${dir_name} == "${VIRTUAL_ENV}/bin" ]]; then
BASEDIR="${VIRTUAL_ENV}/share/kolla-ansible"
if test -f ${VIRTUAL_ENV}/lib/python*/site-packages/kolla-ansible.egg-link; then
# Editable install.
BASEDIR="$(head -n1 ${VIRTUAL_ENV}/lib/python*/site-packages/kolla-ansible.egg-link)"
else
BASEDIR="${VIRTUAL_ENV}/share/kolla-ansible"
fi
else
BASEDIR="$(dirname ${dir_name})"
fi