Skip to content

Commit d699403

Browse files
committed
fix: reflect the change in the schema, too
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
1 parent a4cdbd5 commit d699403

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

src/scikit_build_core/resources/scikit-build.schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,8 @@
647647
"$ref": "#/properties/build-dir"
648648
},
649649
"fail": {
650-
"$ref": "#/properties/fail"
650+
"type": "boolean",
651+
"description": "Immediately fail the build. This is only useful in overrides."
651652
}
652653
}
653654
}

src/scikit_build_core/settings/json_schema.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ def to_json_schema(dclass: type[Any], *, normalize_keys: bool) -> dict[str, Any]
9797
props[field.name]["description"] = docs[field.name].split("\n", maxsplit=1)[0]
9898
if field.metadata.get("deprecated"):
9999
props[field.name]["deprecated"] = True
100+
if field.metadata.get("override_only"):
101+
props[field.name]["scikit-build:override-only"] = True
100102

101103
if normalize_keys:
102104
props = {k.replace("_", "-"): v for k, v in props.items()}

src/scikit_build_core/settings/skbuild_schema.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,21 @@ def generate_skbuild_schema(tool_name: str = "scikit-build") -> dict[str, Any]:
8282
m: {"$ref": "#/$defs/metadata"} for m in METADATA
8383
}
8484

85+
inherit_only_props = {
86+
k: v
87+
for k, v in schema["properties"].items()
88+
if v.get("scikit-build:override-only")
89+
}
90+
for v in inherit_only_props.values():
91+
del v["scikit-build:override-only"]
92+
schema["properties"] = {
93+
k: v
94+
for k, v in schema["properties"].items()
95+
if not v.get("scikit-build:override-only")
96+
}
8597
props = {k: {"$ref": f"#/properties/{k}"} for k in schema["properties"]}
98+
props.update(inherit_only_props)
99+
86100
schema["$defs"]["if_overrides"] = {
87101
"type": "object",
88102
"minProperties": 1,

0 commit comments

Comments
 (0)