[Distutils] Potential issue with multiple easy_install instances and single easy_install.pth

Phillip J. Eby pje at telecommunity.com
Mon Oct 20 05:35:13 CEST 2008

At 04:44 PM 10/19/2008 -0700, Garrett Cooper (garrcoop) wrote:
> > -----Original Message-----
> > From: Phillip J. Eby [mailto:pje at telecommunity.com]
> > Sent: Sunday, October 19, 2008 4:31 PM
> > To: Garrett Cooper (garrcoop); distutils-sig at python.org
> > Subject: Re: [Distutils] Potential issue with multiple
> > easy_install instances and single easy_install.pth
> >
> > At 07:14 PM 10/18/2008 -0700, Garrett Cooper (garrcoop) wrote:
> > >Hi Python folks,
> > >         As part of a build system I work with, my group installs
> > >multiple Python packages via source using easy_install. One
> > such issue
> > >I've seen before in the past is that when using multiple
> > easy_install
> > >instances (via multiple make jobs), the last instance that opened up
> > >easy_install.pth records its changes; the file should
> > contain entries
> > >for all packages installed by easy_install.
> >
> > easy_install doesn't support simultaneous parallel
> > installations to the same target directory, and there are no
> > plans at the moment to add that support.
> >
> > Note, however, that if you use the -m (--multi-version)
> > option, then easy_install will  not save the .pth file unless
> > there was already a default version of the target package
> > present.  However, if you begin by deleting the .pth file
> > altogether, then using -m will avoid creating or updating it.
> >
> > Of course, the downside of -m is that you will not be able to
> > access the installed packages except via setuptools-built
> > scripts or by using explicit require() calls.
>         Do you or anyone else know where would I need to look into the
>distutils source to implement this enhancement?

It's setuptools, not distutils, and the module in question is 

>I forsee using Python's
>version of flock, with possibly the use of a simple semaphore

Note that you can probably also do this in your makefile, or in a 
script wrapper around easy_install.  For that matter, you can create 
an easy_install subclass that does this, and then register it under a 
new command name and script.  See the setuptools manual for more info.

More information about the Distutils-SIG mailing list