<p dir="ltr"><br>
On 3 Mar 2014 04:34, "Oscar Benjamin" <<a href="mailto:oscar.j.benjamin@gmail.com">oscar.j.benjamin@gmail.com</a>> wrote:<br>
><br>
> On 2 March 2014 07:25, Nick Coghlan <<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>> wrote:<br>
> ><br>
> > I've just posted updated versions of PEP 426 and 459 that defer the<br>
> > "metadata hooks" feature. The design and behaviour of that extension<br>
> > is still way too speculative for me to approve in its current form,<br>
> > but I also don't want to hold up the rest of the changes in metadata<br>
> > 2.0 while we thrash out the details of a hook system.<br>
><br>
> The other idea that was discussed a few times but hasn't made it into<br>
> PEP 426 is the idea of compatibility tags. These are mentioned in the<br>
> (deferred) metabuild section:<br>
> <a href="http://legacy.python.org/dev/peps/pep-0426/#metabuild-system">http://legacy.python.org/dev/peps/pep-0426/#metabuild-system</a><br>
> but nowhere else in the PEP.<br>
><br>
> I certainly understand the desire to defer dealing with something as<br>
> complex as hooks but simple string compatibility tags are a much<br>
> simpler thing to include in the metadata and could be very useful. I'm<br>
> thinking of a situation where you can indicate things like ABI<br>
> compatibility for C/Fortran compiled code (e.g. libc, gfortran vs g77)<br>
> but there could easily be many other uses once wheel takes off.</p>
<p dir="ltr">There's an issue for a "python.expect" extension on the metadata tracker (name TBD, "python.constraints" would answer work) . I'll list that as a deferred feature as well, but similar to the metadata hooks, I'd prefer to give people a chance to try out the baseline version before we lock in additional extensions.</p>

<p dir="ltr">> > That said, I still don't want us to get into a situation where someone<br>
> > later publishes a wheel file that expects metadata hook support and<br>
> > older tools silently install it without running the hooks.<br>
> ><br>
> > Accordingly, the revised PEP 426 adds a single simpler feature to the<br>
> > extensions system: the idea of a "required extension".<br>
> ><br>
> > If a project sets that flag for an extension (by including<br>
> > "required_extension": true in the extension metadata), and an<br>
> > installation tool doesn't understand it, then the tool is required to<br>
> > either fail the installation attempt entirely or else fall back to<br>
> > installing from source.<br>
> ><br>
> > That way, project authors will be able to distinguish between "these<br>
> > metadata hooks are just an optimisation, things will still work if you<br>
> > don't run them" and "if you don't run these hooks, your installation<br>
> > will be broken".<br>
><br>
> Is there some need for metadata extensions to be optional by default?</p>
<p dir="ltr">Yes, it's because I expect most extensions to be along the lines of the standard ones, providing additional info for developers and tools *other than* the installer. "If you can't process this extension, don't install the software" should be relatively rare.</p>

<p dir="ltr">> > I think this approach may also encourage a design where projects do<br>
> > something sensible *by default* (e.g. NumPy defaulting to SSE2) and<br>
> > then use the (not yet defined) post-installation hooks to potentially<br>
> > *change away* from the default to something more optimised for that<br>
> > particular system (e.g. NumPy overwriting itself with an SSE3<br>
> > version), while still *allowing* developers to refuse to let the<br>
> > software install if the metadata hooks won't be run.<br>
><br>
> I'm not sure but there does seem to be some discussion and movement<br>
> toward the idea of numpy distributing openblas binaries (which would<br>
> solve the SSE problem). See the threads starting here for more:<br>
> <a href="http://mail.scipy.org/pipermail/numpy-discussion/2014-February/069186.html">http://mail.scipy.org/pipermail/numpy-discussion/2014-February/069186.html</a><br>
> <a href="http://mail.scipy.org/pipermail/numpy-discussion/2014-February/069106.html">http://mail.scipy.org/pipermail/numpy-discussion/2014-February/069106.html</a><br>
><br>
> (Note that shipping openblas binaries does not solve the ABI mismatch<br>
> problems that compatibility tags could address).</p>
<p dir="ltr">So long as NumPy defines and publishes an extension with the relevant details in its metadata, the metadata constraints extension would eventually be able to automate consistency checks.</p>
<p dir="ltr">However, I'm starting to think you may be right and it will be worth having that defined from the beginning, specifically to help ensure we keep the NumPy dependent wheels on PyPI consistent with each other.</p>

<p dir="ltr">Cheers,<br>
Nick.</p>
<p dir="ltr">><br>
><br>
> Oscar<br>
</p>