Changed from .pth to add2virtualenv equivalent

The mycroft-core.pth file wasn't addequate to get Python to fully
accept mycroft-core into the system path.  For example, some of
the integration tests would fail in odd ways.

So switched to using add2virtualenv, which is was fine.  But you
can't call that within the dev_setup.sh script since it is a
shell function.  So instead this code does essentially what
add2virtualenv does.
pull/992/head
Steve Penrod 2017-08-16 02:02:39 -07:00
parent dd2aa0900c
commit 29ee8bb26d
1 changed files with 12 additions and 4 deletions

View File

@ -46,7 +46,7 @@ fi
# Check whether to build mimic (it takes a really long time!)
build_mimic='y'
if [[ "$1" == '-sm' ]] ; then
if [[ "$1" == '-sm' ]] ; then
build_mimic='n'
else
# first, look for a build of mimic in the folder
@ -79,15 +79,23 @@ easy_install pip==7.1.2 # force version of pip
pip install --upgrade virtualenv
# Add mycroft-core to the virtualenv path
echo "$TOP" > ${VIRTUALENV_ROOT}/lib/python2.7/site-packages/mycroft-core.pth
# (This is equivalent to typing 'add2virtualenv $TOP', except
# you can't invoke that shell function from inside a script)
if ! grep -q "mycroft-core" "${VIRTUALENV_ROOT}/lib/python2.7/site-packages/_virtualenv_path_extensions.pth"; then
echo "Adding mycroft-core to virtualenv path"
sed -i.tmp '1 a\
'"$TOP"'
' "${VIRTUALENV_ROOT}/lib/python2.7/site-packages/_virtualenv_path_extensions.pth"
fi
# install requirements (except pocketsphinx)
# removing the pip2 explicit usage here for consistency with the above use.
pip install -r requirements.txt
pip install -r requirements.txt
if [[ $(free|awk '/^Mem:/{print $2}') -lt 1572864 ]] ; then
CORES=1
else
else
CORES=$(nproc)
fi
echo "Building with $CORES cores."