diff --git a/.gitignore b/.gitignore index 48f0ea8..31ae422 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,6 @@ nosetests.xml .mr.developer.cfg .project .pydevproject + +# ignore virtualenv created by ./tools/provision +.zulip-api-env diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..2fc7248 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +pycodestyle==2.3.1 +-e ./zulip +-e ./zulip_bots +-e ./zulip_botserver diff --git a/tools/provision b/tools/provision new file mode 100755 index 0000000..27cdbe3 --- /dev/null +++ b/tools/provision @@ -0,0 +1,16 @@ +#!/bin/bash + +BASEDIR=`dirname $0`/.. + +if [ ! -d "$BASEDIR/.zulip-api-env" ]; then + virtualenv $BASEDIR/.zulip-api-env + echo "Virtualenv created." +fi + +source $BASEDIR/.zulip-api-env/bin/activate + +if [ ! -f "$BASEDIR/.zulip-api-env/updated" -o $BASEDIR/requirements.txt -nt $BASEDIR/.zulip-api-env/updated ]; then + pip install -r $BASEDIR/requirements.txt + touch $BASEDIR/.zulip-api-env/updated + echo "Requirements installed." +fi