[Distutils] tracking requested vs dependency installs in PEP 376 metadata

Toshio Kuratomi a.badger at gmail.com
Thu Oct 8 21:15:26 CEST 2009

On Thu, Oct 08, 2009 at 12:39:33PM -0400, Carl Meyer wrote:
> Hash: SHA1
> Hey all,
> I propose adding a bit to the PEP 376 metadata that indicates whether a
> package was installed by user request or as a dependency of another
> package. This would allow (un)installer tools to intelligently remove
> orphaned dependencies, if they so choose. There might be questions about
> the details of such an uninstaller feature, but I'm not intending to
> discuss that here. The metadata itself is simple enough to track, and
> seems like it ought to be included for its future usefulness.
> I propose adding a metadata file REQUIRED within the .egg-info
> directory. The presence of this file indicates that the user
> specifically required this distribution. The absence of the file
> indicates that the distribution was installed as a dependency. The
> contents of the file are not used.
> For the API, I propose adding a "required" property to the Distribution
> class, which would be True or False based on the presence or absence of
> the REQUIRED file.
> I've added a demo implementation to a fork of Tarek's pep376 repo on
> bitbucket: http://bitbucket.org/carljm/pep376/changeset/0c8002e65cb7/
> Thoughts?
Note that Linux distributions have discussed this for ages and it's not
always as useful as a naive first thought would imply.  For instance, there
are often many scripts written by a system administrator (or a user) that
might need to have a module installed.  This is not to say that it's a bad
idea to record this information -- there could be some installers for
specific use cases might find it useful or that it could be useful with
confirmation by the user.

Also note that a package manager should be able to tell required status from
what is currently installed.  So it might make more semantic sense to record
what was requested by the user to be installed instead of what was required
by a package.  (When something is both required by a package and requested
by a user, the user request is what takes precedence.)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20091008/7bf12ee7/attachment.pgp>

More information about the Distutils-SIG mailing list