Any solid examples of using buildout to download a tarball from a specific branch in Git into my eggs directory?
All the answers i've tried seem to keep grabbing the version from PyPi instead.
I'm trying to grab the development branch of MongoKit... ( http://github.com/namlook/mongokit/tarball/devel#egg=mongokit) as a tarball...
Thanks.
You can add any python package hosted on git-hub by adding a find-links url pointing to the project tarball URL plus a #egg=packagename postfix. As you already discovered, for mongokit that is:
http://github.com/namlook/mongokit/tarball/devel#egg=mongokit
You can add a version number to that URL to provide buildout with a reason to prefer the github URL over the one found on PyPI. This is needed when the version numbers match, as is the case for mongokit at the time of answering. The version is appended with a dash:
http://github.com/namlook/mongokit/tarball/devel#egg=mongokit-0.6yourmarker1
I've added a marker to the version number and a counter; the addition of the marker means that the github version will be deemed newer than the version found on PyPI, but if 0.7 was released, it would be the newer one. You can make yourmarker
anything you like, and you can upgrade the number if you needed to get the latest changes from github (the egg will be cached locally otherwise).
I'd also pin that version in the buildout.
So a simple buildout would be:
[buildout]
parts = whatever
find-links =
http://github.com/namlook/mongokit/tarball/devel#egg=mongokit-0.6yourmarker1
eggs = mongokit
versions = versions
[versions]
mongokit = 0.6yourmarker1
From there on out you can use mongokit as a setuptools dependency (install_requires=['mongokit']
).