Skip to content

Instantly share code, notes, and snippets.

@k4ml
Created November 3, 2017 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k4ml/4500f304bd075831f8b4b50503bca134 to your computer and use it in GitHub Desktop.
Save k4ml/4500f304bd075831f8b4b50503bca134 to your computer and use it in GitHub Desktop.
Bootstrap python environment ready for use with buildout
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