On Saturday, September 29, 2012 at 5:54 AM, Vinay Sajip wrote:
Nick Coghlan <ncoghlan <at> gmail.com> writes:The document has changed since then,I read from your page there that Donald Stufft is working on a JSON-basedmetadata format. I've been looking that the same thing - a more flexiblemetadata format which directly maps to dicts - but I used YAML, as looking attoo much JSON gives me eye-strain from all the extraneous quotes and braces.I believe that JSON is the right format to use at the moment, becausePyYAML still has some bugs which I've run into while doing this work (also,of course, it's not in the stdlib). As the formats are readilyinterchangeable, there might be interest here in looking at the package.yamlthat I've come up with.Since the metadata needs to support both the existing metadata and theadditional things that e.g. setuptools supports via additional kwargs tosetup(), I put together an ugly hack where I essentially mocked parts ofdistutils and setuptools, including the setup() call. This allows me togenerate the YAML format automatically from most distributions on PyPI, usingtheir setup.py.Here's a GIST with sample package.yaml files automatically generated from PyPIdownloads of SQLAlchemy 0.7.8, Jinja2 2.6, Flask 0.9 and wheel 0.9.4.The JSON format of the metadata is actually appended as a comment on the lastline of the YAML metadata (I use that to report YAML bugs).I've not yet documented the schema for the metadata, as I'm still thinkingabout the details.I ran my hack on around 18,000 PyPI releases (basically, all the latestreleases which are hosted on PyPI). For all but around 1300, I wasable to generate package.yaml files. The ones which failed are those whereno setup.py is present, or it's present, but can't be imported because itassumes that some third-party package is available.Comments welcome.Regards,Vinay Sajip_______________________________________________Distutils-SIG maillist - Distutils-SIG@python.org