I've got several eggs I maintain on Pypi but up until now I've always focused on Python 2.5x. I'd like to release my eggs under both Python 2.5 & Python 2.6 in an automated fashion i.e.

  1. running tests
  2. generating doc
  3. preparing eggs
  4. uploading to Pypi

How do you guys achieve this?

A related question: how do I tag an egg to be "version independent" ? works under all version of Python?


I use a script to switch my Python version, run the tests, switch to the next Python version, run the tests again, and so on. I use this to test on 2.3, 2.4, 2.5, 2.6, and 3.1. In addition, I run all my tests under two different configuration scenarios (C extension available, or not), so this runs my full test suite 10 times.

I use a similar script to build kits, though I build windows installers for each version, then one source kit.

For uploading, I just do it all manually.

For docs, there's only one version to build, and that's done with a Makefile target.

This is all for, you can see the code at bitbucket, though I should warn you, they are .cmd Windows scripts.

Ned Batchelder
@ned: many thanks for your contribution. I am on Linux and I do not have a Windows box handy anymore.
The same approach will work on Linux, you just have to decide how you will switch python versions..
Ned Batchelder
+1  A: 

You don't need to release eggs for anything else than Windows, and then only if your package uses C extensions so that they have compiled parts. Otherwise you simply release one source distribution. That will be enough for all Python versions on all platforms.

Running the tests for different versions automated is tricky if you don't have a buildbot. But once you have run the tests with both 2.5 and 2.6 releaseing is just a question of running python sdist register upload and it doesn't matter what Python version you use to run that.

Lennart Regebro
strange... the last time I uploaded an egg the way you describe, it was tagged with the python version used to make it... and then if I tried *easy_install* on it with a different Python version, it wouldn't work... Could you provide an explanation please?
No, tagging with python versions is only done when you create binary distributions. In your case you used bdist_egg, as far as I can see. As you have no C-code, from what I can see in yourpackages, you should use sdist instead.
Lennart Regebro
@Lennart: THANKS!!! that must have been my problem!