MCPcopy Index your code
hub / github.com/pymupdf/PyMuPDF / build

Function build

scripts/gh_release.py:180–498  ·  view source on GitHub ↗
( platform_=None, valgrind=False)

Source from the content-addressed store, hash-verified

178
179
180def build( platform_=None, valgrind=False):
181 log( '### build():')
182
183 platform_arg = f' --platform {platform_}' if platform_ else ''
184
185 # Parameters are in os.environ, as that seems to be the only way that
186 # Github workflow .yml files can encode them.
187 #
188 def get_bool(name, default=0):
189 v = os.environ.get(name)
190 if v in ('1', 'true'):
191 return 1
192 elif v in ('0', 'false'):
193 return 0
194 elif v is None:
195 return default
196 else:
197 assert 0, f'Bad environ {name=} {v=}'
198 inputs_flavours = get_bool('inputs_flavours', 1)
199 inputs_sdist = get_bool('inputs_sdist')
200 inputs_skeleton = os.environ.get('inputs_skeleton')
201 inputs_wheels_default = get_bool('inputs_wheels_default', 1)
202 inputs_wheels_linux_aarch64 = get_bool('inputs_wheels_linux_aarch64', inputs_wheels_default)
203 inputs_wheels_linux_auto = get_bool('inputs_wheels_linux_auto', inputs_wheels_default)
204 inputs_wheels_linux_pyodide = get_bool('inputs_wheels_linux_pyodide', 0)
205 inputs_wheels_macos_arm64 = get_bool('inputs_wheels_macos_arm64', 0)
206 inputs_wheels_macos_auto = get_bool('inputs_wheels_macos_auto', inputs_wheels_default)
207 inputs_wheels_windows_auto = get_bool('inputs_wheels_windows_auto', inputs_wheels_default)
208 inputs_wheels_cps = os.environ.get('inputs_wheels_cps')
209 inputs_PYMUPDF_SETUP_MUPDF_BUILD = os.environ.get('inputs_PYMUPDF_SETUP_MUPDF_BUILD')
210 inputs_PYMUPDF_SETUP_MUPDF_BUILD_TYPE = os.environ.get('inputs_PYMUPDF_SETUP_MUPDF_BUILD_TYPE')
211
212 PYMUPDF_SETUP_PY_LIMITED_API = os.environ.get('PYMUPDF_SETUP_PY_LIMITED_API')
213
214 log( f'{inputs_flavours=}')
215 log( f'{inputs_sdist=}')
216 log( f'{inputs_skeleton=}')
217 log( f'{inputs_wheels_default=}')
218 log( f'{inputs_wheels_linux_aarch64=}')
219 log( f'{inputs_wheels_linux_auto=}')
220 log( f'{inputs_wheels_linux_pyodide=}')
221 log( f'{inputs_wheels_macos_arm64=}')
222 log( f'{inputs_wheels_macos_auto=}')
223 log( f'{inputs_wheels_windows_auto=}')
224 log( f'{inputs_wheels_cps=}')
225 log( f'{inputs_PYMUPDF_SETUP_MUPDF_BUILD=}')
226 log( f'{inputs_PYMUPDF_SETUP_MUPDF_BUILD_TYPE=}')
227 log( f'{PYMUPDF_SETUP_PY_LIMITED_API=}')
228
229 # Build Pyodide wheel if specified.
230 #
231 if platform.system() == 'Linux' and inputs_wheels_linux_pyodide:
232 # Pyodide wheels are built by running scripts/test.py, not
233 # cibuildwheel.
234 command = f'{sys.executable} scripts/test.py -P 1'
235 if inputs_PYMUPDF_SETUP_MUPDF_BUILD:
236 command += f' -m {shlex.quote(inputs_PYMUPDF_SETUP_MUPDF_BUILD)}'
237 command += ' pyodide_wheel'

Callers 1

mainFunction · 0.70

Calls 9

get_boolFunction · 0.85
set_if_unsetFunction · 0.85
make_stringFunction · 0.85
env_passFunction · 0.85
env_setFunction · 0.85
set_cibuild_testFunction · 0.85
runFunction · 0.70
logFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…