Pass config_settings from build frontend to builders#2240
Open
brandon-avantus wants to merge 1 commit intopypa:masterfrom
Open
Pass config_settings from build frontend to builders#2240brandon-avantus wants to merge 1 commit intopypa:masterfrom
brandon-avantus wants to merge 1 commit intopypa:masterfrom
Conversation
`uv build`, `pip wheel`, and `pyproject-build` (from the build package) all support passing config settings, as defined in PEP 517, to the build backend. Until now, `hatchling.build` ignored them. This change passes the `config_settings` dictionary on to `SdistBuilder` and `WheelBuilder` so that custom build scripts can access those settings when passed by frontends that support it. See pypa#1072
Author
|
I just realized this is incomplete. I need to get the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As a Python packager writing custom hatchling build hooks (using hatch_build.py), I would like hatchling to support passing
config_settingsfrom build frontends that support it to hatchling builders so that users can customize certain aspects of the build experience (i.e., build jobs, compiler choice, etc.) using the command-line options provided by build frontends.PEP 517 defines a
config_settingsdictionary in the backend hooks specifications for passing configuration from build frontends. Many build frontends already support passing inconfig_settingsusing the -C/--config-settings command-line option.Currently, hatchling does not pass
config_settingson to builders. I finally realized that the reluctance to implement such a feature in hatch, as indicated by responses in #1072, stem from the ambiguity in how frontends should implement the feature. What I'm suggesting here is not that we add support to the hatch frontend, but that we provide the backend with settings from frontends that already support it.See #1072
Please let me know if anything should be added to the documentation or if additional tests would be helpful.