[Distutils] Package metadata: which fields are optional
Donald Stufft
donald at stufft.io
Sun Apr 15 03:56:26 EDT 2018
> On Apr 15, 2018, at 3:31 AM, Thomas Kluyver <thomas at kluyver.me.uk> wrote:
>
> The core metadata specification (https://packaging.python.org/specifications/core-metadata/ ) notes whether each field is optional. However there are some discrepancies with my understanding:
>
> - Download-URL is not marked as optional, but in practice it's obsolete (since PEP 470) and not very helpful (there may be different places to download the same package). Flit has never set this, and I have had no bug reports about it, so in practice it definitely is optional.
> - Requires-Python is not marked as optional, though I'm pretty sure it also is in practice.
> - Only one of the multiple use fields is explicitly marked as optional, but my understanding is that 'multiple use' includes using them zero times, so they are all optional.
>
> I propose that we remove 'optional' from all the headings, and note at the top of the specification that the required fields are:
> - Metadata-Version
> - Name
> - Version
> - Summary
>
In PyPI, basically only Metadata-Version, Name, and Version are required.
I’m +1 on this, in practice what distutils does is for any “mandatory” field that wasn’t filled out, it would give it an implicit value of “UNKNOWN” (this include Name and Version amusingly enough, but Unknown is already taken on PyPI and Unknown isn’t a valid version anymore). So while it was *technically* set, it was set to a garbage value and thus, for all intents and purposes, optional anyways. We just had a funny way of saying that it didn’t exist.
More information about the Distutils-SIG
mailing list