<div dir="ltr">On Mon, Feb 25, 2013 at 9:39 AM, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">(This probably belongs in a successor to PEP 376, but I'll leave it<br>
under the PEP 426 umbrella for now)<br>
<br>
One of the points raised regarding PEP 426's integrated metadata<br>
format is the potential for runtime issues with pkg_resources as it<br>
reads and processes the metadata during startup, particularly if it<br>
needs to process any environment markers. While I acknowledge the<br>
suggestions I have received that we should really be moving away from<br>
the current filesystem based distributed installation information to a<br>
real database that properly handle import hooks, I'm looking for<br>
something simpler that will make it easier for setuptools and<br>
distribute to consume the new metadata format (and thus hopefully make<br>
them more amenable to generating it as well)<br>
<br>
Assuming we add an Entry-Points field as I have proposed in another<br>
message, I'd like to propose that installers generate three additional<br>
cache files as part of the installation process:<br>
<br>
<dist-info-dir>/__cache__/version.txt<br>
<dist-info-dir>/__cache__/requires-dist.txt<br>
<dist-info-dir>/__cache__/entry-points.txt<br>
<br>
version.txt would just be the version of the installed distribution<br>
(no need to parse the main metadata file just to read the version<br>
field)<br>
<br>
requires-dist.txt would be similar to the pkg_resources requires.txt<br>
format, but use PEP 426 version specifiers. It would:<br>
- only contain runtime requirements where the environment markers<br>
match the current system<br>
- be split into sections based on the "extras" definition needed to<br>
get the environment marker to pass<br>
<br>
entry-points.txt would be the same format as the pkg_resources entry_points.txt<br>
<br>
Cheers,<br>
Nick.</blockquote><div><br></div><div style>I like the idea of making the installer a little smarter for backwards compat. reasons. Wouldn't the specific cached files generated be the sole domain of a post-install hook provided by pkg_resources?</div>
<div style><br></div><div style>The version is not parsed from METADATA when it can be read from the .dist-info directory's filename (true when it is not in development). When it is read, METADATA is only parsed until the line that starts with Version:</div>
<div style><br></div><div style>It would be a win to evaluate the environment markers at install time. For my web applications that evaluate many .dist-info directories runtime parsing is good enough for me, but startup time pressure is higher for console scripts.</div>
</div></div></div>