(original) (raw)
On 19 February 2013 13:40, Nick Coghlan <ncoghlan@gmail.com> wrote:One particular item in Metadata 2.0 which needs to be addressed is
>> If a tools wants to support metadata 2.0, it has to support all
>> the complicated stuff as well, i.e. handle the requires fields,
>> the environment markers and version comparisons/sorting.
>
> Which is what distutils2 can be used for now, and what distlib will
> provide without the unwanted build system infrastructure in
> distutils2.
requirements specifiers, as used in (for example) Requires-Dist. These
take forms like "DistName (>= ver)". There are a number of potential
issues here:
1\. This differs from the pkg\_resources format (which omits the
parentheses). Having 2 subtly different formats is not a good idea in
the long term. At the moment, pkg\_resources format is used in pip
requirements (on the command line and in requirement files) as well as
in setuptools/distribute and possibly elsewhere.
2\. There is currently no code that I am aware of that implements this
spec. I don't believe distlib does (yet - give Vinay 5 minutes and who
knows? :-)), pkg\_resources as I said implements a different format,
and distutils2, apart from being a big dependency to cover just this
point, only matches the version (not the project name) and presumably
does so using the distutils2 version ordering (which is incompatible
with Metadata 2.0).
3\. The format is fiddly to parse and process - nobody is likely to
implement it for themselves without a library that does it (especially
not when using pkg\_resources is so easy).
The PEP needs a rationale as to why the pkg\_resources format wasn't
used, and should suggest a migration path for projects which currently
use the pkg\_resources style (such as pip's requirements files).
Paul