[Python-Dev] pkgutil, pkg_resource and Python 3.0 name space packages

Barry Warsaw barry at python.org
Mon Jan 7 17:24:06 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Jan 7, 2008, at 10:12 AM, Guido van Rossum wrote:

> On Jan 7, 2008 6:32 AM, Barry Warsaw <barry at python.org> wrote:
>> On Jan 7, 2008, at 9:01 AM, M.-A. Lemburg wrote:
>>> We could easily resolve that issue, if we add a per-user site- 
>>> packages
>>> dir to sys.path in site.py (this is already done for Macs).
>>
>> +1.  I've advocated that for years.
>
> I'm not sure what this buys given that you can do this using
> PYTHONPATH anyway, but because of that I also can't be against it. +0
> from me. Patches for 2.6 gratefully accepted.

I think it's PEP-worthy too, just so that the semantics get nailed  
down.  Here's a strawman proto-quasi-pre-PEP.

Python automatically adds ~/.python/site-packages to sys.path; this is  
added /before/ the system site-packages file.  An open question is  
whether it needs to go at the front of the list.  It should definitely  
be searched before the system site-packages.

Python treats ~/.python/site-packages the same as the system site- 
packages, w.r.t. .pth files, etc.

Open question: should we add yet another environment variable to  
control this?  It's pretty typical for apps to expose such a thing so  
that the base directory (e.g. ~/.python) can be moved.

I think that's all that's needed.  It would make playing with  
easy_install/setuptools nicer to have this.

- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iQCVAwUBR4JSJ3EjvBPtnXfVAQIXfgP9HCi8PNwUbPTbeaf7JPHLTkguYwUAyLH2
vD31w76fnh3pChIZSY9CtP51qRmB22DChSQxaagLmnl9FXjdS1dmXOu7oT7lfj2z
avTptyJ2MB8kFuGLK2In/mjbWxPUgAd19sbm4jtE5b3nauOBVyZh23TxFvH5uRdD
bUaqRNib3vE=
=P3p4
-----END PGP SIGNATURE-----


More information about the Python-Dev mailing list