Repository navigation
✨ feat(cli): warn on valueless config settings - #1081
Merged
Merged
Conversation
gaborbernat
marked this pull request as ready for review
June 4, 2026 00:30
gaborbernat
force-pushed
the
640
branch
2 times, most recently
from
June 6, 2026 00:44
9a89961 to
64e73c6
Compare
henryiii
reviewed
Jun 6, 2026
layday
reviewed
Jun 6, 2026
A bare config setting like -C--my-flag has worked in build as a shorthand for -C--my-flag= since the value is optional in the spec. pip never accepted that shorthand, so a command copied between the two tools breaks, and authors only discover the gap when pip rejects it. Henry raised this in issue pypa#640 and asked the two front ends to agree. Warn whenever a setting arrives without an equals sign and point the author at the -C KEY= form that both tools accept. The shorthand keeps working, so nobody is broken today, while new commands drift toward the portable spelling. The how-to, backend explanation, and CLI reference all now steer people the same way.
layday
approved these changes
Jun 9, 2026
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.
People reach for the same
-C/--config-settingsflag whether they build with build or install with pip, and they expect a command that works in one to work in the other. build quietly accepts a valueless setting such as-C--with-c-extensionsand treats it as an empty value, while pip refuses anything without an=. Someone who copies a working build command into a pip invocation hits a confusing rejection. Today people get past it by reading pip's error closely enough to learn they must append=, or by lifting the workaround from issue threads such as cibuildwheel's. Henry raised the inconsistency in #640 and asked the two tools to agree.build now warns when a setting arrives without a value and shows the
-C KEY=form that both tools accept. ✨ The shorthand keeps working, so existing scripts and pipelines keep running, and the warning moves people toward a spelling they can reuse with pip. The how-to guide, the backend explanation, and the CLI help now give the same guidance, so anyone who reads one of them lands on the portable form.Someone relying on the bare form sees a single warning with the exact fix, and nothing they run today stops working. Closes #640.
Workarounds people use today
Issue #640 has no comments; the discussion and the workaround live in the cibuildwheel thread it points to:
=so-C--with-c-extensions=is accepted by both build and pip.key=valuepairs to paper over the mismatch.--config-settingsdocs — pip's "Settings take the formKEY=VALUE" rule that forces the workaround in the first place.Seen in the wild on GitHub
Build scripts write config settings in the portable
--config-setting=KEY=VALUEform that both build and pip accept, never the bare-C KEY:build-one-linux-wheel.sh(L23-L35) — passes the flag as--config-setting=--global-option=--rusttopython -m build.build-and-sign.sh(L60) —python -m build ... --config-setting="--build-option=--plat-name=..."with an explicit value.build-python.sh(L145) — every setting carries an explicit=, even boolean flags likecmake.define.USE_CUDA=ON, fed topython -m build(L379).