<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 14, 2017 at 12:15 PM, Nathaniel Smith <span dir="ltr"><<a href="mailto:njs@pobox.com" target="_blank">njs@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Tue, Feb 14, 2017 at 10:10 AM, Vinay Sajip via Distutils-SIG<br>
<<a href="mailto:distutils-sig@python.org">distutils-sig@python.org</a>> wrote:<br>
>> humpty in term uses uses distlib which seems to mishandle wheel<br>
>> metadata. (For example, it chokes if there's extra distribution meta and<br>
>> makes it impossible for buildout to install python-dateutil from a wheel.)<br>
><br>
> I looked into the "mishandling". It's that the other tools don't adhere to<br>
> [the current state of] PEP 426 as closely as distlib does. For example,<br>
> wheel writes JSON metadata to metadata.json in the .dist-info directory,<br>
> whereas PEP 426 calls for that data to be in pydist.json. The non-JSON<br>
> metadata in the wheel (the METADATA file) does not strictly adhere to any of<br>
> the metadata PEPs 241, 314, 345 or 426 (it has a mixture of incompatible<br>
> fields).<br>
><br>
> I can change distlib to look for metadata.json, and relax the rules to be<br>
> more liberal regarding which fields to accept, but adhering to the PEP isn't<br>
> mishandling things, as I see it.<br>
<br>
</span>I thought the current status was that it's called metadata.json<br>
exactly *because* it's not standardized, and you *shouldn't* look at<br>
it?<br>
<br>
It's too bad that the JSON thing didn't work out, but I think we're<br>
better off working on better specifying the one source of truth<br>
everything already uses (METADATA) instead of bringing in *new*<br>
partially-incompatible-and-<wbr>poorly-specified formats.<br></blockquote><div><br></div><div>JSON-LD</div><div><br></div><div><a href="https://www.google.com/search?q=python+package+metadata+jsonld">https://www.google.com/search?q=python+package+metadata+jsonld</a><br></div><div><a href="https://www.google.com/search?q=">https://www.google.com/search?q=</a>"pep426jsonld"<br></div><div><br></div><div>PEP426 (Deferred)</div><div><br></div><div>Switching to a JSON compatible format</div><div><a href="https://www.python.org/dev/peps/pep-0426/#switching-to-a-json-compatible-format">https://www.python.org/dev/peps/pep-0426/#switching-to-a-json-compatible-format</a><br></div><div><br></div><div>PEP 426: Define a JSON-LD context as part of the proposal<br></div><div><a href="https://github.com/pypa/interoperability-peps/issues/31">https://github.com/pypa/interoperability-peps/issues/31</a><br></div><div><br></div><div>This doesn't work with JSON-LD 1.0:</div><div><br></div><div>```json</div><div>releases = {</div><div>  "v0.0.1": {"url": ... },</div><div>  "v1.0.0": {"url": ...},</div><div>}</div><div><br></div><div>This does work with JSON-LD 1.0:</div><div><br></div><div>```json</div><div>releases = [</div><div> {"version": "v0.0.1", "url": ...},</div><div> {"version": "v1.0.0", "url": ...},<br></div><div>]</div><div> </div><div>... Then adding custom attributes could be as easy as defining a URI namespace and additional attribute names;</div><div>because {distutils, setuptools, pip, pipenv(?)} only need to validate the properties necessary for the relevant packaging operation.</div><div><br></div><div>Without any JSON-LD normalization, these aren't equal:</div><div><br></div><div>{"url": "#here"}</div><div>{"schema:url": "#here"}</div><div>{"<a href="http://schema.org/url">http://schema.org/url</a>", "#here"}</div><div><br></div><div>This is the JSON downstream tools currently have/want to consume (en masse, for SAT solving, etc):</div><div><a href="https://pypi.python.org/pypi/ipython/json">https://pypi.python.org/pypi/ipython/json</a></div><div><br></div><div>- It's a graph.</div><div>- JSON-LD is for graphs.</div><div>- There are normalizations and signatures for JSON-LD (ld-signatures != JWS)</div><div>- Downstream tools need not do anything with the @context. ("JSON-LD unaware")</div><div>- Downstream tools which generate pydist.jsonld should validate schema in tests</div><div><br></div><div>Downstream tools:</div><div>- <a href="https://github.com/pypa/pip/issues/988">https://github.com/pypa/pip/issues/988</a> "Pip needs a dependency resolver" (-> JSON)</div><div>- <a href="https://github.com/pypa/warehouse/issues/1638">https://github.com/pypa/warehouse/issues/1638</a> "API to get checksums" (-> JSON)</div><div><br></div><div>Q: How do we get this (platform and architecture-specific) metadata to warehouse, where it can be hosted?</div><div><br></div><div>A JSONLD entrypoint in warehouse (for each project, for every project, for {my_subset}):</div><div><a href="https://pypi.python.org/pypi/ipython/jsonld">https://pypi.python.org/pypi/ipython/jsonld</a><br></div><div><br></div><div><span style="font-size:12.8px">> I would accept a pull request to stop generating metadata.json in bdist_wheel.</span><br></div><div><br></div><div><span style="font-size:12.8px">What about a pull request to start generating metadata.jsonld or pydist.jsonld instead?</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">- [ ] "@context": { },</span></div><div><span style="font-size:12.8px">- [ ] "@graph": { },   # optional</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">#PEP426JSONLD</span></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-HOEnZb"><font color="#888888"><br>
-n<br>
<br>
--<br>
Nathaniel J. Smith -- <a href="https://vorpus.org" rel="noreferrer" target="_blank">https://vorpus.org</a><br>
______________________________<wbr>_________________<br>
Distutils-SIG maillist  -  <a href="mailto:Distutils-SIG@python.org">Distutils-SIG@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/distutils-sig" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/distutils-sig</a><br>
</font></span></blockquote></div><br></div></div>