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
(cherry picked from commit 5fb37ae584)
This commit is contained in:
Mark Goddard 2020-06-30 10:25:07 +01:00 committed by Radosław Piliszek
parent c6e813ee8a
commit 87e7df1f90

View File

@ -66,7 +66,12 @@ function find_base_dir {
elif [[ ${dir_name} == "/usr/local/bin" ]]; then elif [[ ${dir_name} == "/usr/local/bin" ]]; then
BASEDIR=/usr/local/share/kolla-ansible BASEDIR=/usr/local/share/kolla-ansible
elif [[ -n ${VIRTUAL_ENV} ]] && [[ ${dir_name} == "${VIRTUAL_ENV}/bin" ]]; then elif [[ -n ${VIRTUAL_ENV} ]] && [[ ${dir_name} == "${VIRTUAL_ENV}/bin" ]]; then
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" BASEDIR="${VIRTUAL_ENV}/share/kolla-ansible"
fi
else else
BASEDIR="$(dirname ${dir_name})" BASEDIR="$(dirname ${dir_name})"
fi fi