Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass options to build-backend? #444

Closed
nschloe opened this issue Mar 10, 2022 · 10 comments
Closed

pass options to build-backend? #444

nschloe opened this issue Mar 10, 2022 · 10 comments

Comments

@nschloe
Copy link

nschloe commented Mar 10, 2022

Not sure if this is the correct repo for the issue.

I'm using Nuitka to build some of my projects and specify it in pyproject.toml via

[build-system]
requires = ["setuptools", "nuitka"]
build-backend = "nuitka.distutils.Build"

I'd now like to pass some options to nuitka.distutils.Build, but I don't know if this is possible at all from build's point of view.

@nschloe nschloe changed the title pass options to build-backend pass options to build-backend? Mar 10, 2022
@uranusjr
Copy link
Member

By passing options, do you mean pass build-time options that should be decided on build-time (e.g. where to find some external library), or the Build callable simply needs some arguments that you need to pass? For the former you need PEP 517 build options (and you need to ask Nuitka developers how it supports them), and for the latter you need an in-tree build backend to wrap around Nuitka. Either way, this is not a build issue.

@nschloe
Copy link
Author

nschloe commented Mar 10, 2022

Either way, this is not a build issue.

Definitely not an issue. (Would have opened a gh-discussion, but that's not enabled on the repo yet.)

and for the latter you need an in-tree build backend to wrap around Nuitka

I see! I'll try to work my way through this. Thanks for the advice!

@uranusjr
Copy link
Member

It may also be worthwhile to ask if Nuitka is interested in including a PEP 517-compatible module in nuitka itself.

@nschloe
Copy link
Author

nschloe commented Mar 10, 2022

How would that work? Perhaps I can come up with a PR.

@uranusjr
Copy link
Member

You need to implement at least two functions in a module. See PEP 517 specification for the requirements. Once that’s done and included somewhere in nuitka (say nuitka.build_dist), you’d be able to declare a pyproject.toml like this

[build-system]
requires = ["setuptools", "nuitka"]
build-backend = "nuitka.build_dist"

and python -m build will call those two functions under the hood to generate a tar.gz and a whl.

@nschloe
Copy link
Author

nschloe commented Mar 10, 2022

Nuitka already provides a build-backend here that one can use like

build-backend = "nuitka.distutils.Build"

What's the difference with your suggested approach?

@layday
Copy link
Member

layday commented Mar 10, 2022

The nuitka build backend appears to be a thin wrapper around setuptools so I imagine that you would configure it as you would setuptools.

@FFY00
Copy link
Member

FFY00 commented Mar 10, 2022

Yes, if that is the case, you can use the https://pypa-build.readthedocs.io/en/stable/#python--m-build---config-setting option.

See #328 for eg.
For the implementation side, see https://peps.python.org/pep-0517/#config-settings.

@nschloe
Copy link
Author

nschloe commented Mar 10, 2022

I'm trying to play around with a local Nuitka version to see of the --config-settings are propagated. How can I tell build to use that local version instead of getting it from PyPI?

@layday
Copy link
Member

layday commented Mar 10, 2022

Run build with the -n flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants