[Pythonmac-SIG] python2.4, bdist_mpkg, matplotlib and data dir.

Chris Barker Chris.Barker at noaa.gov
Fri Jun 17 21:39:47 CEST 2005


Thanks for being so responsive, Bob.

Bob Ippolito wrote:
>>but when I use bdist_mpkg, they get put in:
>>
>>/usr/local/share/share/matplotlib
>>
>>Note the double "share".
> 
> That's probably a bug, but it should probably happen with Python 2.3  
> also.  Can you reproduce there?

Actually, it seems to work fine with 2.3, for example the package I just 
sent you was built that way. It's possible I've got an older version of 
Py2App installed in 2.3 than 2.4, however. I've been selecting between 
them by doing:

python2.3 /usr/local/bin/bdist_mpkg
and
python2.4 /usr/local/bin/bdist_mpkg

so they are using the same script, but importing different Py2app modules.

on 2.3, the data's getting put inside the Framework, which sounds like 
the opposite of what you want, as the 2.3 framework is an Apple supplied 
one.

I just checked. In 2.3:

py2app.__version__ = '0.1.7'

In 2.4:
py2app.__version__ = '0.2'

I think I'll wait to update until I figure this out, no reason to break 
2.3 too!

> For framework builds of Python, bdist_mpkg currently defaults scripts  
> and data into /usr/local instead of in-framework.  This is especially  
> important for the Apple framework, but not as much for the others.

I've always had this sort of problem with Linux too. When the vendor 
supplies a package, but you add non-vendor supplied add ons, where 
should you put them? On Linux, I've generally tried to put a link inside 
/usr to somewhere inside /usr/local, so that I could integrate my add 
ons with the system stuff, without actually putting my stuff in the 
system directories. I've done this for python stuff and TeX stuff, for 
example.

Apple set this up pretty well by making site-packages a link to 
/Library...., rather than just putting it in the system directories, 
like everyone else.

perhaps bdist_mpkg could check if the Python is in a system library or 
not and put stuff in /Library somewhere if so, and inside the Framework 
if not, or does that get too messy?


> Using data_files in this manner at all is usually the wrong thing to  
> do anyway.  Python packages should really put the files they need  
> into the package, not some semi-random location on the filesystem.

You mean inside .../site-packages/matplotlib? Perhaps I'll ask John 
Hunter what his reasoning is.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer
                                     		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov


More information about the Pythonmac-SIG mailing list