[Pythonmac-SIG] sys.path for MacPython 2.3 - next set of questions

Jack Jansen Jack.Jansen@oratrix.com
Tue, 15 Apr 2003 23:23:01 +0200


On zondag, apr 13, 2003, at 14:04 Europe/Amsterdam, Chris Barker wrote:
>> I'm going to punt on /Library/Python for now. It doesn't offer any new
>> functionality
>> over $prefix/lib/python2.3/site-packages,
>
> woah! I may be missing something, but if I understand this correctly,
> apart from my last point (minor) it sounds like you are planning on
> putting site-packages in the users directory by default?

No, it's going to be "in addition". I think it's going to be first
$prefix/lib/python2.3/site-packages, then 
~/Library/Python/2.3/site-packages.
The standard Pythonic rule seems to be "don't override, only extend".

>> 1. Who adds ~/Library/Python/2.3/site-packages to sys.path, and when?
>
> What is the harm to having it always there, even if it doesn't exist
> and/or has nothing in it?

Turns out it doesn't matter: site.py will remove it if it doesn't exist.

>> 2. Who creates ~/Library/Python/2.3/site-packages, and when?
>
>> where
>> admin user A has installed Python, and normal user B starts using it
>> and wants to
>> install her own extension modules.
>
> This may be out of our control, but shouldn't distutils do it in that
> case? And if not disutils, then the user needs to vreate the directory
> by hand.

After some thought I'm not going to muck with distutils, I'm going to 
do it
in Package Manager. It will call setup.py with the right arguments to 
deposit
things in the right location. People using pimp (the tool underlying
Package Manager) from the command line can specify the directory by 
hand.

Package Manager is going to get a radio button for "Install 
system-wide"/
"For current user only" (can anyone think of two nice short labels for 
this?),
and system-wide is going to be disabled if you don't have write-access 
to
$prefix/lib/python2.3/site-packages. If you install for yourself only 
and
this results in reduced functionality for the package you will get a 
warning.
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma 
Goldman -