[Distutils] Package metadata: which fields are optional

Thomas Kluyver thomas at kluyver.me.uk
Sun Apr 15 12:44:59 EDT 2018


Thanks. I've opened a PR for it:

https://github.com/pypa/python-packaging-user-guide/pull/469

For now, I haven't listed 'Summary' as a required field, but I'm not 100% sure of this. Donald says PyPI doesn't check that it's there, but if all (or almost all) distributions have it anyway, maybe we should enforce that it's always there.

Thomas

On Sun, Apr 15, 2018, at 8:57 AM, Nick Coghlan wrote:
> On 15 April 2018 at 17:31, 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
> >
> > (And we should check if Summary is really required)
> 
> That all sounds like a good idea to me.
> 
> With the heading adjustments, it would be worth adding the relevant
> Sphinx labels so that the current anchors still resolve to the right
> place. For example, the current Keywords anchor is
> https://packaging.python.org/specifications/core-metadata/#keywords-optional.
> With this change, it will become
> https://packaging.python.org/specifications/core-metadata/#keywords.
> Adding a ".. _keywords-optional:" label before the heading will
> preserve the old links.
> 
> Cheers,
> Nick.
> 
> -- 
> Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Distutils-SIG mailing list