[Freeipa-devel] [PATCH] setup.py for freeipa-python

William Jon McCann mccann at jhu.edu
Thu Oct 11 15:08:01 UTC 2007


Hi Rob,

On 10/11/07, Rob Crittenden <rcritten at redhat.com> wrote:
> William Jon McCann wrote:
> > Hi,
> >
> > Here is a patch that adds a setup.py for the freeipa-python package.
> >
> > This makes it easier to build tarballs, rpms, and do installs.  It can
> > even generate a spec file:
> > python setup.py bdist_rpm --spec
> >
> > Jon
> >
>
> I'm not familiar with the python distutils package, what does this buy
> us? We already generate tar.gz and rpm files.

Well, in my opinion, freeipa/Makefile really isn't a good build
system.  It has a number of problems:

 * It exists outside of the discrete packages
   If someone wants to build or package one of the individual modules
either from hg or from a tarball it isn't straighforward
 * The version numbers of the individual packages isn't contained in the package
 * It is too heavily biased toward RPM production and not extensible
 * The dist target builds RPMs and SRPMs
 * Does not seem to detect python versions or directories
 * Does not have a mechanism for specifying files to include/exclude
from distribution

The Makefiles in the individual sudirectories have their own problems.
 It is probably sufficient for making the official tarballs and rpms
for the project but it is very inconvenient for an external
developer/packager to use.

I would like to improve the overall system.  Since the subdirectories
are packaged and installed separately I think it makes sense for each
to be self-contained.  This makes it way easier to work with, hack on,
and test each package individually.

Looking at ipa-python specifically:

Since this is a pure python package, I think it makes sense to use:
http://docs.python.org/lib/module-distutils.html

For one, it is the way people expect to work with a python library.
The Makefile that is used is a little lacking:
 * doesn't compile the .py files
 * maintain a version number
 * generate the .spec file
 * have a dist (tarball) target

I suppose another option would be to use autotools but I don't think
that makes sense for a pure python module.

Thanks,
Jon




More information about the Freeipa-devel mailing list