feat: package-declared config-settings - #1489
Open
henryiii wants to merge 7 commits into
Open
Conversation
Collaborator
Author
|
Dropping a review point from the simplification work. 🤖 AI text below 🤖 Unifying {config-setting = ...} with the {env = ...} annotation resolver (altitude's top finding) — a real architectural point, but it means threading resolved values into the generic source-conversion layer; too large a redesign for this pass |
henryiii
force-pushed
the
config-setting-declarations
branch
from
July 22, 2026 19:37
8ccfee3 to
ee3a812
Compare
henryiii
marked this pull request as ready for review
July 27, 2026 14:47
Add a tool.scikit-build.config-setting table letting packages declare
their own config-settings, passed via -C name=value or a bound
environment variable (env > -C > default). Values reach CMake through an
inline cmake alias or a cmake.define {config-setting = ...} reference
(dropped when unset), and drive overrides via if.config-setting, which
matches the resolved value. Declared keys are exempt from strict-config
validation with typo suggestions; the feature is gated on
minimum-version >= 1.1.
Also guard the raw cmake-table lookups so a malformed non-table value
reaches the normal conversion error instead of an AttributeError.
Closes #1468
Assisted-by: ClaudeCode:claude-fable-5
CI shallow clones resolve __version__ to 0.1.dev1, so the backend-too-old check fired before the config-setting gate. Pin the version like the gate-ok test and assert the gate's message. Assisted-by: ClaudeCode:claude-fable-5
The cmake.define = {config-setting = "..."} reference form covers the
same need with one obvious spelling and no extra precedence rule.
Assisted-by: ClaudeCode:claude-fable-5
Keeps the initial 1.1 surface to help/type/default/env; a comment in config_settings.py records what re-adding it entails. Assisted-by: ClaudeCode:claude-fable-5
Generate the declaration entry schema from the dataclass, fold the triplicated post-override handling into one helper, and drop a duplicated test constant. Assisted-by: ClaudeCode:claude-fable-5
Assisted-by: ClaudeCode:claude-opus-4.8
No `from __future__ import annotations` here, but bare `dict`/`list` are fine at runtime on 3.9+, matching skbuild_model.py. Assisted-by: ClaudeCode:claude-opus-4.8
henryiii
force-pushed
the
config-setting-declarations
branch
from
July 30, 2026 19:55
ee3a812 to
ca92800
Compare
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.
Design choices:
.(namespaced)🤖 AI text below 🤖
Implements the design discussed in #1468 (targeting 1.1, not 1.0): packages can declare their own config-settings in a
tool.scikit-build.config-settingtable, giving users a documented, package-level interface instead of raw CMake defines.Notes:
overrides(not a settings field, not an override target); values resolve before override processing soif.config-settingsees them.ConfSource(newextra_keys) and get "did you mean" suggestions;skbuild.-prefixed custom keys stay rejected, and unknown-key strict-config behavior is otherwise unchanged.minimum-version >= 1.1.strandbool(strtobool semantics); repeated-Cvalues error. Achoiceskey for enumerated values was cut to keep the initial surface minimal (a code comment notes how to re-add it).cmake.define = {config-setting = "..."}reference form only; an earlier inlinecmake =declaration alias was dropped as redundant.cmakevalue raisedAttributeError(in theforce_auto_cmakelookup) instead of the normal conversion error; the new resolution helpers are guarded the same way.Beyond CI: verified end-to-end through the real
build_wheelhook that the env var and-Cspellings land in CMake identically and the override fires.