distutils alternatives?

David Fraser davidf at sjsoft.com
Wed Jul 21 11:57:11 CEST 2004


Lonnie Princehouse wrote:
> I'm in a situation where I need to distribute several interdependent
> Python packages.  There are good reasons not to combine them all into
> one package.  Distutils doesn't seem to be able to bundle a
> heterogeneous mix of multiple packages and modules, and so I've
> currently got people launching three installers in the proper sequence
> in order to get software installed, which seems needlessly complicated
> and confusing.  There must be a better way.  What I really want is a
> way for the installer to automatically download and install
> dependencies...
> 
What we tend to do is alter the setup script of the packages that we 
want to include in our package, so that it can be imported into our 
package and run from there. distutils is unfortunately tricky sometimes, 
but with most packages this has been possible.
- define variables in the packagesetup script for all the bits that need 
to be included
- in the packagesetup script, do if __name__ == '__main__': setup(...)
- in the main setup script, import the other package setup scripts you need
- include the neccesary bits into the right place.
It would be really nice if distutils were built to do this kind of thing 
out of the box ...

> First, does anyone know of an alternative to distutils that does this?
> 
> Second, this is exactly what Gentoo's Portage software does, except
> for Gentoo ebuilds instead of Python packages.  It also happens to be
> written in Python.  Can anyone more familiar with Portage's internals
> comment on the feasibility of harnessing emerge to work as a Python
> package installer/distributer for systems which aren't running Gentoo?
>  It is also foreseeable that something like this could be linked to
> PyPI, etc.

This would be fantastic.
An important issue to resolve would be to link into the native package 
management system on each platform (Windows - MSI, various for other 
platforms). You want to be able to have a single installer that installs 
multiple native packages, and an uninstaller that can intelligently 
determine dependencies and uninstall them.

David



More information about the Python-list mailing list