<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Specifiers are defined in PEP 440 (the >=1.0 parts), however PEP 426 combines</div><div class="">those with the package names to get “foo >=1.0”. The packaging library implements</div><div class="">the specifier part.</div><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 16, 2014, at 6:59 AM, Paul Moore <<a href="mailto:p.f.moore@gmail.com" class="">p.f.moore@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">I feel as though I must be missing something obvious, but is there an<br class="">actual specification of the syntax and semantics of a requirement<br class="">anywhere? I've scanned through the PEP, and while there is a spec for<br class="">the environment marker mini-language, there isn't one for a<br class="">requirement. (As a check I hadn't missed anything obvious, I did a<br class="">text search for the operator ">=" which *is* a valid operator in a<br class="">requirement, and it's not present in a syntax definition or anything<br class="">equivalent.<br class=""><br class="">I ask because I'm looking for a way to find a way of matching a set of<br class="">package/version details against a requirement, and I was coming up<br class="">blank. So I was going to write my own, and then I found that there's<br class="">no spec :-(<br class=""><br class="">Surely having a spec for a requirement has to be part of the sign-off<br class="">requirements for Metadata 2.0?<br class=""><br class="">Digging a bit further, there is (of course, doh!) the pkg_resources<br class="">requirement parser. But even if that is definitive, I think it should<br class="">be integrated into the Metadata 2.0 spec, or at the very least<br class="">referenced from there (and just having a reference risks the<br class="">possibility of setuptools accidentally making changes outside of the<br class="">PEP process).<br class=""><br class="">Paul<br class=""><br class="">[1] Pip's code is too complex to factor out the bits I want, and<br class="">distlib's version matcher seems to support a different syntax if the<br class="">docs are correct.<br class="">_______________________________________________<br class="">Distutils-SIG maillist - <a href="mailto:Distutils-SIG@python.org" class="">Distutils-SIG@python.org</a><br class=""><a href="https://mail.python.org/mailman/listinfo/distutils-sig" class="">https://mail.python.org/mailman/listinfo/distutils-sig</a><br class=""></div></blockquote></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">---</div><div class="">Donald Stufft</div><div class="">PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA</div></div></div>
</div>
<br class=""></body></html>