|
107 | 107 | -h |
108 | 108 | Show help. |
109 | 109 | |
110 | | - -i <implementations> |
| 110 | + -I <implementations> |
111 | 111 | Set PyMuPDF implementations to test. |
112 | 112 | <implementations> must contain only these individual characters: |
113 | 113 | 'r' - rebased. |
114 | 114 | 'R' - rebased without optimisations. |
115 | 115 | Default is 'r'. Also see `PyMuPDF:tests/run_compound.py`. |
116 | 116 | |
| 117 | + -i <install_version> |
| 118 | + Set version installed by the 'install' command. |
| 119 | + |
117 | 120 | -k <expression> |
118 | 121 | Specify which test(s) to run; passed straight through to pytest's `-k`. |
119 | 122 | For example `-k test_3354`. |
@@ -298,6 +301,7 @@ def main(argv): |
298 | 301 | commands = list() |
299 | 302 | env_extra = dict() |
300 | 303 | implementations = 'r' |
| 304 | + install_version = None |
301 | 305 | mupdf_sync = None |
302 | 306 | os_names = list() |
303 | 307 | system_packages = False |
@@ -393,6 +397,9 @@ def main(argv): |
393 | 397 | show_help = True |
394 | 398 |
|
395 | 399 | elif arg == '-i': |
| 400 | + install_version = next(args) |
| 401 | + |
| 402 | + elif arg == '-I': |
396 | 403 | implementations = next(args) |
397 | 404 |
|
398 | 405 | elif arg == '-k': |
@@ -459,16 +466,12 @@ def main(argv): |
459 | 466 | venv = int(next(args)) |
460 | 467 | assert venv in (0, 1, 2), f'Invalid {venv=} should be 0, 1 or 2.' |
461 | 468 |
|
462 | | - elif arg in ('build', 'cibw', 'pyodide', 'test', 'wheel'): |
| 469 | + elif arg in ('build', 'cibw', 'install', 'pyodide', 'test', 'wheel'): |
463 | 470 | commands.append(arg) |
464 | 471 |
|
465 | 472 | elif arg == 'buildtest': |
466 | 473 | commands += ['build', 'test'] |
467 | 474 |
|
468 | | - elif arg == 'install': |
469 | | - _pymupdf = next(args) |
470 | | - commands.append(f'{arg}.{_pymupdf}') |
471 | | - |
472 | 475 | else: |
473 | 476 | assert 0, f'Unrecognised option/command: {arg=}.' |
474 | 477 |
|
@@ -530,9 +533,13 @@ def main(argv): |
530 | 533 | # Build wheel(s) with cibuildwheel. |
531 | 534 | cibuildwheel(env_extra, cibw_name, cibw_pyodide, cibw_sdist) |
532 | 535 |
|
533 | | - elif command.startswith('install.'): |
534 | | - name = command[len('install.'):] |
535 | | - run(f'pip install --force-reinstall {name}') |
| 536 | + elif command == 'install': |
| 537 | + p = 'pymupdf' |
| 538 | + if install_version: |
| 539 | + if not install_version.startswith(('==', '>=', '>')): |
| 540 | + p = f'{p}==' |
| 541 | + p = f'{p}{install_version}' |
| 542 | + run(f'pip install --force-reinstall {p}') |
536 | 543 | have_installed = True |
537 | 544 |
|
538 | 545 | elif command == 'test': |
|
0 commit comments