[Distutils] command line versus python API for build system abstraction (was Re: build system abstraction PEP)

Nick Coghlan ncoghlan at gmail.com
Wed Nov 11 00:53:27 EST 2015

On 11 November 2015 at 08:44, Nathaniel Smith <njs at pobox.com> wrote:
> On Mon, Nov 9, 2015 at 6:11 PM, Robert Collins
> <robertc at robertcollins.net> wrote:
>> On 10 November 2015 at 15:03, Nathaniel Smith <njs at pobox.com> wrote:
> Similarly, we still have to specify how what the different operations
> are, what arguments they take, how they signal errors, etc. The point
> though is this specification will be shorter and simpler if we're
> specifying Python APIs than if we're specifying IPC APIs, because with
> a Python API we get to assume the existence of things like data
> structures and kwargs and exceptions and return values instead of
> having to build them from scratch.

I think the potentially improved quality of error handling arising
from a Python API based approach is well worth taking into account.
When the backend interface is CLI based, you're limited to:

1. The return code
2. Typically unstructured stderr output

This isn't like HTTP+JSON, where there's an existing rich suite of
well-defined error codes to use, and an ability to readily include
error details in the reply payload.

The other thing is that if the core interface is Python API based,
then if no hook is specified, there can be a default provider in pip
that knows how to invoke the setup.py CLI (or perhaps even implements
looking up the CLI to invoke from the source tree metadata).


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Distutils-SIG mailing list