[Distutils] PEP 345, PEP 376, PEP 386

Brian Sutherland brian at vanguardistas.net
Thu Jun 4 15:23:14 CEST 2009

2009/6/4 Tarek Ziadé <ziade.tarek at gmail.com>:
> Paul
>> I'd say that it's distutils' responsibility not to offer to uninstall
>> anything it didn't install.
> Brian
>> Yep. Though I think that nowdays dpkg installs to a different directory than
>> Distutils' default. So users have to specify extra options to break
>> their systems.
> But how does those third-party install the projects ?
> Don't they use Distutils' install command under the hood ?

Yes, most debian packages do, during the build process.

However, the actual install/uninstall on the user's machine is handled by dpkg
(which maintains it's own database of installed files).

> If so, the new PEP 376 APIs are ignoring previous versions of
> egg-infos and work only with the ones that complies with the new
> standard (it's a quick control right now,  look at the "is_egg_info"
> API in http://bitbucket.org/tarek/pep376/src/tip/pkgutil.py)
> So, in any case the uninstall command will not work with project that
> are filtered out by is_egg_info().
> So maybe we could add a "INSTALLER" file with a unique md5 key
> provided by the project that installed the package,
> and ask for the key when calling this API ? If not provided, it would
> use Distutils's md5 key

So, with setuptools I was running this while building a package:

    python2.X setup,py install --single-version-externally-managed
--root=debian/$(package) --install-data=usr/lib/$(package)

So, now I would need to run this:

    python2.X setup,py install --root=debian/$(package)
--install-data=usr/lib/$(package) --installer

And that would cause distutils to refuse to uninstall that package by default?

> Tarek

More information about the Distutils-SIG mailing list