[Distutils] Uninstall command, the return

David Cournapeau david at ar.media.kyoto-u.ac.jp
Fri Jan 30 12:21:56 CET 2009


Tarek Ziadé wrote:
> On Fri, Jan 30, 2009 at 10:28 AM, David Cournapeau
> <david at ar.media.kyoto-u.ac.jp> wrote:
>   
>> I can see several things which have a big impact on an uninstall feature
>> design:
>>    - how to handle multiple versions of one package ?
>>    - should it handle dependencies ?
>>     
>
> from a distutils point of view, none of these features exist. My opinion
> is that  the multiple version and the dependencies matters should be
> treated separately,
> because the atomic part is the package.
>   

agreed

> And if you know how to uninstall a package, it's the basis of a
> meta-uninstaller.
>   

Not necessarily: many package systems simply do not deal at all with
multiple versions. This really complicates the matter a lot right away
whether that's something which needs to be supported, even if it is not
supported by the tool itself. IOW, ignoring the problem in distutils may
well render any multiple version handling impossible for tools build on
top of distutils.

>>    - should it work for packages installed anywhere, or only for a few
>> reserved places ?
>>     
>
> It should work for any package installed. Wherever it's installed. If
> it's in the path and usable in Python,
> it should be removable.
>   

Again, that's a major complication - so if it is required, it should
really be weight against the implementation and reliability cost.

For example, I am somewhat familiar with the following systems used for
deployment: autoconf-based, .deb based, .net based, stow-based, windows
Side by side, globac assembly cache (GAC, the .net stuff). AFAIK, not a
single one supports both multiple versions deployment and arbitrary
installation location. That should at least be an indication this is not
a trivial matter.

>
> My opinion is that distutils and pkgutil should provide a set of apis to:
>
> - locate a package (see http://bugs.python.org/issue4908)
> - install / uninstall a package
>
> Then two simple basics commands could be offered in Python executable scripts.
>
> >From there any third party app could have fun adding a better UI
>
> But my point is that the logic behind install/uninstall should be
> unique and clearly defined
> and in one and only one place (e.g. Python) to avoid having many
> different ways to deal with
> those problems.
>   

100 % agreed. My remark was just that uninstalling may require asking
some questions to the user depending on the system state, so a distutils
uninstall command at the UI level may not be advisable . Of course, the
actual implementation for uninstalling should be done in distutils
itself, with a *documented* API so that other tools can be built on top
of it.

David




More information about the Distutils-SIG mailing list