File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 176176 Default is 'r'. Also see `PyMuPDF:tests/run_compound.py`.
177177
178178 -i <install_version>
179- Set version installed by the 'install' command.
179+ Controls behaviour of `install` command:
180+
181+ * If <install_version> ends with `.whl` we use `pip install
182+ <install_version>`.
183+ * If <install_version> starts with == or >= or >, we use `pip install
184+ pymupdf<install_version>`.
185+ * Otherwise we use `pip install pymupdf==<install_version>`.
180186
181187 -k <expression>
182188 Specify which test(s) to run; passed straight through to pytest's `-k`.
@@ -684,9 +690,12 @@ def main(argv):
684690 elif command == 'install' :
685691 p = 'pymupdf'
686692 if install_version :
687- if not install_version .startswith (('==' , '>=' , '>' )):
688- p = f'{ p } =='
689- p = f'{ p } { install_version } '
693+ if install_version .endswith ('.whl' ):
694+ p = install_version
695+ elif install_version .startswith (('==' , '>=' , '>' )):
696+ p = f'{ p } { install_version } '
697+ else :
698+ p = f'{ p } =={ install_version } '
690699 run (f'pip install --force-reinstall { p } ' )
691700 have_installed = True
692701
You can’t perform that action at this time.
0 commit comments