Hey folks,

I'm looking for advice, and maybe even some consensus among the
MacPython community, on how to build and distribute packages with
non-python dependencies.

As we all know, a number of Python packages require libs that are used
outside of python itself. These libs fall into (sort of) what I would
call two catagories;

1) general purpose libs used by multiple python packages: libpng, freetype, etc.
 (I'm still confused on why Apple doesn't provide all these --
particularly libpng -- what's up with that?)

2) More specific libs, likely only used by a single python package --
netcdf, proj.4, etc.

Users also fall into two categories:

1) Folks that do Python development on OS-X much like Linux, etc --
these folks are likely to use macports or homebrew, or are used to the
.configure, make, make install dance. We don't need to do anything to
support these folks -- "pip install" generally works for them.

2) folks that want to use a Mac like a Mac, and people that develop
for those folks --  these people need binary installers, and may want
to be able to use and deploy either packages or applications (Py2app)
that will run on systems older than the one developed on, or want
universal builds, or ???
  - These are the folks I'd like to support, but I'm still unsure as
to how best to do that.

Way back when Bob Ippolito maintained a repository of binary packages
for the mac -- it was a great resource, but he's long since moved on
to other things.

We kind of get away with it because a number of major package
maintainers have done a good job of providing binaries themselves
(wxPython, numpy/scipy/matplotlib), but others fail to do so (PIL).
Plus some of us have minor packages that we want to distribute.

I'd like to put together an archive, much like Bob's was, or like
Christoph Gohlke's one for Windows
(By the way -- that one is HUGE -- I have no idea how he keeps it up!
http://www.lfd.uci.edu/~gohlke/pythonlibs/)

But with or without that archive, I still need to build the darn
things. So now on to the question:

How should the dependencies be distributed?

1) They should be built to match the Python binary being targeted
(honestly, I think that's now only the Intel 32-64 bit ones -- PPC
machines, and pre 10.6, are getting really rare...)

2) Static or dynamic?

IIUC, most successful binary packages for the Mac have relied on
statically linking the dependencies -- this works, and is pretty
robust. However, it can be kind of a pain to do (though I've finally
figure how to do it more reliably!). Also, it seems like a waste to me
for packages that use common dependencies -- how many copies of libpng
do I really want linked into my single instance of Python at run time?

But if dynamic, where do you put them? We'll still want to ship them
with the binary, so people have a one-click install. I don't think we
want to install them into a standard location, like /usr/local, as
that could stomp on something else the user is doing. So:
 - Do we put the in the Python Framework, say in:
/Library/Frameworks/Python.framework/Versions/2.7/lib
     - This make some sense, but then you couldn't share them between,
say, python 2.7 and 3.3 (and however many other versions...
  - Do we create a new Framework, say:
/Library/Frameworks/PythonDeps.framework and put them all there? But
this may confuse things for different deployment targets.

If we go one of these routes, would we have a separate installer for
the libs, and all the other installers would depend on that? Or would
each installer put a copy of the libs it needed into the common
location, maybe writing over one that's already there (which should be
OK -- it should be compatible, or have a different version number,
etc.)

Note that I've used the term "we" here ;-)  I'm hoping that others
will join me in following a convention and getting stuff out there,
but even if not, I'd love feedback on how best to do it.

By the way, the other goal is to build scripts that do the builds the
way we need for various libs, packages, etc, so that it's easy to do
it all when new builds are required...
(maybe use gattai? -- http://sourceforge.net/projects/gattai/)

Feedback please!!

-Chris

-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

chris.bar...@noaa.gov
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG

Reply via email to