Skip to content

Commit 6ddb7c4

Browse files
committed
Move wheel.repair to be a section
Signed-off-by: Cristian Le <git@lecris.dev>
1 parent 64c1deb commit 6ddb7c4

File tree

7 files changed

+38
-14
lines changed

7 files changed

+38
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ wheel.exclude = []
221221
wheel.build-tag = ""
222222

223223
# Do automatic repairs of the compiled binaries and libraries.
224-
wheel.repair = false
224+
wheel.repair.enable = false
225225

226226
# If CMake is less than this value, backport a copy of FindPython.
227227
backport.find-python = "3.26.1"

docs/reference/configs.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,10 @@ print(mk_skbuild_docs())
574574
This value is used to construct ``SKBUILD_SABI_COMPONENT`` CMake variable.
575575
```
576576

577+
## wheel.repair
578+
577579
```{eval-rst}
578-
.. confval:: wheel.repair
580+
.. confval:: wheel.repair.enable
579581
:type: ``bool``
580582
:default: false
581583

src/scikit_build_core/build/wheel.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,11 @@ def _build_wheel_impl_impl(
496496
),
497497
wheel_dirs["metadata"],
498498
) as wheel:
499-
if cmake is not None and settings.wheel.repair and settings.experimental:
499+
if (
500+
cmake is not None
501+
and settings.wheel.repair.enable
502+
and settings.experimental
503+
):
500504
repairer = WheelRepairer.get_wheel_repairer(
501505
wheel=wheel,
502506
builder=builder,

src/scikit_build_core/builder/get_requires.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def other_dynamic_requires(self) -> Generator[str, None, None]:
147147
)
148148
)
149149

150-
if self.settings.wheel.repair:
150+
if self.settings.wheel.repair.enable:
151151
platform_system = platform.system()
152152
if platform_system == "Linux":
153153
yield "auditwheel"

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,16 @@
241241
"description": "The build tag to use for the wheel. If empty, no build tag is used."
242242
},
243243
"repair": {
244-
"type": "boolean",
245-
"default": false,
246-
"description": "Do automatic repairs of the compiled binaries and libraries."
244+
"type": "object",
245+
"additionalProperties": false,
246+
"properties": {
247+
"enable": {
248+
"type": "boolean",
249+
"default": false,
250+
"description": "Do automatic repairs of the compiled binaries and libraries."
251+
}
252+
},
253+
"description": "Wheel repair options"
247254
}
248255
}
249256
},
@@ -571,6 +578,9 @@
571578
},
572579
"exclude": {
573580
"$ref": "#/$defs/inherit"
581+
},
582+
"repair": {
583+
"$ref": "#/$defs/inherit"
574584
}
575585
}
576586
},

src/scikit_build_core/settings/skbuild_model.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,17 @@ class SDistSettings:
222222
"""
223223

224224

225+
@dataclasses.dataclass
226+
class WheelRepair:
227+
enable: bool = False
228+
"""
229+
Do automatic repairs of the compiled binaries and libraries.
230+
231+
.. warning::
232+
This is an experimental feature gated by :confval:`experimental`
233+
"""
234+
235+
225236
@dataclasses.dataclass
226237
class WheelSettings:
227238
packages: Optional[Union[List[str], Dict[str, str]]] = dataclasses.field(
@@ -314,12 +325,9 @@ class WheelSettings:
314325
The build tag to use for the wheel. If empty, no build tag is used.
315326
"""
316327

317-
repair: bool = False
328+
repair: WheelRepair = dataclasses.field(default_factory=WheelRepair)
318329
"""
319-
Do automatic repairs of the compiled binaries and libraries.
320-
321-
.. warning::
322-
This is an experimental feature gated by :confval:`experimental`
330+
Wheel repair options
323331
"""
324332

325333

tests/packages/repair_wheel/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ dependencies = ["base_project"]
1010
[tool.scikit-build]
1111
build.requires = ["base_project @ {root:uri}/extern"]
1212
wheel.install-dir = "repair_wheel"
13-
wheel.repair = true
13+
wheel.repair.enable = true
1414
experimental = true
1515

1616
[project.scripts]
1717
main = "repair_wheel.__main__:run"
1818

1919
[[tool.scikit-build.overrides]]
2020
if.env.MANUAL = true
21-
wheel.repair = false
21+
wheel.repair.enable = false
2222
cmake.define.DO_MANUAL_REPAIR = true

0 commit comments

Comments
 (0)