Travis CI, Python 3.3, Buildout
Posted Thursday, January 30, 2014, at 11:04PM
I had the hardest time configuring Travis CI for several Python 3.3 packages. I think it may have been because they’re all PEP 420 namespace packages. The strange thing is that the tests would pass for some of the packages but not others.
I ended up creating a package (which I lovingly named
<a title="It's a travesty" href="https://github.com/TangledWeb/tangled.travisty">travisty</a>) so my repos wouldn’t be cluttered with hundreds of superfluous commits recording my failed attempts to get things working. I got pretty frustrated and almost gave up on Travis entirely.
There was a post on Planet Python recently about problems with Python 3 and virtualenv, and I’m guessing the issue is something related to that and not Travis specifically, but I never did actually figure it out.
Instead, I tried installing my packages using Buildout (which I prefer over virtualenv for development anyway), and that magically worked. It kind of bugs me that I don’t know why it works and the bare virtualenv doesn’t, but at this point I’m just happy that it does.
.travis.yml I ended up with:
language: python python: - "3.3" install: - pip install zc.buildout - git clone git://github.com/TangledWeb/tangled ../tangled - buildout script: - ./bin/tangled test
<a href="https://github.com/TangledWeb/tangled/blob/master/tangled/scripts/test.py">tangled test</a> script is just a tiny wrapper around the built in unittest discovery. It’s equivalent to
./bin/python -m unittest discover my/package.