CiscoDevNet / yang-explorer

An open-source Yang Browser and RPC Builder Application
Apache License 2.0
438 stars 177 forks source link

Consider adding a virtual env and auto-pip install option start start.sh? #2

Closed einarnn closed 8 years ago

einarnn commented 8 years ago

Consider having a script that automagically creates a python virtualenv for you and loads the package requirements. A small but useful thing to keep the user's python environment 'clean'. I have a small project that I use this script for:

#
# bootstrap the virtual env if necessary
#
if [ -f "v/bin/activate" ]
then
    echo virtual env already created
    source v/bin/activate
else
    virtualenv v
    source v/bin/activate
fi

# Just install dependencies by default to pick up any changes
pip install jinja2
pip install jsl
pip install jsonschema
pip install rethinkdb

#
# run the data server
#
python ucdataserver.py

Where I explicitly invoke pip install you could use the requirements.txt file instead.

pgohite commented 8 years ago

We already have setup.sh for this, start.sh will activate virtualenv created by setup.sh .. Does this help ?

einarnn commented 8 years ago

Yes! That helps. I didn't notice that setup.sh and start.sh had been modified to do that. Cool!