[Distutils] d2to1 setup.cfg schema

Erik Bray erik.m.bray at gmail.com
Tue Mar 31 01:03:15 CEST 2015


On Tue, Mar 24, 2015 at 6:51 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
>
> 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.

I would be fine with that, and other similar changes.  Better
documentation of the format is needed too--it used to just rely on the
distutils2 documentation, but since distutils2 is dead d2to1 deserves
documentation in its own right.

> (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)

As "the d2to1 folks", more or less, (not counting the pbr folks who've
done their own thing and might have opinions), I would be fine with
this.  It has been on my agenda for over a year to release an update
to d2to1 under a new name--something less tied to the failed
distutils2 project (along with its own documentation, see above).

The new name I've been working under cheekily called "setup.cfg", that
is, the actual Python package is named "setup.cfg".  You import
setup.cfg in your setup.py and it basically does the rest.  But if
that ends up being deemed too confusing/silly that would be
understandable--I'm open to other ideas.

>> 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.

I haven't followed this whole discussion (I started to in the
beginning, but haven't kept up), but I'm not really sure what's being
said here.  d2to1 *does* support declaring setup-requires dependencies
in setup.cfg, and those dependencies should be loaded before any hook
scripts are used.  Everything in d2to1 is done via various hook
points, and the hook functions can be either shipped with the package,
or come from external requirements installed via setup-requires.  It
works pretty well in most cases.

Erik


More information about the Distutils-SIG mailing list