[Distutils] What is needed by an uninstall command to be useful ?
david at ar.media.kyoto-u.ac.jp
Tue Jun 17 07:01:39 CEST 2008
Ignacio Vazquez-Abrams wrote:
> On Tue, 2008-06-17 at 00:33 +0900, David Cournapeau wrote:
>> An uninstall command is a long-time wanted feature of distutils. I
>> was wondering why it was not implemented: what does it need to do to be
>> useful ? AFAIK, make uninstall in autotools simply removes currently
>> installed files, with currently refering to the current configured value
>> of prefix and all. Isn't this enough (I am interested in a 'pure'
>> distutils command, not a setuptools one) ? What would be the minimum
>> semantics needed for an uninstall command ?
> One of the big differences between autotools and distutils is that in
> autotools the destination path is set at *build* time (ignoring the
> not-often directly-used DESTDIR make variable, of course), but in
> distutils/setuptools the destination path is set at *install* time.
Yes, that's actually one of the thing I really don't like about
distutils (the way options are handled), but there is nothing we can do
about that in the short term.
I think it would be possible to record the last install directories into
the build directory of distutils, such as by default, it will remove the
last installed package ? There is no question that an uninstall command
will not be good for all cases; but here are some of the scenario I am
- install run uninstall before install (if uninstall info found in
build): avoiding people having problems when re-installing a package
without removing it first (that's my first priority, actually, but I am
willing to handle other cases, of course)
- uninstall a package a user does not want anymore.
> Having said that, yes, it could potentially be done so that it takes the
> same argument as install for overriding the root, but I get the distinct
> feeling that people are going to forget to specify the root on uninstall
> quite often, thereby removing the module installed in the system
> location instead.
Well, there is not much you can do about that. On unix, people do not
install in system location, I hope. On windows, most people install in
the default location, no ? The ones who don't should be able to pass the
uninstall command, normally.
If we have a reliable mechanism to remove the last installed package, I
think we would mostly alleviate this problem (which concern people who
do not tweak much; for people who want to install in non default
location, I would expect them to handle this issue by themselves ?)
More information about the Distutils-SIG