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

Feature Request Please support poetry build backend #916

Closed
ryanfaircloth opened this issue Nov 12, 2021 · 8 comments
Closed

Feature Request Please support poetry build backend #916

ryanfaircloth opened this issue Nov 12, 2021 · 8 comments

Comments

@ryanfaircloth
Copy link

Description

I use poetry primarily please support poetry as a backend

Build log

No response

CI config

No response

@joerick
Copy link
Contributor

joerick commented Nov 12, 2021

You can set build backends using build-system in pyproject.toml. E.g. for poetry: https://python-poetry.org/docs/pyproject/#poetry-and-pep-517

That said, I don't think that poetry supports platform wheels, so you don't need cibuildwheel. pypa/build is probably what you want.

@joerick joerick closed this as completed Nov 12, 2021
@henryiii
Copy link
Contributor

henryiii commented Nov 12, 2021

I'm working on a proposal that would include a Poetry plugin to build binaries, but as far as I know, there is no support for binaries in Poetry - they don't support what we do; we would support them if they chose to do so. We use pip or build to do the building, so any PEP 517 tool (like Poetry) works, just as long as it makes binary (platform) wheels.

@Anselmoo
Copy link

@henryiii Thank you very much for the detail answer!

Is there any chance to use complete pyproject.toml including the [tool.poetry.dependencies] and [tool.poetry], so that cibuildwheel can skip poetry?

@henryiii
Copy link
Contributor

henryiii commented Nov 21, 2021

Poetry is the build system. If you skip it, you'd just end up doing nothing at all. Currently there are a limited number of build systems that support building compiled code. setuptools/distutils, scikit-build, pyo3 (Rust), enscons. I've also seen a pdm example that shows how to use setuptools to do the extension compile inside pdm (pdm is very much like Poetry, except it supports standards like PEP 621 that poetry does not yet). Meson should gain support soon, too, I think.

Poetry ideally will support compiling via plugins eventually (as I said, I'd probably be writing one for scikit-build if my proposal gets accepted), but it doesn't now.

Also, cibuildwheel will never be a build system, and any new tools should use PEP 621 configuration and not something Poetry specific.

@Anselmoo
Copy link

Poetry is the build system. If you skip it, you'd just end up doing nothing at all. Currently there are a limited number of build systems that support building compiled code. setuptools/distutils, scikit-build, pyo3 (Rust), enscons. I've also seen a pdm example that shows how to use setuptools to do the extension compile inside pdm (pdm is very much like Poetry, except it supports standards like PEP 621 that poetry does not yet). Meson should gain support soon, too, I think.

Poetry ideally will support compiling via plugins eventually (as I said, I'd probably be writing one for scikit-build if my proposal gets accepted), but it doesn't now.

Also, cibuildwheel will never be a build system, and any new tools should use PEP 621 configuration and not something Poetry specific.

Thx, that helps a lot!

@henryiii
Copy link
Contributor

You might like https://stackoverflow.com/questions/60073711/how-to-build-c-extensions-via-poetry/60163996#60163996

There's a page on PDM about this too, https://pdm.fming.dev/pyproject/tool-pdm/#build-c-extensions

@bostonrwalker
Copy link

I'm working on a proposal that would include a Poetry plugin to build binaries, but as far as I know, there is no support for binaries in Poetry - they don't support what we do; we would support them if they chose to do so. We use pip or build to do the building, so any PEP 517 tool (like Poetry) works, just as long as it makes binary (platform) wheels.

It is possible to build platform-specific binaries using Poetry, although it is not officially supported yet (see python-poetry/poetry#2740).

@henryiii
Copy link
Contributor

That that should work just fine in cibuildwheel - we check for pyproject.toml or setup.py already - you don't have to have a setup.py.

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

5 participants