Skip to content

Instantly share code, notes, and snippets.

@witsch
Last active September 27, 2015 12:28
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 witsch/1270246 to your computer and use it in GitHub Desktop.
Save witsch/1270246 to your computer and use it in GitHub Desktop.
convenience Makefile for the "collective" Python buildout
# set up python buildout & development tools
version = 2.7
python = bin/python$(version)
defaults = bin/python bin/virtualenv
tools = buildout pep8 pyflakes mkrelease checkversions igor pytest tox devpi
namespace =
all: $(defaults) $(tools)
tools: $(tools)
buildout: namespace=zc.
mkrelease: namespace=jarn.
checkversions: namespace=z3c.
igor: namespace=mr.
$(tools): tools/bin/pip
$? install --upgrade $(namespace)$@
ln -sf ../tools/bin/$@ bin
tools/bin/pip: $(python)
virtualenv-$(version) --no-site-packages --distribute tools
$(defaults): $(python)
ln -s $@*$(version) $@
$(python): python/bin/install-links
mkdir -p bin
python/bin/install-links
python/bin/install-links: python/bin/buildout
cd python && bin/buildout -U install-links:prefix=$(PWD)
python/bin/buildout: python/buildout.cfg
cd python && python bootstrap.py
python/buildout.cfg:
git clone https://github.com/collective/buildout.python python
clean:
rm -rf python
.PHONY: all tools clean $(tools)
@witsch
Copy link
Author

witsch commented Oct 7, 2011

Drop this Makefile into a directory, e.g. ~/Development, run make, add <dir>/bin to your $PATH and start coding...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment