Skip to content

Commit 3013831

Browse files
scripts/test.py: fix install command and import of gh_release with cibuildwheel.
1 parent 0c5bc64 commit 3013831

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

scripts/test.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
--help
9292
-h
9393
Show help.
94+
9495
-i <implementations>
9596
Set PyMuPDF implementations to test.
9697
<implementations> must contain only these individual characters:
@@ -109,7 +110,6 @@
109110
specified PyMuPDF will download its default mupdf .tgz.]
110111
111112
-M 0|1
112-
113113
--build-mupdf 0|1
114114
Whether to rebuild mupdf when we build PyMuPDF. Default is 1.
115115
@@ -233,8 +233,6 @@
233233
Is prepended to command line args.
234234
'''
235235

236-
import gh_release
237-
238236
import glob
239237
import os
240238
import platform
@@ -253,6 +251,13 @@
253251
finally:
254252
del sys.path[0]
255253

254+
try:
255+
sys.path.insert(0, f'{pymupdf_dir_abs}/scripts')
256+
import gh_release
257+
finally:
258+
del sys.path[0]
259+
260+
256261
pymupdf_dir = pipcl.relpath(pymupdf_dir_abs)
257262

258263
log = pipcl.log0
@@ -491,7 +496,7 @@ def main(argv):
491496
cibuildwheel(env_extra, cibw_name, cibw_pyodide)
492497

493498
elif command.startswith('install.'):
494-
name = command.lstrip('install.')
499+
name = command[len('install.'):]
495500
run(f'pip install --force-reinstall {name}')
496501
have_installed = True
497502

0 commit comments

Comments
 (0)