Wheel-reinvention with Python

Cliff Wells cliff at develix.com
Wed Aug 3 22:46:26 CEST 2005

On Wed, 2005-08-03 at 09:47 -0400, Mike Meyer wrote:
> Cliff Wells <cliff at develix.com> writes:
> > On Tue, 2005-08-02 at 20:17 -0400, Mike Meyer wrote:
> >
> >> Um - you're not answering the question I asked. I asked "What app do I
> >> use to bundle my applications for Unix, ala py2exe (or whatever it is)
> >> for Windows?" You're telling me how to install wxPython on those
> >> platforms.
> >> I know how to install wxPython. What I want to know is how to build an
> >> application bundle for all those Unix systems for a Python app I use
> >> that includes wxPython - or any other third party libraries I may be
> >> using.
> >
> > Sorry, I assumed you'd know about distutils:
> Cliff, please quit being an ass. You keep assuming that because some
> tool isn't the answer to my question that I don't know about
> it. That's simply rude. It would be *much* more polite to ask "What's
> wrong with distutils" rather than saying "So you don't know about
> distutils."

Since you said "please".  I'll try to forget about "the wonders of X"
comment you made that I found just as rude.

> > http://www.python.org/doc/current/dist/
> > http://www.python.org/doc/current/dist/built-dist.html
> >
> > distutils can go so far as to build an rpm for you, but you'll need to
> > package things like .debs yourself.
> I've very familiar with distutils. It doesn't do what I asked for, in
> that it only bundles up *my* code. It doesn't bundle the things I
> depend on the way py2exe does. It's patently *not* the answer to the
> question I asked.

It can.  It isn't terrifically easy, but distutils can be used to
package up 3rd party libraries, including binary libs.  It can, in fact,
package up any file you so desire.

> For those who want .deb's out of distutils, there's a PR on
> sourceforge that includes a patch to make it generate .debs that works
> quite well.

I wasn't aware of that.  Nice.

> Of course, anyone who built a .deb (or an RPM, or a port, or whatever)
> that bundled up everything it needed would be doing *the wrong
> thing*. Those formats are designed for packaging single distributions,
> not applications. They include dependency information that is used to
> fetch the dependencies and install them. From my standpoint, the
> problem here is that you then have to get the dependencies into the
> repository before you can put your application there and have it
> work. For instance, my port of bicyclerepairman is stuck at an old
> version because I haven't gotten a port PyMac accepted yet (it also
> has to do with bugs in the xemacs port, but that's another story).
> I'm surprised you haven't mentioned eggs yet. Those work across all
> the platforms I named. Of course, they aren't the answer to my
> question either, because, like PRMs et al, they only reference
> external dependencies, they don't include them.

While this describes the general use case of RPM, you can most certainly
include external dependencies.  You do it by not making them external.
If you need wxPython included with your app, you can build wxPython as a
subtree of your project and package it that way.  While wasteful of
space, it is also the only sure way to make sure that your app has the
correct version and all needed dependencies.  This is how py2exe does it
on Windows and py2app does it on Mac (they just make it automatic). 

People find Linux more difficult to distribute binary apps on because
they try to follow the typical Linux pattern for distributing packages
versus using the one used elsewhere.  For binaries this doesn't work
very well.  


cliff at develix.com
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and Python specialists ::

More information about the Python-list mailing list