Newer
Older
# install woob inside a virtualenv, optionally with an associated woob workdir
# can be combined with git-worktree
cd "$(dirname $0)/.."
SRC=$PWD
source=
VDIR=
usage () {
cat << EOF
Usage: $0 [-s] [-d DIR]
-s point sources.list to $SRC/modules instead of updates.woob.tech
-d DIR install virtualenv in DIR instead of a new dir
EOF
}
while getopts hsd: name
do
case $name in
s) source=y;;
d) VDIR="$OPTARG";;
h) usage
exit 0;;
?) usage
exit 2;;
esac
done
shift $(($OPTIND - 1))
VDIR=$(mktemp -d /tmp/woob.venv.XXXXXX)
fi
cd "$VDIR"
echo "Creating env in $VDIR"
$PYTHON -m venv --system-site-packages "$VDIR"
./bin/python -m pip install "$SRC"
echo "file://$SRC/modules" > "$WOOB_WORKDIR/sources.list"
export WOOB_WORKDIR="$VDIR/workdir"
EOF
cat << EOF
Installation complete in $VDIR.
Run ". $VDIR/use-woob-local.sh" to start using it.
Run "$PYTHON -m pip install -U $SRC" to reinstall the core.
EOF
if [ "$source" != y ]
then
echo "You can add file://$SRC/modules into $VDIR/workdir/sources.list to use local modules instead of downloading modules."
fi