[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Tool support for private modules



> As an example, here's a Python package I'm trying to get packaged for
> Debian. (I am the upstream author of this one, but I'm interested in a
> solution that *doesn't* involve significant changes to the upstream
> code.)
> 
>     <URL:http://cheeseshop.python.org/pypi/gracie/>

The first thing I'd do here is to patch the ez_ stuff away, together
with setuptools. ez_... is known to break things badly (like trying to
download things on buildds and other really broken things). Setuptools
is broken by design imho (see a thread some time ago about this), but it
may work. But as I run into trouble with it too often (like missing
__init__.py files in random directories), I replace it by distutils.
Since we're not building eggs there's not need for setuptools at all
(afaik distutils is able to build eggs now, too - at least the egg info
files, which is enough for us).
Better to patch those things before getting FTBFS reports form the buildds.

Although I didn't test it, there should be no special thign to do with
your setup.py while building a package, python setup.py build/install
--root=.... should do the job (with and without ez_... and setuptools).

http://svn.debian.org/wsvn/python-modules/packages/python-contract/trunk/debian/rules?op=file&rev=0&sc=0
is a pretty simple debian/rules file, which also tries to build the
package for all python versions and runs the tests to ensure nothing is
buggy.
If you like it really simple, cdbs is something you can use:
http://svn.debian.org/wsvn/python-modules/packages/ll-core/trunk/debian/rules?op=file&rev=0&sc=0

Aa you can see on the cdbs example, sometimes upstream does not install
all files in the way one would like it to have in debian, often out of
personal taste - that's easy to fix though. Although at least I
appreciate if upstras isntalls everything at the proper place, at least
distutils supports installing completely non-py related files into the
right directories.

Depending on what you like you have to call dh_py{central,support} to
move your installed files in their directories, of course you need to
add the neccessary informations for them at the apropriate places (like
which python versions you want to support).

> How should I construct the command line for 'setup.py' when I create
> the 'install-python%' target in 'debian/rules' for this package?

Have a look at the first example.
Both will work for arch: all and arch: any packages. For arch: all
packages you don;t need to build/install with all python versions, just
using the default one is enough, everythign else will be handled by
python-support/central while installing the package.  It makes sense to
build them all, though, especially when you want to run tests.


Hope that helps,

Bernd
-- 
Bernd Zeimetz
<bernd@bzed.de>                         <http://bzed.de/>



Reply to: