vendor-packages directory

Rich Burridge Rich.Burridge at Sun.COM
Tue Sep 20 17:22:34 CEST 2005


Hi,

I work in the Accessibility Program Office at Sun Microsystems. I'm
part of a team that is using Python to create a screen reader called
Orca, that'll help blind people (and people with low vision) have
access to the GNOME desktop for Solaris and Linux.

See:

   http://cvs.gnome.org/viewcvs/*checkout*/orca/docs/doc-set/orca.html

for more details.

Orca in turn uses several packages that interface between Python and the
various "native" libraries in the GNOME desktop:

   * pyorbit       - Python bindings for ORBit2
   * pygtk         - GTK+ Python bindings
   * gnome-python  - Python bindings for various GNOME libraries

We will be presenting our project in front of one of the archirectural
review committees within Sun soon, in order to try to get this software
in a future release of the Solaris operating system. It's Open Sources,
so other Linux vendors will also be able to pick it up (if they so desire),
to include with their software distributions.

We've been given a heads-up on the following problem.

Until now we've been using "/usr/lib/python2.4/site-packages" as the
directory to install the various Python files that these packages use.

We have been told that this directory is inappropriate for vendor supplied
packages, just as "site_perl" is inappropriate for Perl. With Perl, vendor
supplied packages go under "vendor_perl". Unfortunately there isn't such an
equivalent for Python.

But it does seem appropriate that there should be.

Now we could easily create a "/usr/lib/python2.4/vendor-packages"
directory and put out files under there, but what I don't like about it
is that it doesn't "just work". In other words, it's not one of the known
places that Python will look for library or application Python files.
I don't think it's reasonable to make developers who wants to use
"standard" GNOME Python files, to have to set PYTHONPATH and make sure
that "/usr/lib/python2.4/vendor-packages" is on it.

What I'd like to see is a future release of Python automatically checking
for this directory and appending it to the list of directories that it'll
search.

Here's a patch to do this:

--- Python-2.4.1/Lib/site.py	Mon Sep 19 12:37:00 PDT 2005
+++ Python-2.4.1-new/Lib/site.py	Mon Sep 19 12:37:00 PDT 2005
@@ -182,7 +182,11 @@
                                           "lib",
                                           "python" + sys.version[:3],
                                           "site-packages"),
-                            os.path.join(prefix, "lib", "site-python")]
+                            os.path.join(prefix, "lib", "site-python"),
+                            os.path.join(prefix,
+                                         "lib",
+                                         "python" + sys.version[:3],
+                                         "vendor-packages")]
              else:
                  sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")]
              if sys.platform == 'darwin':

Is this something that would be considered for a future Python release?

Thanks.

--

Rich Burridge                       Email:     rich.burridge at Sun.COM
Sun Microsystems Inc. (MPK14-260),  Phone:     +1.650.786.5188
4150 Network Circle,                AIM/YAHOO: RicBurridge
Santa Clara, CA 95054               Blog:      http://blogs.sun.com/richb




More information about the Python-list mailing list