Skip to content

Commit d3c68b2

Browse files
committed
Move wheel.repair to be a section
Signed-off-by: Cristian Le <[email protected]>
1 parent 10105cc commit d3c68b2

File tree

6 files changed

+28
-10
lines changed

6 files changed

+28
-10
lines changed

README.md

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

260260
# EXPERIMENTAL: Do automatic repairs of the compiled binaries and libraries.
261-
wheel.repair = false
261+
wheel.repair.enable = false
262262

263263
# If CMake is less than this value, backport a copy of FindPython. Set to 0
264264
# disable this, or the empty string.

src/scikit_build_core/build/wheel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ def _build_wheel_impl_impl(
488488
),
489489
wheel_dirs["metadata"],
490490
) as wheel:
491-
if cmake is not None and settings.wheel.repair:
491+
if cmake is not None and settings.wheel.repair.enable:
492492
repairer = WheelRepairer.get_wheel_repairer(
493493
wheel=wheel,
494494
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": "EXPERIMENTAL: 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": "EXPERIMENTAL: 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: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,14 @@ class SDistSettings:
172172
"""
173173

174174

175+
@dataclasses.dataclass
176+
class WheelRepair:
177+
enable: bool = False
178+
"""
179+
EXPERIMENTAL: Do automatic repairs of the compiled binaries and libraries.
180+
"""
181+
182+
175183
@dataclasses.dataclass
176184
class WheelSettings:
177185
packages: Optional[Union[List[str], Dict[str, str]]] = None
@@ -239,9 +247,9 @@ class WheelSettings:
239247
The build tag to use for the wheel. If empty, no build tag is used.
240248
"""
241249

242-
repair: bool = False
250+
repair: WheelRepair = dataclasses.field(default_factory=WheelRepair)
243251
"""
244-
EXPERIMENTAL: Do automatic repairs of the compiled binaries and libraries.
252+
Wheel repair options
245253
"""
246254

247255

tests/packages/repair_wheel/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ 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

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

1818
[[tool.scikit-build.overrides]]
1919
if.env.MANUAL = true
20-
wheel.repair = false
20+
wheel.repair.enable = false
2121
cmake.define.DO_MANUAL_REPAIR = true

0 commit comments

Comments
 (0)