Skip to content

Instantly share code, notes, and snippets.

@jbolda
Created April 7, 2016 14:08
Show Gist options
  • Save jbolda/bf9a9f056c2849e4f4af01c9186e194d to your computer and use it in GitHub Desktop.
Save jbolda/bf9a9f056c2849e4f4af01c9186e194d to your computer and use it in GitHub Desktop.
-r common.txt
gunicorn==18.0
lamson==1.3.4
psycopg2==2.5.4
# we are pulling out of a requirements.tx file setup with a folder structure
import os, subprocess, sys, shutil
f = open("setup-out.txt", "w")
try:
shutil.rmtree('vpython', True)
except:
pass
subprocess.call(['pip', 'install', '--upgrade', 'pip'], stdout=f, stderr=f)
subprocess.call(['pip', 'install', '--upgrade', 'setuptools'], stdout=f, stderr=f)
subprocess.call(['pip', 'install', '--upgrade', 'virtualenv'], stdout=f, stderr=f)
subprocess.call(['virtualenv', 'vpython'], stdout=f, stderr=f)
if sys.platform == 'win32':
bin = 'Scripts'
else:
bin = 'bin'
subprocess.call([os.path.join('vpython', bin, 'pip'), 'install', '-r', 'requirements/local.txt'], stdout=f, stderr=f)
try:
os.remove('app.db')
except:
pass
subprocess.call([os.path.join('vpython', bin, 'alembic'), 'upgrade', 'head'], stdout=f, stderr=f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment