PEP 376 - site-directories and site.addsitedir
Hello for PEP 376, I have one last fuzzy point. http://svn.python.org/view/peps/trunk/pep-0376.txt?view=markup The "get_egg_info" api is currently based on scanning the whole sys.path. And since sys.path can be modified by people, so the algorithm is linear and can slow down when there are a lot of paths. I have a proposal: let's restrict the search for this API to site-package directories only. (directories added with site.addsitedir) People will be able to mark add any directory (like the per-user site-package directory - http://www.python.org/dev/peps/pep-0370) This requires to add in site.py a registry to keep track of all directories added through site.addsitedir Any thoughts ? (In the meantime, I'll propose the inclusion of a sitedir list in site, in Python-ideas) ++ Tarek -- Tarek Ziadé | http://ziade.org
On Thu, 14 May 2009 12:03:21 +0200, Tarek Ziadé <ziade.tarek@gmail.com> wrote:
I have a proposal: let's restrict the search for this API to site-package directories only. (directories added with site.addsitedir)
People will be able to mark add any directory (like the per-user site-package directory - http://www.python.org/dev/peps/pep-0370)
To me... it sounds like a good idea... but needs a little refining. Let me clarify the three type of packages in any python system: 1) Project Packages (needed by projects - ie subdirectories/eggs) 2) User Packages ( introduced python 2.6 windows version) 3) Site-Packages ( /lib/site-packages) Anything else.... is really lost or just misplaced. If we think of all packages in these three divisions, it will give us more clarity in providing what users are inevitably after.
This requires to add in site.py a registry to keep track of all directories added through site.addsitedir
There's no need for this... given that all the mechanisms for tracking packages already exist. But only knights of the old code know where it all is and how it works.... David
participants (2)
-
David Lyon
-
Tarek Ziadé