Keywords field in metadata: space separated or comma separated?

Hi all, The metadata specification shows the keyword field as a space separated list: https://packaging.python.org/specifications/core-metadata/#keywords PEP 566 backs that up, saying that the transformation to JSON should split that field on whitespace: https://www.python.org/dev/peps/pep-0566/#json-compatible-metadata However, distutils reads and writes that field as a comma separated list: https://github.com/python/cpython/blob/5383956583bb758f3828513bcdd011871f24a... https://github.com/python/cpython/blob/5383956583bb758f3828513bcdd011871f24a... And setuptools has inherited that: https://github.com/pypa/setuptools/blob/68dbb703705cdd64e25261a6fcc1c0cc96bc... https://github.com/pypa/setuptools/blob/68dbb703705cdd64e25261a6fcc1c0cc96bc... Given the dominance of distutils and setuptools, and the difficulty of changing distutils, I suspect it's easier to change the spec to adopt their de-facto standard as the official standard. But I'd like confirmation of this, as it will require some changes in Flit. The comma-separated format allows keywords containing a space - like 'orbital mechanics' in the example I was investigating (poliastro). Thanks, Thomas

I can envision a world where we migrate to space-separated everywhere, but I think that would involve a decade of consumers supporting both until everyone updates to a version of setuptools that emits spaces and I'm not sure it's worth it. Was anyone on the list involved with the decision to use spaces in the spec? Is there some compelling reason we're missing to make the switch? On November 18, 2019 1:07:50 PM UTC, Thomas Kluyver <thomas@kluyver.me.uk> wrote:
Hi all,
The metadata specification shows the keyword field as a space separated list: https://packaging.python.org/specifications/core-metadata/#keywords
PEP 566 backs that up, saying that the transformation to JSON should split that field on whitespace: https://www.python.org/dev/peps/pep-0566/#json-compatible-metadata
However, distutils reads and writes that field as a comma separated list: https://github.com/python/cpython/blob/5383956583bb758f3828513bcdd011871f24a... https://github.com/python/cpython/blob/5383956583bb758f3828513bcdd011871f24a...
And setuptools has inherited that: https://github.com/pypa/setuptools/blob/68dbb703705cdd64e25261a6fcc1c0cc96bc... https://github.com/pypa/setuptools/blob/68dbb703705cdd64e25261a6fcc1c0cc96bc...
Given the dominance of distutils and setuptools, and the difficulty of changing distutils, I suspect it's easier to change the spec to adopt their de-facto standard as the official standard. But I'd like confirmation of this, as it will require some changes in Flit.
The comma-separated format allows keywords containing a space - like 'orbital mechanics' in the example I was investigating (poliastro).
Thanks, Thomas -- Distutils-SIG mailing list -- distutils-sig@python.org To unsubscribe send an email to distutils-sig-leave@python.org https://mail.python.org/mailman3/lists/distutils-sig.python.org/ Message archived at https://mail.python.org/archives/list/distutils-sig@python.org/message/LFTLG...

On Mon, Nov 18, 2019 at 12:24 PM Paul G <paul@ganssle.io> wrote:
Was anyone on the list involved with the decision to use spaces in the spec? Is there some compelling reason we're missing to make the switch?
distutils was originally conceived and written by Greg Ward at CNRI, back when Guido led a group there. Greg was in another group, but they were active Python users as well. We (primarily Greg & I) spent a lot of time discussing distutils and how things should work, but I don't recall specifically discussing keyword separators. The whole keywords thing was pretty geared to our guesses about how an index would work; actually implementing the first version of PyPI wasn't a part of Greg's project. Getting far enough along to build a range of C-based extensions was a pretty substantial bootstrapping task in the late '90s! On November 18, 2019 1:07:50 PM UTC, Thomas Kluyver <thomas@kluyver.me.uk> wrote:
The comma-separated format allows keywords containing a space - like 'orbital mechanics' in the example I was investigating (poliastro).
This seems reason enough to stick with the current implementation approach and forget about space separation. -Fred -- Fred L. Drake, Jr. <fred at fdrake.net> "A storm broke loose in my mind." --Albert Einstein

There seems to be a loose agreement in favour of changing the spec to match what distutils & setuptools do, so I've opened a PR against the spec: https://github.com/pypa/packaging.python.org/pull/674 On Tue, Nov 19, 2019, at 4:25 AM, Fred Drake wrote:
On Mon, Nov 18, 2019 at 12:24 PM Paul G <paul@ganssle.io> wrote:
Was anyone on the list involved with the decision to use spaces in the spec? Is there some compelling reason we're missing to make the switch?
distutils was originally conceived and written by Greg Ward at CNRI, back when Guido led a group there. Greg was in another group, but they were active Python users as well. We (primarily Greg & I) spent a lot of time discussing distutils and how things should work, but I don't recall specifically discussing keyword separators. The whole keywords thing was pretty geared to our guesses about how an index would work; actually implementing the first version of PyPI wasn't a part of Greg's project.
Getting far enough along to build a range of C-based extensions was a pretty substantial bootstrapping task in the late '90s!
On November 18, 2019 1:07:50 PM UTC, Thomas Kluyver <thomas@kluyver.me.uk> wrote:
The comma-separated format allows keywords containing a space - like 'orbital mechanics' in the example I was investigating (poliastro).
This seems reason enough to stick with the current implementation approach and forget about space separation.
-Fred
-- Fred L. Drake, Jr. <fred at fdrake.net> "A storm broke loose in my mind." --Albert Einstein -- Distutils-SIG mailing list -- distutils-sig@python.org To unsubscribe send an email to distutils-sig-leave@python.org https://mail.python.org/mailman3/lists/distutils-sig.python.org/ Message archived at https://mail.python.org/archives/list/distutils-sig@python.org/message/U2YH2...
participants (3)
-
Fred Drake
-
Paul G
-
Thomas Kluyver