Skip to content

Commit 5c5672e

Browse files
jcfrthewtex
authored andcommitted
windows_build_wheels: Support building specific wheels
1 parent ef19a10 commit 5c5672e

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

scripts/windows_build_wheels.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def build_wrapped_itk(
100100
check_call([ninja_executable])
101101

102102

103-
def build_wheel(python_version, single_wheel=False, cleanup=False):
103+
def build_wheel(python_version, single_wheel=False, cleanup=False, wheel_names=None):
104104
venv_dir = os.path.join(ROOT_DIR, "venv-%s" % python_version)
105105

106106
python_executable = os.path.join(venv_dir, "Scripts", "python.exe")
@@ -176,9 +176,11 @@ def build_wheel(python_version, single_wheel=False, cleanup=False):
176176
python_executable, python_include_dir, python_library)
177177

178178
# Build wheels
179-
with open(os.path.join(SCRIPT_DIR, "WHEEL_NAMES.txt"), "r") as content:
180-
wheel_names = [wheel_name.strip()
181-
for wheel_name in content.readlines()]
179+
if wheel_names is None:
180+
with open(os.path.join(SCRIPT_DIR, "WHEEL_NAMES.txt"), "r") \
181+
as content:
182+
wheel_names = [wheel_name.strip()
183+
for wheel_name in content.readlines()]
182184

183185
for wheel_name in wheel_names:
184186
# Configure setup.py
@@ -228,7 +230,7 @@ def test_wheels(single_wheel=False):
228230
pass
229231

230232

231-
def build_wheels(py_envs=None, single_wheel=False, cleanup=False):
233+
def build_wheels(py_envs=None, single_wheel=False, cleanup=False, wheel_names=None):
232234

233235
if py_envs is None:
234236
py_envs = ["27-x64", "35-x64", "36-x64"]
@@ -257,13 +259,15 @@ def build_wheels(py_envs=None, single_wheel=False, cleanup=False):
257259

258260
# Compile wheels re-using standalone project and archive cache
259261
for py_env in py_envs:
260-
build_wheel(py_env, single_wheel=single_wheel, cleanup=cleanup)
262+
build_wheel(
263+
py_env, single_wheel=single_wheel, cleanup=cleanup, wheel_names=wheel_names)
261264

262265

263-
def main(cleanup=True):
266+
def main(wheel_names=None, cleanup=True):
264267
single_wheel = False
265268

266-
build_wheels(single_wheel=single_wheel, cleanup=cleanup)
269+
build_wheels(
270+
single_wheel=single_wheel, cleanup=cleanup, wheel_names=wheel_names)
267271
fixup_wheels()
268272
test_wheels(single_wheel=single_wheel)
269273

0 commit comments

Comments
 (0)