[Distutils] --always-copy, development eggs

Phillip J. Eby pje at telecommunity.com
Fri Feb 23 21:31:59 CET 2007

At 02:38 PM 2/21/2007 -0600, Ian Bicking wrote:
>So, I'm trying to achieve a couple different things with workingenv, and
>I'm not sure how to make it all work...
>I don't want one workingenv to have unintentional links to package in
>another environment.  Sometimes easy_install will find a package
>somewhere else on the system, which is fine, but I want it to copy it
>into the workingenv.

I think the problem is that you haven't sufficiently specified what you 
mean by "copy it into the workingenv".  For example, do you want to install 
a snapshot by creating an egg, or do you want to copy an .egg-link file?

For the use case --always-copy was created for, the former is what's 
desired, and it may someday implement that by running the setup.py.  The 
problem is that right now there's no way to know for sure *which* setup.py 
created the development egg.

One can certainly *guess* that the first setup.py found in the same or a 
higher-level directory than that containing the .egg-info is the correct 
one, but it may not always be the case.  Some packages have a separate 
setup.py (that's not *named* setup.py) that would need to be used.

I could put something in the .egg-info directory, but it would need to 
*not* be installed by system packaging tools, because then it would no 
longer be pointing to the right place.  So, if I were to store a link to 
the setup.py, it would need to be stored in the .egg-link file itself, 
where easy_install could potentially get to it.

As an experiment, I just tried changing the way "develop" and package_index 
work so that setup scripts can be found automatically, and the appropriate 
bdist_egg step run.  It seems to work okay, except that I'm not sure if we 
really *want* development eggs to be automatically snapshotted like this, 
without including some sort of extra "local builds okay" flag.

So, the trunk and 0.6 branch now include a --local-snapshots-ok flag you 
can use to enable this behavior.  I don't know if it's exactly what you're 
looking for, but it at least provides you with one way of handling it.

More information about the Distutils-SIG mailing list