Skip to content

✨ feat(cli): warn on valueless config settings - #1081

Merged
gaborbernat merged 1 commit into
pypa:mainfrom
gaborbernat:640
Jun 9, 2026
Merged

gaborbernat merged 1 commit into
pypa:mainfrom
gaborbernat:640

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

People reach for the same -C / --config-settings flag 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-extensions and 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:

Seen in the wild on GitHub

Build scripts write config settings in the portable --config-setting=KEY=VALUE form that both build and pip accept, never the bare -C KEY:

@gaborbernat gaborbernat added enhancement New feature or request documentation Improvements or additions to documentation labels Jun 3, 2026
@gaborbernat
gaborbernat marked this pull request as ready for review June 4, 2026 00:30
@gaborbernat
gaborbernat force-pushed the 640 branch 2 times, most recently from 9a89961 to 64e73c6 Compare June 6, 2026 00:44
Comment thread .github/workflows/cd.yml Resolved
Comment thread src/build/__main__.py Resolved
Comment thread tests/test_main.py Resolved
Comment thread tests/test_main.py Resolved
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.
@gaborbernat
gaborbernat merged commit 2e883c6 into pypa:main Jun 9, 2026
59 checks passed
@gaborbernat
gaborbernat deleted the 640 branch June 29, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config settings without an argument

3 participants