MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / get_mupdf

Function get_mupdf

setup.py:547–563  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

545
546
547def 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
566linux = sys.platform.startswith( 'linux') or 'gnu' in sys.platform

Callers 2

buildFunction · 0.85
cleanFunction · 0.85

Calls 3

get_mupdf_internalFunction · 0.85
logFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…