Created
November 3, 2017 12:12
-
-
Save k4ml/4500f304bd075831f8b4b50503bca134 to your computer and use it in GitHub Desktop.
Bootstrap python environment ready for use with buildout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import subprocess | |
import functools | |
run = functools.partial(subprocess.call, shell=True) | |
run('virtualenv -p python3 .env') | |
run('.env/bin/pip install --upgrade setuptools') | |
run('.env/bin/pip install --upgrade pip') | |
run('.env/bin/pip install https://github.com/xoxzo/buildout/archive/wheel-offline.zip#egg=zc.buildout') | |
run('.env/bin/pip install wheel') | |
if not os.path.exists('buildout.cfg'): | |
TPL = """ | |
[buildout] | |
extends = buildout/development.cfg | |
""" | |
f = open('buildout.cfg', 'w') | |
f.write(TPL) | |
run('.env/bin/buildout bootstrap') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment