From f9655266df83bc8f8834235f127bc0fa6a79d6d0 Mon Sep 17 00:00:00 2001 From: Eeshan Garg Date: Mon, 7 Aug 2017 20:37:58 -0230 Subject: [PATCH] python-zulip-api: Add tools/provision for setting up dev env. --- .gitignore | 3 +++ requirements.txt | 4 ++++ tools/provision | 16 ++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 requirements.txt create mode 100755 tools/provision 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