[Distutils] Metadata 2.0: Is there a formal spec for a requirement?
Paul Moore
p.f.moore at gmail.com
Tue Sep 16 12:59:40 CEST 2014
I feel as though I must be missing something obvious, but is there an
actual specification of the syntax and semantics of a requirement
anywhere? I've scanned through the PEP, and while there is a spec for
the environment marker mini-language, there isn't one for a
requirement. (As a check I hadn't missed anything obvious, I did a
text search for the operator ">=" which *is* a valid operator in a
requirement, and it's not present in a syntax definition or anything
equivalent.
I ask because I'm looking for a way to find a way of matching a set of
package/version details against a requirement, and I was coming up
blank. So I was going to write my own, and then I found that there's
no spec :-(
Surely having a spec for a requirement has to be part of the sign-off
requirements for Metadata 2.0?
Digging a bit further, there is (of course, doh!) the pkg_resources
requirement parser. But even if that is definitive, I think it should
be integrated into the Metadata 2.0 spec, or at the very least
referenced from there (and just having a reference risks the
possibility of setuptools accidentally making changes outside of the
PEP process).
Paul
[1] Pip's code is too complex to factor out the bits I want, and
distlib's version matcher seems to support a different syntax if the
docs are correct.
More information about the Distutils-SIG
mailing list