Skip to content

Commit 53aed69

Browse files
committed
fix: change name and remove from readme
Signed-off-by: Henry Schreiner <[email protected]>
1 parent bbc3671 commit 53aed69

File tree

6 files changed

+15
-8
lines changed

6 files changed

+15
-8
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,6 @@ minimum-version = "0.11" # current version
286286
# The CMake build directory. Defaults to a unique temporary directory.
287287
build-dir = ""
288288

289-
# Immediately fail the build. This is only useful in overrides.
290-
fail = ""
291-
292289
```
293290

294291
<!-- [[[end]]] -->

src/scikit_build_core/settings/documentation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class DCDoc:
5656
docs: str
5757
field: dataclasses.Field[typing.Any]
5858
deprecated: bool = False
59+
override_only: bool = False
5960

6061

6162
def sanitize_default_field(text: str) -> str:
@@ -134,4 +135,5 @@ def mk_docs(dc: type[object], prefix: str = "") -> Generator[DCDoc, None, None]:
134135
docs=docs[field.name],
135136
field=field,
136137
deprecated=field.metadata.get("deprecated", False),
138+
override_only=field.metadata.get("override_only", False),
137139
)

src/scikit_build_core/settings/skbuild_docs_readme.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ def mk_skbuild_docs() -> str:
4646
Makes documentation for the skbuild model.
4747
"""
4848
doc = Document(
49-
[Item(item) for item in mk_docs(ScikitBuildSettings) if not item.deprecated]
49+
[
50+
Item(item)
51+
for item in mk_docs(ScikitBuildSettings)
52+
if not item.deprecated and not item.override_only
53+
]
5054
)
5155
return doc.format()
5256

src/scikit_build_core/settings/skbuild_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ def __dir__() -> List[str]:
3333
class SettingsFieldMetadata(TypedDict, total=False):
3434
display_default: Optional[str]
3535
deprecated: bool
36-
disallow_hard_code: bool
37-
"""Do not allow the field to be hard-coded in the pyproject table."""
36+
override_only: bool
37+
"""Do not allow the field to be a top-level table."""
3838

3939

4040
class CMakeSettingsDefine(str):
@@ -510,7 +510,7 @@ class ScikitBuildSettings:
510510
fail: Optional[bool] = dataclasses.field(
511511
default=None,
512512
metadata=SettingsFieldMetadata(
513-
disallow_hard_code=True,
513+
override_only=True,
514514
),
515515
)
516516
"""

src/scikit_build_core/settings/skbuild_overrides.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,20 @@ class OverrideRecord:
4040

4141
key: str
4242
"""Settings key that is overridden."""
43+
4344
original_value: Any | None
4445
"""
4546
Original value in the pyproject table.
4647
4748
If the pyproject table did not have the key, this is a ``None``.
4849
"""
50+
4951
value: Any
5052
"""Final value."""
53+
5154
passed_all: dict[str, str] | None
5255
"""All if statements that passed (except the effective ``match_any``)."""
56+
5357
passed_any: dict[str, str] | None
5458
"""All if.any statements that passed."""
5559

src/scikit_build_core/settings/skbuild_read_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def validate_field(
150150
"""Do the actual validation."""
151151
# Check if we had a hard-coded value in the record
152152
conf_key = field.name.replace("_", "-")
153-
if field.metadata.get("disallow_hard_code", False):
153+
if field.metadata.get("override_only", False):
154154
original_value = record.original_value if record else value
155155
if original_value is not None:
156156
msg = f"{prefix}{conf_key} is not allowed to be hard-coded in the pyproject.toml file"

0 commit comments

Comments
 (0)