On Sat, Feb 16, 2013 at 8:23 AM, Nick Coghlan <[email protected]> wrote:
> On Sat, Feb 16, 2013 at 10:57 PM, Eric V. Smith <[email protected]> > wrote: > > On 2/16/2013 7:40 AM, Vinay Sajip wrote: > >> With my suggestion about keeping a list of shared locations around, then > >> namespace package directories could be kept in such a list. When > uninstalling, > >> all the subpackages added in the particular distribution being > uninstalled would > >> be removed, but the namespace package directory itself wouldn't be, as > a shared > >> location. > > > > I don't think the installers know which directories are namespace > > package directories. > > If you limit it to PEP 420 namespaces, then package directories > without an __init__.py file are namespace packages. (I expect in the > long run they will actually become more common than the self-contained > package directory case). > > However, that particular objection goes away if you silently leave > directories containing unregistered files (other than __pycache__) > alone on uninstall. With that limitation, Vinay's original idea should > work pretty well. > > If a package leaves unregistered files around without mentioning them > in RECORD, that would then typically either be a bug in the package > rather than the uninstall tools or the fault of a user leaving an > editor backup file lying around by editing installed files. > > A "clean" command could then just scan the *standard* sysconfig > directories looking for unregistered files, and give people the option > of deleting them. > > The shared directories + unregistered files problem is a tricky one, > and even OS installers don't handle it very well. However, Vinay's > idea would be a solid improvement on the status quo, even without > trying to solve that particular detail. > Wanted to chime in that due to wheel's PEP nature, the pip wheel branch ( https://github.com/qwcode/pip) also includes an implementation of uninstall-from-RECORD. Pip seeks out and destroys .pyc files on uninstall without needing them in RECORD since they can pop up in un^H^Hexpected places whenever a new version of Python is run. We also follow the simple rule "paths in RECORD are always relative to site-packages, unless a relative path is not possible on the OS". IIRC pip also has rules about deleting empty directories but I'm not quite sure how they are handled.
_______________________________________________ Distutils-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/distutils-sig
