On 24 June 2018 at 16:19, Nathaniel Smith <[email protected]> wrote:
> Hi all,
>
> I had a thought for something that might be a simple way to improve
> dev experience with custom build backends.
>
> A PEP 517 build backend is a Python object that has some special
> methods on it. And the way a project picks which object to use, is via
> pyproject.toml:
>
> [build-system]
> build-backend = "module1.module2:object"
>
> Currently, this means that the build backend is the Python object:
>
> module1.module2.object
>
> Here's my idea: what if change it, so that the above config is
> interpreted as meaning that the build backend is the Python object:
>
> module1.module2.object.__build_backend__
>
> (I.e., we tack a "__build_backend__" on the end before looking it up.)
Allowing `__build_backend__` as an override attribute seems fine to
me, but I think it would be a problem if direct references like
`build-backend = "flit.buildapi"` didn't work.
That is, the override check would be:
backend = getattr(backend_ref, "__build_backend__", backend_ref)
Cheers,
Nick.
--
Nick Coghlan | [email protected] | Brisbane, Australia
--
Distutils-SIG mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mm3/mailman3/lists/distutils-sig.python.org/
Message archived at
https://mail.python.org/mm3/archives/list/[email protected]/message/XE7M4ZAAV3HPJ2KP3REGQPREDSSIH7HC/