classification
Title: Add a vendor-packages directory for system-supplied modules
Type: enhancement Stage:
Components: Distutils2, Library (Lib) Versions: Python 3.3
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: tarek Nosy List: ajaksu2, alexis, barry, brett.cannon, carljm, dhduvall, doko, eric.araujo, loewis, richburridge, tarek, terry.reedy
Priority: normal Keywords: patch

Created on 2005-09-22 15:12 by richburridge, last changed 2011-11-15 01:34 by terry.reedy.

Files
File name Uploaded Description Edit
Python-01-vendor-packages.diff richburridge, 2005-09-22 15:12 Patch to add "vendor-packages" to the Python search list for packages.
vps.diff dhduvall, 2011-05-19 16:54
Messages (10)
msg48758 - (view) Author: Rich Burridge (richburridge) Date: 2005-09-22 15:12
Python needs a .../python2.x.y/vendor-packages directory
for vendor supplied Python files.

See:

http://mail.python.org/pipermail/python-list/2005-September/300029.html

for the full reasoning behind this request.

I also approached Guido w.r.t. this. Here's his reply.

Subject: Re: Python vendor-packages directory in a
future Python release?
Date: Tue, 20 Sep 2005 19:48:40 -0700
From: Guido van Rossum <guido at python.org>
Reply-To: Guido van Rossum <guido at python.org>
To: Rich Burridge <Rich.Burridge at Sun.COM>
References: <4330C108.4030100@sun.com>

I think that's a reasonable request. (In the mean time,
I think that
using site-packages is fine as an interim solution.)

I suggest that you use the SourceForge patch manager
for the Python
project to upload your patch, and then post to
python-dev. You may be
asked to review 5 other patches in order to have
someone look at your
favorite patch.

--Guido
msg48759 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2005-09-23 23:49
Logged In: YES 
user_id=593130

The reason for this patch given in the referred-to post is:

"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". "

where 'this directory' is site-packages, which works fine.

The python-dev thread subequent to this posting starts with
http://mail.python.org/pipermail/python-dev/2005-
September/056682.html
A subsequent post
http://mail.python.org/pipermail/python-dev/2005-
September/056696.html
clarifies that 'vendor supplied packages' here means packages 
installed by the system/OS vendor.

Disconnected (in the pipermail archives) pieces of the thread 
start here
http://mail.python.org/pipermail/python-dev/2005-
September/056697.html
and here
http://mail.python.org/pipermail/python-dev/2005-
September/056702.html

This last suggests that this proposal is on hold while a .pth 
solution is explored.




msg48760 - (view) Author: Rich Burridge (richburridge) Date: 2005-09-29 14:47
Logged In: YES 
user_id=511506

A good alternative solution to this problem was given on the
python-devel
mailing list. See:

 
http://mail.python.org/pipermail/python-dev/2005-September/056697.html

 
http://mail.python.org/pipermail/python-dev/2005-September/056699.html

The architectural commitee have approved this solution, so
I'm closing
this bug as "Invalid". If there'd been a "Withdrawn"
resolution, I'd have
closed it that way instead. Perhaps that's what Deleted is
supposed to
do. Feel free to tweak if I've selected the wrong closure.
msg48761 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-11-29 21:05
Guido van Rossum suggests a vendor-packages directory in

http://mail.python.org/pipermail/python-dev/2006-November/070063.html

I'm reopening the patch to encourage further review.
msg83873 - (view) Author: Daniel Diniz (ajaksu2) Date: 2009-03-20 22:30
Should be considered for 3.1 and 2.7.
msg113370 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-08-09 03:55
"Further review" never happened. Should be close this?
msg136314 - (view) Author: Danek Duvall (dhduvall) Date: 2011-05-19 16:54
So this has come up again within the Solaris group.  Since Rich's original request, we've been using a vendor-packages.pth file in the site-packages directory, which enables the vendor-packages directory.  However, I have a concern that this would completely disappear when Py_NoSiteFlag is enabled.  I would like to run the interpreter with -SE on all system-provided scripts, so that modules installed by the user in a private PYTHONPATH or in site-packages via easy_install (or similar) don't inadvertently interpose on system-provided modules which are the ones we've tested against.

I'm attaching a patch (against 2.6.4; sorry, haven't looked at anything newer yet) that modifies pythonrun.c to add initvendor() as a parallel with initmain() and initsite(), and is always run, regardless of Py_NoSiteFlag, but inserts vendor-packages after site-packages for when the user or a script is okay with the potential interposition.

If support for vendor-packages is being considered in general, I'd like to address the request for a rationale that has been brought up a handful of times before.  Specifically, distro vendors (such as ourselves) want to be able to deliver non-core python modules -- some written ourselves, some available from the community at large.  If we do that in the canonical site-packages directory, then those modules are at risk of being overwritten by local administrators installing python packages as they normally would.  This means that system programs -- including critical ones on Solaris, such as the packaging system -- might suddenly stop working.  If we separate the vendor space from the end-user space, then local admins can do anything they want without fear of breaking the system.  And if they really want to replace the vendor-supplied modules, then they can either go to the lengths of making the modules install in vendor-packages, or build using the same mechanisms we do (which for almost all the python we ship are still open-source) and install the resulting (system, not python) package.

I'd love feedback on my patch, regardless.
msg136651 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-05-23 14:48
Thanks for detailing the rationale.  Separating the “vendor”-controlled space (or let’s call it system; not all OSes have vendors :) from the sysadmin-controlled location is indeed a real concern, as shown by the recent-ish dist-packages invention by doko for Debian.  Maybe you could get more feedback from other Python packagers on the distutils-sig, python-dev or distributions@freedesktop.org mailing list?
msg147608 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-11-14 16:47
> not all OSes have vendors
I realized that because French is my native language, I interpret “vendor” as “seller” (the meaning of “vendeur”), but I think that in English it just means “distributor” and has no relation with selling.  vendor-packages is arguably better that system-packages, as system can actually mean a lot of things.
msg147650 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2011-11-15 01:34
In English also, to vend is to sell, direct from Fr. *vendre*. However, ideas are not necessarily sold for money, but for assent, adoption, or other action. My dictionary has 'publish' as a secondary meaning of vend. So 'vendor-packages' is fine within the common metaphorical meaning of selling ideas. And it rolls off the tongue better than 'publisher-packages' or 'distributor-packages'.
History
Date User Action Args
2011-11-15 01:34:20terry.reedysetmessages: + msg147650
2011-11-14 16:47:16eric.araujosetmessages: + msg147608
2011-05-23 14:48:21eric.araujosettitle: vendor-packages directory. -> Add a vendor-packages directory for system-supplied modules
nosy: + carljm, barry, brett.cannon, eric.araujo, alexis, doko

messages: + msg136651

versions: + Python 3.3, - Python 3.2
components: + Distutils2
2011-05-19 16:54:25dhduvallsetfiles: + vps.diff
nosy: + dhduvall
messages: + msg136314

2010-08-09 03:55:07terry.reedysetmessages: + msg113370
versions: + Python 3.2, - Python 3.1, Python 2.7
2009-04-05 14:32:21georg.brandlsetassignee: tarek

nosy: + tarek
2009-03-20 22:30:24ajaksu2setversions: + Python 3.1, Python 2.7, - Python 2.4
nosy: + ajaksu2

messages: + msg83873

type: enhancement
2005-09-22 15:12:42richburridgecreate