On Thu, Oct 8, 2009 at 11:39 AM, Carl Meyer <[email protected]> wrote:

> 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.
>

I can imagine adding a little information, basically a log of when and why
and who installed the package.  For instance:

  agent: pip 0.5
  install-date: 2009-10-08T13:44:00UTC
  installed-for-user: False
  installed-for-package: OtherPackage==0.3

Potentially a package could have multiple records, because multiple
installers may in some sense touch a package (e.g., if you install
YetAnotherPackage that requires the same library as OtherPackage).  You
could use INI-style and maybe label each record with the date, like
[2009-10-08T13:44:00UTC].

This information seems fairly easy to generate.  Updating it after
installation would be nice, but also means already-installed packages can be
written to, which is not as nice IMHO.  Being unable to write to this file
should be a non-fatal error for an installer.

Either way, a package could become REQUIRED (or user-requested) at any time
after it is installed.  E.g.:

  easy_install Markdown
  easy_install ElementTree # which is required by MarkDown

Now ElementTree should not be considered orphaned if MarkDown is removed.

-- 
Ian Bicking  |  http://blog.ianbicking.org  |
http://topplabs.org/civichacker
_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to