
On Fri, Jan 30, 2009 at 10:28 AM, David Cournapeau <david@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. And if you know how to uninstall a package, it's the basis of a meta-uninstaller.
- 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.
Only the last point is worth considering at the distutils level - the two others are specific to setuptools (or more exactly any system on top of distutils). Once those decisions are made, we can make decision on how to deal with uninstall.
For example, if uninstalling only packages installed in some blessed locations is acceptable, the problem of a global registry of some kind becomes much easier to deal with.
the "blessed locations" are already known. For instance, if you take a look at the patch I am working on here (http://bugs.python.org/issue4908) we are able to find the packages and their egg-link file/folders (so any record of installation if it's kept in the egg-info) this code is still incomplete, I am waiting for PJE feedback to add the support for zip files that contains several .egg folders or zip files. But the current version is able to find a package and its metadata. notice that there are probably some edge cases we need to address I believe (setuptools too) like sys.meta_path and sys.path_hooks support.
I also wonder whether we should add uninstall feature to distutils itself from a UI POV. [cut] Having a separate program would enable asking questions and co - which is not something I would be pleased to see in the python setup.py dance,
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. I think this is why we have several kinds of tools to answer to these problems slighlty differenlty at the moment. But if we can reach a consensus on the install/uninstall part and have something for it in Python, it's a good step forward imho. I have added a question in the survey about uninstallation. and this thread could be a good starting point for providing more infos to the people to answer that question (eg what could be possible.?) Cheers Tarek -- Tarek Ziadé | Association AfPy | www.afpy.org Blog FR | http://programmation-python.org Blog EN | http://tarekziade.wordpress.com/