[Distutils] d2to1 setup.cfg schema

Nick Coghlan ncoghlan at gmail.com
Tue Mar 24 23:51:37 CET 2015


On 25 Mar 2015 07:35, "Robert Collins" <robertc at robertcollins.net> wrote:
>
> This is a break-out thread from the centi-thread that spawned about
> setup-requires.
>
> d2to1 defined some metadata keys in setup.cfg,in particular 'name' and
> 'requires-dist'. Confusing 'requires-dist' contains the
> 'install_requires' one might use with setuptools' setup() function.

That particular name comes from PEP 345:
https://www.python.org/dev/peps/pep-0345/

Extending d2to1 to accept "install-requires" as meaning the same thing as
the existing "requires-dist" (and complaining if a setup.cfg file contains
both) would make sense to me, as it provides a more obvious migration path
from setuptools, and pairs up nicely with a new "setup-requires" section
for setup.py dependencies.

(It also occurs to me that we should probably ask the d2to1 folks if they'd
be interested in bringing the project under the PyPA banner as happened
with setuptools, distlib, etc. It's emerged as a key piece of the
transition from Turing complete build process customisation to static build
metadata configuration)

> Since the declarative setup-requires concept also involves putting
> dependencies in setup.cfg (but setup_requires rather than
> install_requires), I followed the naming convention d2to1 had started.
> But - all the reviewers (and I agree) think this is confusing and
> non-obvious.
>
> Since d2to1 is strictly a build-time thing - it reflects the keys into
> the metadata and thus your egg-info/requires.txt is unaltered in
> output, I think its reasonable to argue that we don't need to be
> compatible with it.
>
> OTOH folk using d2to1 would not gain the benefits that declarative
> setup-requires may offer in setuptools // pip.

As the converse of the above, I think pip should also accept the PEP 345
defined "requires-dist" as equivalent to "install-requires" (and similarly
complain if a file defines both, but in pip's case, only emitting a warning
and then treating them as a single combined section)

> What do folk think?

To summarise my view: I think it makes the most sense to use setuptools
inspired section names, and teach d2to1 about them, while also having pip
understand the existing PEP 345 defined section name.

Cheers,
Nick.

>
> -Rob
>
> --
> Robert Collins <rbtcollins at hp.com>
> Distinguished Technologist
> HP Converged Cloud
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> https://mail.python.org/mailman/listinfo/distutils-sig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20150325/e9fc8f04/attachment.html>


More information about the Distutils-SIG mailing list