[Distutils] patch: solving the two major things that people dislike about setuptools, part 1

zooko zooko at zooko.com
Tue Nov 25 21:29:09 CET 2008

On Nov 24, 2008, at 15:46 PM, Mark Sienkiewicz wrote:
> We can eliminate __egginsert from the code entirely.  As far as I  
> can tell, the *only* purpose of __egginsert is to permit the  
> incorrect behaviour that your patch is intended to fix.

There are two separable concerns here:

1.  Should the act of "easy_install foodistribution" cause subsequent  
"python -c 'import foomodule'" to get the new, easy-installed foo,  
instead of the pre-existing, distutils-installed foo which is in the  
system directory?

2.  Should the act of "PYTHONPATH=./my-custom-foo" cause subsequent  
"python -c 'import foomodule'" to get the foo in ./my-custom-foo  
instead of the easy-installed foo?

PJE has already made clear (see references on the ticket that I filed  
or in my earlier mail) that he wants the answer to 1 to be "yes",  
because he is supporting a common use case in which a user doesn't  
know how to uninstall the old foo but wants to use easy_install to  
get a new foo.

(I personally am kind of ambivalent about #1, but I have no users  
asking for it to be different so I'm happy to go along with PJE on  

Issue #2 is actually the one that so many people hate about  
setuptools, including many of my current and prospective users, and  
apparently included you, Mark Sienkiewicz.

I think it is consistent to answer "yes" to both questions, because  
in each case the user has expressed intent -- by saying "easy_install  
foo", you can legitimately be understood as meaning "...and make the  
one I get over-ride any other ones that might already be here.".   
Likewise by saying "PYTHONPATH=./my-custom-foo", you are certainly  
saying "... and make the one I just named override any others".   
Indeed, the Python docs clearly state that Python will respect that  
statement of yours:


which says: "The PYTHONPATH variable can be set to a list of paths  
that will be added to the beginning of sys.path.".

My patch is intended to make the answer to #2 be "yes" from now on,  
while preserving the current behavior of the answer to #1 being "yes".


http://allmydata.org -- Tahoe, the Least-Authority Filesystem
http://allmydata.com -- back up all your files for $10/month

More information about the Distutils-SIG mailing list