Changeset - e7a59fe9f353
[Not reviewed]
0 1 0
Lance Edgar - 9 years ago 2016-01-21 20:50:52
ledgar@sacfoodcoop.com
Make upgrade of pip optional when doing `mkvirtualenv()` via fabric.
1 file changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rattail/fablib/python.py
Show inline comments
 
@@ -92,13 +92,14 @@ def configure_virtualenvwrapper(user, workon_home='/srv/envs'):
 
    update('.bashrc')
 

	
 

	
 
def mkvirtualenv(name, user=None):
 
def mkvirtualenv(name, user=None, upgrade_pip=True):
 
    """
 
    Make a new Python virtual environment.
 
    """
 
    sudo('mkvirtualenv {0}'.format(name))
 
    with workon(name):
 
        pip('pip', 'setuptools', 'wheel', 'ndg-httpsclient')
 
    if upgrade_pip:
 
        with workon(name):
 
            pip('pip', 'setuptools', 'wheel', 'ndg-httpsclient')
 
    if user:
 
        with cdvirtualenv(name):
 
            mkdir('app/log', owner='{0}:{0}'.format(user))
0 comments (0 inline, 0 general)