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

Robert Collins robertc at robertcollins.net
Wed Nov 11 01:19:11 EST 2015

On 11 November 2015 at 18:53, Nick Coghlan <ncoghlan at gmail.com> wrote:
> 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).

Its richer, which is both a positive and a negative. I appreciate the
arguments, but I'm not convinced at this point.

pip is going to be invoking a CLI *no matter what*. Thats a hard
requirement unless Python's very fundamental import behaviour changes.
Slapping a Python API on things is lipstick on a pig here IMO: we're
going to have to downgrade any richer interface; and by specifying the
actual LCD as the interface it is then amenable to direct exploration
by users without them having to reverse engineer an undocumented thunk
within pip.


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

More information about the Distutils-SIG mailing list