[Distutils] PEP 376, Uninstallation and interoperability

Paul Moore p.f.moore at gmail.com
Sat Feb 16 12:49:39 CET 2013


On 16 February 2013 09:58, Chris Jerdonek <chris.jerdonek at gmail.com> wrote:
> On Sat, Feb 16, 2013 at 12:42 AM, Vinay Sajip <vinay_sajip at yahoo.co.uk> wrote:
>> Another question arises - what is to be done when directories, which are
>> meant to be deleted during uninstallation, contain files which were not put
>> there during installation of the distribution being removed? It would be useful
>> for packaging tools to inform users about the extraneous, unexpected files and
>> perhaps get confirmation before proceeding with directory deletion.
>
> Are there scenarios where it is possible to have "expected" files that
> are not created during installation but rather during the course of
> running the application (e.g. preference files or cache files of some
> sort)?  If so, for cleanup purposes, another option is to have a
> provision for specifying such "post-installation" expected files.

The obvious example is pyc/pyo files.

It would be good to cater better for "clean" uninstalls. Would it not
be easier though to simply record the directories that the installer
created (probably just in RECORD, but maybe in a separate file) and
once all the files have been deleted, delete the directories if they
are empty or prompt if there are (presumably user-created) files left?
I'd make an exception for pyc/pyo files and __pycache__ subdirectories
and ignore them in that last "is the directory empty?" check.

Paul


More information about the Distutils-SIG mailing list