[Distutils] PEP 426: proposed metadata caching convention

Paul Moore p.f.moore at gmail.com
Mon Feb 25 15:45:25 CET 2013


On 25 February 2013 14:39, Nick Coghlan <ncoghlan at gmail.com> wrote:
> (This probably belongs in a successor to PEP 376, but I'll leave it
> under the PEP 426 umbrella for now)
>
> One of the points raised regarding PEP 426's integrated metadata
> format is the potential for runtime issues with pkg_resources as it
> reads and processes the metadata during startup, particularly if it
> needs to process any environment markers. While I acknowledge the
> suggestions I have received that we should really be moving away from
> the current filesystem based distributed installation information to a
> real database that properly handle import hooks, I'm looking for
> something simpler that will make it easier for setuptools and
> distribute to consume the new metadata format (and thus hopefully make
> them more amenable to generating it as well)
>
> Assuming we add an Entry-Points field as I have proposed in another
> message, I'd like to propose that installers generate three additional
> cache files as part of the installation process:
>
>     <dist-info-dir>/__cache__/version.txt
>     <dist-info-dir>/__cache__/requires-dist.txt
>     <dist-info-dir>/__cache__/entry-points.txt
>
> version.txt would just be the version of the installed distribution
> (no need to parse the main metadata file just to read the version
> field)
>
> requires-dist.txt would be similar to the pkg_resources requires.txt
> format, but use PEP 426 version specifiers. It would:
> - only contain runtime requirements where the environment markers
> match the current system
> - be split into sections based on the "extras" definition needed to
> get the environment marker to pass
>
> entry-points.txt would be the same format as the pkg_resources entry_points.txt

Why a __cache__ subdirectory? Is this purely an easier-to-process copy
of what's in the METADATA file? If so, I'd prefer to simply take the
information out of the METADATA file and have it in a single separate
file in the first place. IIUC, that's what Daniel is suggesting as
well.

We don't really need everything to be in a single file, surely?

Paul.


More information about the Distutils-SIG mailing list