[Python-Dev] magic in setuptools (Was: setuptools in the stdlib)

Paul Moore p.f.moore at gmail.com
Sun Apr 23 15:20:23 CEST 2006


On 4/23/06, Phillip J. Eby <pje at telecommunity.com> wrote:
> At 01:19 PM 4/23/2006 +1000, Anthony Baxter wrote:
> >On Sunday 23 April 2006 11:43, Nick Coghlan wrote:
> > > Maybe we need something that's the equivalent of alien (rpm -> dpkg
> > > converter), so that given an egg, one can easily get a native
> > > installer for that egg.
> >
> >An 'eggconvert' that used the existing bdist_foo machinery to build
> >system specific packages would probably be an ok summer of code
> >project, no?
>
> That's probably not going to be the best way to get from an egg to a system
> package, since a lot of the bdist_foo commands try to build things from
> source, and an egg for the specific platform is already going to be built,
> and won't include source (except for Python modules).

Yes. And on Windows at least, building from source can be problematic.
Given a binary egg with all the bits included, it's *far* better to
just move them around and build an installer from the pieces.

It might be possible to unpack the egg into the structure of a
distutils "build" directory, and then use bdist_xxx to build the
installer on that (on the basis that the build steps will be ignored
as the objects are already there - you may have to fiddle a bit to
fool distutils into *not* needing source present to check timestamps
against...)

> Probably you'd want to create something more like Vincenzo Di Massa's
> "easy_deb" program, which uses easy_install to find and fetch a source
> distribution, then builds a .deb from it.  You can currently use:

That's certainly not what I want, in two ways:

1. Finding and fetching things isn't needed - I'm happy starting with
an egg file on the local filesystem
2. Building from source is not always possible, as I explained above.

> So, for any bdist_foo command that's already implemented in the distutils,
> you can already get pretty close to this functionality by using a short
> shell script that just calls easy_install followed by the setup.py.

... assuming that setup.py build works for you. That's not the use
case I am thinking of (which is a 3rd party grabbing a binary egg they
couldn't build for themselves, and converting it to the local
packaging system).

> What you won't get without writing some more code is dependency
> support.

While I accept that dependency support is very valuable to a lot of
people, some of us (the control freaks, maybe :-)) prefer to install
dependencies by hand, based on documented requirements. (There's a
separate rant here, about the possibility that people stop documenting
requirements "because setup.py has them, and they get handled by
easy_install", but I'll save that for another day...)

But if you're thinking of converting egg dependency data to, for
example, deb dependency metadata, then yes, that's an issue. For
Windows installers the conversion is easy, of course - just delete the
metadata :-)

Paul.


More information about the Python-Dev mailing list