[Distutils] build system abstraction PEP

Robert Collins robertc at robertcollins.net
Mon Oct 26 19:23:16 EDT 2015


On 27 October 2015 at 10:32, Ralf Gommers <ralf.gommers at gmail.com> wrote:
>
>
> On Mon, Oct 26, 2015 at 7:01 AM, Robert Collins <robertc at robertcollins.net>
> wrote:
>>
>> Since Nathaniel seems busy, I've taken the liberty of drafting a
>> narrow PEP based on the conversations that arose from the prior
>> discussion.
>>
>> It (naturally) has my unique flavor, but builds on the work Nathaniel
>> had put together, so I've put his name as a co-author even though he
>> hasn't seen a word of it until now :) - all errors and mistakes are
>> therefore mine...
>>
>> Current draft text in rendered form at:
>> https://gist.github.com/rbtcollins/666c12aec869237f7cf7
>
>
> I have the feeling that I like where this PEP is going, but it's quite
> difficult to read. It would be very helpful to add one or two examples.

Ok, need to make it easier to read :).

> Suggestions:
>
> (1) Super simple example: for a pure Python package with one dependency and
> a build tool which has no dependencies itself.

pypy.yaml
===
bootstrap-requires:
  - flit
build-tool: flit --dump-build-description
===

flit --dump-build-description would output something like:
===
build-requires: flit --dump-build-requires
dist-info: flit --dump-dist-info
provided-by: flit
wheel: flit wheel -d $OUTPUT_DIR
===

The --dump- switches in this example would be needed to be added to
flit (or someone else could write an adapter).

Because flit doesn't have setup-requires in flit.ini today,
--dump-build-requires would just output a constant string:

     {"schema_version": "2.0", "build_requires": []}

--dump-dist-info interrogate flit.ini and marshal the metadata into a
PEP 426 JSON document and output that on stdout.

flit wheel would need a -d parameter that tells it where to output the
wheel(pip needs this).

> (2) Complex example: to build a Scipy wheel on Windows with MinGW the
> command is ``python setup.py config --compiler=mingw32 build
> --compiler=mingw32 bdist_wheel``.

So in this case the build tool needs to know about the compiler stuff
itself- pip doesn't know. We have a way in pip to tunnel stuff down to
setuptools today; thats incompatible with dynamically building wheels
on the fly for 'pip install' - so I'm not sure it needs to be
reflected here.

We'll need some more input on that I think.
...
> mechanism) to the build tool. If it is out of scope, I'd be interested to
> see what you think are use-cases with complex requirements that are enabled
> by this PEP.

The PEP is aimed at enabling additional build-tools to be on parity
with setuptools in *pip install* invocations that go through the
wheel-autobuild-path in pip.

The complex examples of passing arbitrary options to setup.py
currently bypasses wheel building in pip, and so can't be tackled at
all :(.

But we can work on including that with some thought.

-Rob


-- 
Robert Collins <rbtcollins at hp.com>
Distinguished Technologist
HP Converged Cloud


More information about the Distutils-SIG mailing list