Skip to content

Commit 3832ee9

Browse files
committed
Move wheel.repair to be a section
Signed-off-by: Cristian Le <git@lecris.dev>
1 parent fb21313 commit 3832ee9

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
@@ -182,6 +182,14 @@ class SDistSettings:
182182
"""
183183

184184

185+
@dataclasses.dataclass
186+
class WheelRepair:
187+
enable: bool = False
188+
"""
189+
EXPERIMENTAL: Do automatic repairs of the compiled binaries and libraries.
190+
"""
191+
192+
185193
@dataclasses.dataclass
186194
class WheelSettings:
187195
packages: Optional[Union[List[str], Dict[str, str]]] = dataclasses.field(
@@ -254,9 +262,9 @@ class WheelSettings:
254262
The build tag to use for the wheel. If empty, no build tag is used.
255263
"""
256264

257-
repair: bool = False
265+
repair: WheelRepair = dataclasses.field(default_factory=WheelRepair)
258266
"""
259-
EXPERIMENTAL: Do automatic repairs of the compiled binaries and libraries.
267+
Wheel repair options
260268
"""
261269

262270

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)