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

FR: build-backend support for poetry within pyproject.toml #644

Closed
adam-grant-hendry opened this issue Jul 19, 2023 · 4 comments
Closed

Comments

@adam-grant-hendry
Copy link

adam-grant-hendry commented Jul 19, 2023

Related to poetry/#2740 , considering PEP 632, is it possible to use build as a backend with poetry to build platform-specific wheels and compile C-extensions?

NOTE: This might not be applicable since build is technically listed as a front-end but I thought I'd ask since the distutils SetuptoolsDeprecationWarning recommends trying pypa/build instead

@uranusjr
Copy link
Member

distutils and setuptools are historically both a backend and frontend, and the deprecation suggesting build is only for the frontend part, since setuptools (absorbing distutils) only wants to be a backend moving forward, while build is only implements frontend functionalities.

So no, this does not make sense.

@adam-grant-hendry
Copy link
Author

@uranusjr Quite alright. I was afraid this might be the case. Thank you for the clarification. I’ll go ahead and close this issue for now then.

@abravalheri
Copy link
Collaborator

Hi @adam-grant-hendry, the setuptools.build_meta module implements the build APIs specified by both PEP 517 and PEP 660, so if poetry wants to delegate anything to setuptools, that is something you can take into consideration for the implementation.

@adam-grant-hendry
Copy link
Author

Hi @adam-grant-hendry, the setuptools.build_meta module implements the build APIs specified by both PEP 517 and PEP 660

Yes, I've already been doing that for some time now:

# pyproject.toml
...

[tool.poetry.build]
generate-setup-file = false
script = 'build.py'

[build-system]
requires = [
    "setuptools>=45",
    "wheel",
    "toml",
]
build-backend = "setuptools.build_meta"

This was first introduced in Issue #11, but is still undocumented.

I thought I was seeing the SetuptoolsDeprecationWarning when I ran poetry build, but that doesn't seem to be happening anymore.

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

3 participants