[Distutils] PEP 376, Uninstallation and interoperability

Nick Coghlan ncoghlan at gmail.com
Sat Feb 16 14:23:12 CET 2013


On Sat, Feb 16, 2013 at 10:57 PM, Eric V. Smith <eric at trueblade.com> 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.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Distutils-SIG mailing list