Packaging Python is Hard

I just spent 30 minutes or so trying to understand the Python Packaging Policy for Debian. I’m no more informed than I was an hour ago, and my head hurts a lot more. :/

This isn’t helped by the fact that I want to support etch++ (because that’s what most people use) and sarge (because that’s what I’m working on at work). Sigh. Packaging is hard.

For most of the stuff I package, I just dump things in someplace in /usr/lib/, but now I need to figure out how to get my python code into the right place in /usr/lib/pythonX.Y/site-packages … but my modules support any version of Python that debian ships! So where do they go? I have no clue. Do I need to build multiple binary packages — one for each version of Python — for my single source pacakge? I have a feeling that something is supposed to take care of this for me, but I don’t know if it’s dh_pycentral, dh_python, or dh_pythonsupport or what have you, and I don’t know how to get any of them to kick in. Augh.

Oh well. Packaging this one will just have to wait a bit longer.

2 Responses to “Packaging Python is Hard”

  1. stuffduff Says:

    I’d look here first.

    http://docs.python.org/dist/simple-example.html#simple-example

    http://docs.python.org/dist/setup-script.html

    With a little tinkering it can install itself. ;^)

  2. Tshepang Lekhonkhobe Says:

    I found a nice guide here: http://savetheions.com/2010/01/20/packaging-python-applicationsmodules-for-debian/