Python Pypi: what is your process for releasing packages for different Python versions? (Linux)

StackOverflow https://stackoverflow.com/questions/1512644

  •  19-09-2019
  •  | 
  •  

Question

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?

Was it helpful?

Solution

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 releasing is just a question of running python setup.py sdist register upload and it doesn't matter what Python version you use to run that.

OTHER TIPS

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 coverage.py, you can see the code at bitbucket, though I should warn you, they are .cmd Windows scripts.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top