Downloads and/or extracts mupdf and returns (path, location) where `path` is the local mupdf directory and `location` is where it came from. Exact behaviour depends on environmental variable PYMUPDF_SETUP_MUPDF_BUILD; see docs at start of this file for details.
(path=None, sha=None)
| 545 | |
| 546 | |
| 547 | def get_mupdf(path=None, sha=None): |
| 548 | ''' |
| 549 | Downloads and/or extracts mupdf and returns (path, location) where `path` |
| 550 | is the local mupdf directory and `location` is where it came from. |
| 551 | |
| 552 | Exact behaviour depends on environmental variable |
| 553 | PYMUPDF_SETUP_MUPDF_BUILD; see docs at start of this file for details. |
| 554 | ''' |
| 555 | m = os.environ.get('PYMUPDF_SETUP_MUPDF_BUILD') |
| 556 | if m == '-': |
| 557 | # This allows easy specification in Github actions. |
| 558 | m = None |
| 559 | if m is None and os.path.isfile(mupdf_tgz): |
| 560 | # This makes us use tgz inside sdist. |
| 561 | log(f'Using local tgz: {mupdf_tgz=}') |
| 562 | return get_mupdf_internal('dir', local_tgz=mupdf_tgz) |
| 563 | return get_mupdf_internal('dir', m) |
| 564 | |
| 565 | |
| 566 | linux = sys.platform.startswith( 'linux') or 'gnu' in sys.platform |
no test coverage detected
searching dependent graphs…