[Distutils] Conditionless setup.py

Paul Moore p.f.moore at gmail.com
Fri Aug 25 05:50:11 EDT 2017


On 25 August 2017 at 09:36, Thomas Güttler <guettliml at thomas-guettler.de> wrote:
> The setup.py of numpy looks big and complicated:
> https://github.com/numpy/numpy/blob/master/setup.py
>
> I guess there are even more complicated setup.py files.
>
> Do you think it will be possible in the future to make setup.py
> conditionless (no "if", no "else", no function calls)?
>
> I mean that the setuptools/distutils/whatever libraries will handle all
> needed conditions?
>
> This would mean setup.py would be a pure data structure which could be
> encoded in json or yaml.
>
> What do you think?

The goal (under PEP 517, setuptools is merely one possible "backend")
is that some backends will allow purely declarative descriptions of
build requirements. Flit already does this. Whether setuptools will
ever switch to a purely declarative form I don't know (but I doubt it
- it's more likely that someone will write an alternative backend to
replace some or all of setuptools, as flit did).

And whether projects with requirements as complex as numpy and similar
will be able to manage with a purely declarative build description is
even more questionable, I suspect.

But certainly, once PEP 517 is implemented and as flit gains
popularity, I fully expect more and more projects to use a static data
structure for their metadata (flit.ini, specifically).

Paul


More information about the Distutils-SIG mailing list