Dear Python Modules team,

I'm seeking guidance from a source of experience and authority on the correct 
way to turn my Python eggs into Debian packages. My interest in doing this is 
that I'm a committed Debian (and Ubuntu) user, also that I do most of my 
development in Python. *Most importantly, I want to be in a position whereby my 
successful personal Python projects are in good shape to be contributed to the 
public arena.* If I get to a successful outcome, I'll be very happy to document 
what I've done and learnt on my website for others to refer to. 

The central question I'm trying to answer is this:

Q.) If I already have a Python sdist/egg which can be installed with 
setuptools, can I just roll the Debian package around that and use setuptools 
during the install/remove process?

-----

The Debian Python Policy lists 'distutils' at the head of it's Packaging Tools 
list 
(http://www.debian.org/doc/packaging-manuals/python-policy/ap-packaging_tools.html),
 is it hinting at the approach suggested in my question?

-----

My simple goals...

1) Manually construct (well, dh_make) and build a Debian package, maintaining 
Debian control files in source control
        - goal is to minimise coupling between Debian package files and 
contained Python sdist/egg
        - ideally Debian package is just a wrapper for the egg, stating version 
and dependency management
2) Host one copy of the Debian package in my Debian repo (reprepro)
        - include the same file once for each Debian version (lenny, squeeze, 
sid)
        - only produce a variant package for a Debian version where the source 
code dictates it (like library dependencies)
3) Install using aptitude

…for Debianizing my current state:

- All the files (sources, Makefile) are all managed under one directory in 
source control (i.e. I'm not pulling a source tgz from elsewhere)
- I can already build Python sdist, bdist_egg
- My installation process from sdist is currently:
        % tar zxvf X.tar.gz
        % cd X
        % sudo python setup.py install --record install-record.txt
- My install process from egg is currently:
        % sudo easy_install --record install-record.txt X.egg
- My uninstall process is currently:
        % cat install-record.txt | xargs sudo rm -f

-----

I already construct Debian packages for some non-Python projects I have, so I 
know it that the subject is a large and sometimes complicated one. I've 
previously used python-support (once) with success but now see that it's 
deprecated. The link I gave above lists 5 different tools which suggests that 
the topic is probably not as simple as 'just' rolling a package around the egg. 
What I can't find anywhere is a good description of what the root causes for 
that are. (Is it the Python version, compiled libraries, install locations, ???)

-----

Oh, and before I forget, if you're not familiar with English 'cuisine' here's 
my mental model for rolling Debian scotch around the Python egg from the 
Subject:

http://www.guardian.co.uk/lifeandstyle/wordofmouth/2010/apr/20/consider-the-scotch-egg

Many thanks in advance for any help or advice you can offer, and, of course, 
your time in doing so.

Br.,

David Spence

Reply via email to