On 16 January 2016 at 00:12, Paul Moore <p.f.mo...@gmail.com> wrote: > Pip refers to PEP 440 when defining the format of a requirement (see > https://pip.pypa.io/en/stable/reference/pip_install/#requirement-specifiers). > But PEP 508 *also* defines a requirement - the title implies that it's > for dependency specification, but the content of the PEP says "the > language defined is a compact line based format which is already in > widespread use in pip requirements files". > > So what's the relationship between PEP 440 and PEP 508? Which one is > the definitive definition of what is a "requirement"? The "packaging" > library implements specifiers which conform (according to the docs) to > PEP 440.
As Donald already noted, 508 is the higher level specification, that includes 440 by reference to cover the "version specifier" section of a full dependency specifier The key parts that 508 adds above and beyond 440 are: - package names (the current rules were previously only given in the 426 draft) - extras - environment markers The main benefit of keeping the two levels separate is that there's a *lot* of arcana in PEP 440 around version ordering and how that relates to version comparison operators that you don't really need to think about when working at the level of processing a list of dependency specifiers. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig