On Mar 7, 2014, at 7:45 AM, Marius Gedminas marius@pov.lt wrote:
On Fri, Mar 07, 2014 at 01:03:23AM -0500, Donald Stufft wrote:
The JSON API is functional again and is available for testing!
Excellent!
I can observe two differences with the current PyPI code:
First, the Content-Type of the response differs:
$ curl -sI https://pypi.python.org/pypi/setuptools/json | grep Content-Type Content-Type: application/json; charset="UTF-8"
$ curl -sI https://pypi-preview.a.ssl.fastly.net/pypi/setuptools/json | grep Content-Type Content-Type: application/json
(I don't know which is correct, or whether the difference actually matters.)
Most things will accept the first, however the Warehouse style is correct. application/json is always UTF8 and doesn’t accept a charset parameter.
Second, the current PyPI codebase returns absolute URLs, while Warehouse returns paths relative to the site root:
$ curl -s https://pypi.python.org/pypi/setuptools/json | grep '"url":' "url": "https://pypi.python.org/packages/3.4/s/setuptools/setuptools-2.2-py2.py3-non...", "url": "https://pypi.python.org/packages/source/s/setuptools/setuptools-2.2.tar.gz",
$ curl -s https://pypi-preview.a.ssl.fastly.net/pypi/setuptools/json | python -m json.tool | grep '"url":' "url": "/packages/3.4/s/setuptools/setuptools-2.2-py2.py3-none-any.whl" "url": "/packages/source/s/setuptools/setuptools-2.2.tar.gz"
I can adapt my script to cope.
Yea I already noted that they were relative, I think they should be absolute and I had already filed it under https://github.com/pypa/warehouse/issues/233 .
Marius Gedminas
Key emulation: [ ] Intuitive [*] Emacs (Seen in an MCEdit dialog) _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
----------------- Donald Stufft PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA