[Distutils] Distribute and zc.buildout + bootstraping file names + release/branches roadmap

Tarek Ziadé ziade.tarek at gmail.com
Thu Aug 6 10:10:28 CEST 2009


On Thu, Aug 6, 2009 at 9:53 AM, Lennart Regebro<regebro at gmail.com> wrote:
> 2009/8/6 Tarek Ziadé <ziade.tarek at gmail.com>:
>> On Thu, Aug 6, 2009 at 9:24 AM, Lennart Regebro<regebro at gmail.com> wrote:
>>> 2009/8/6 Tarek Ziadé <ziade.tarek at gmail.com>:
>>>> Yes it's needed. Even if some people switch to Distribute in their
>>>> projects, as soon as you install
>>>> a project that is still on Setuptools, it will overwrite Distribute
>>>> files with no warning.
>>>
>>> But wait... if you install distribute, and you then install a project
>>> that depends on setuptools, you say it will be installed.
>>
>> no, it will be faked. meaning that just the PKG-INFO will be presented,
>> thus detected by pkg_resources. But at the end the setuptools *package*,
>> the pkg_resources.py and site.py files will be the one installed by <distribute>.
>
> I'm confused. You said that if a project is still on setuptools it
> will overwrite distribute. Now you said it wouldn't.
>

No I didn't say that. Let me re-explain (also this is explained in
DIstrbute readme) :

A - An installed distribution of "Distribute" 0.6 is composed of :
 - the setuptools package
 - the pkg_resource module
 - the site module
 - the easy_install script
 - a PKG-INFO file specific to the project

B - An installed distribution of "Setuptools" 0.6c9 is composed of :
 - the setuptools package
 - the pkg_resource module
 - the site module
 - the easy_install script
 - a PKG-INFO file specific to the project

If you install A, then B, you are not using Distribute code, but
Setuptools, right ?
Because B is installed in the same place than A, or is reached before
A in the path.

So how does a script like pip or easy_install knows if Setuptools is installed ?

-> by looking for the PKG-INFO of the project named "Setuptools" if it
finds it, it "knows" it's installed.
and tell you "setuptools 0.6c9 is installed"

Ok so, "faking" setuptools means, setting up a PKG-INFO so
easy_install, pip, zc.buildout, etc
thinks Setuptools 0.6c9 is installed. *but not letting the setuptools
package, the pkg_resources module, etc of
the Setuptools project in the path.

If we don't fake setuptools, and just install Distribute if someone
installs setuptools again, which
is highly possible because with easy_install and pip, fields like
install_requires will install it and therefore
overwrite Distribute

If we do fake it, and if you install a project that requires
Setuptools, this requirement will be met and this package will use
Distribute code.

Of course people (as explained in the README.txt) have ways to get
back to setuptools.

at the end, this process means: "don't let a third party package chose
for you to use *globally* setuptools,
make it use Distribute without having to change this third party
package, because their APIS are perfect clones "


--
Tarek Ziadé | http://ziade.org


More information about the Distutils-SIG mailing list