[Distutils] Some clarifications and/or corrections to PEP 376

Paul Moore p.f.moore at gmail.com
Mon Jan 7 16:33:24 CET 2013

On 7 January 2013 14:40, Vinay Sajip <vinay_sajip at yahoo.co.uk> wrote:
> Jeroen Dekkers <jeroen <at> dekkers.ch> writes:
>> We can specify that paths in RECORDS can be relative to the parent
>> directory of the .dist-info directory or absolute and both must be
>> supported by installation tools. Whether relative or absolute paths
>> are used is decided by the tool that creates/modifies the RECORDS
>> file.
>> That seems easy enough to implement, while flexible enough to support
>> the different use cases.
> Yes, and I've now implemented this in distlib. Tests are still to be added to
> cover all cases, but I am now able to upgrade / uninstall pip-installed dists,
> which seems promising.

OK, that sounds like a good approach then. It might be worth noting
that relative paths are to be preferred wherever sensible (but that's
a recommendation only, not a requirement). But as I noted at the start
of this thread, it is *not* what PEP 376 states at present. Do we need
an update to the PEP if that is to become the "de facto" standard?

Also, the first question I posed in my initial posting in this thread
appears to remain unanswered:

1. The dist-info directory for a distribution is stated as being
"located in the site-packages directory".

It's not clear how this is intended to work in a PEP 370 world with
multiple site-packages. What I propose is that the description be
changed to be worded in terms of sysconfig-style locations: the
dist-info directory is located in whichever of purelib or platlib is
used by the distribution. When the distribution uses both, purelib is
preferred, when it uses neither (!) purelib is used. In nearly all
cases, this is the same as currently. The exceptions are posix_home
(where the directory name isn't "site-packages" but its function is
the same), posix_prefix (where purelib and platlib differ, and PEP 376
is currently ambiguous as to which is implied), and any custom schemes
that might be created (where PEP 376 is silent, and this proposal has
the benefit of at least being specific). I do not believe this changes
any actual practice - as far as I have been able to determine any code
using dist-info at the moment follows this proposal in the corner
cases where it differs from PEP 376.


More information about the Distutils-SIG mailing list