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

Function get_mupdf_version

setup.py:1064–1075  ·  view source on GitHub ↗
(mupdf_dir)

Source from the content-addressed store, hash-verified

1062
1063
1064def get_mupdf_version(mupdf_dir):
1065 path = f'{mupdf_dir}/include/mupdf/fitz/version.h'
1066 with open(path) as f:
1067 text = f.read()
1068 v0 = re.search('#define FZ_VERSION_MAJOR ([0-9]+)', text)
1069 v1 = re.search('#define FZ_VERSION_MINOR ([0-9]+)', text)
1070 v2 = re.search('#define FZ_VERSION_PATCH ([0-9]+)', text)
1071 assert v0 and v1 and v2, f'Cannot find MuPDF version numbers in {path=}.'
1072 v0 = int(v0.group(1))
1073 v1 = int(v1.group(1))
1074 v2 = int(v2.group(1))
1075 return v0, v1, v2
1076
1077def _fs_update(text, path):
1078 try:

Callers 3

buildFunction · 0.85
build_mupdf_windowsFunction · 0.85
build_mupdf_unixFunction · 0.85

Calls 1

searchMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…