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

Function cibw_do_test_project

scripts/test.py:1004–1167  ·  view source on GitHub ↗
(
        env_extra,
        CIBW_BUILD,
        cibw_pyodide,
        cibw_pyodide_args,
        cibw_test_project_setjmp,
        )

Source from the content-addressed store, hash-verified

1002
1003
1004def cibw_do_test_project(
1005 env_extra,
1006 CIBW_BUILD,
1007 cibw_pyodide,
1008 cibw_pyodide_args,
1009 cibw_test_project_setjmp,
1010 ):
1011 testdir = f'{pymupdf_dir_abs}/cibw_test'
1012 shutil.rmtree(testdir, ignore_errors=1)
1013 os.mkdir(testdir)
1014 with open(f'{testdir}/setup.py', 'w') as f:
1015 f.write(textwrap.dedent(f'''
1016 import shutil
1017 import sys
1018 import os
1019 import pipcl
1020
1021 def build():
1022 so_leaf = pipcl.build_extension(
1023 name = 'foo',
1024 path_i = 'foo.i',
1025 outdir = 'build',
1026 source_extra = 'qwerty.cpp',
1027 py_limited_api = True,
1028 )
1029
1030 return [
1031 ('build/foo.py', 'foo/__init__.py'),
1032 (f'build/{{so_leaf}}', f'foo/'),
1033 ]
1034
1035 p = pipcl.Package(
1036 name = 'pymupdf-test',
1037 version = '1.2.3',
1038 fn_build = build,
1039 py_limited_api=True,
1040 )
1041
1042 def get_requires_for_build_wheel(config_settings=None):
1043 return ['swig']
1044
1045 build_wheel = p.build_wheel
1046 build_sdist = p.build_sdist
1047
1048 # Handle old-style setup.py command-line usage:
1049 if __name__ == '__main__':
1050 p.handle_argv(sys.argv)
1051 '''))
1052 with open(f'{testdir}/foo.i', 'w') as f:
1053 if cibw_test_project_setjmp:
1054 f.write(textwrap.dedent('''
1055 %{
1056 #include <stdexcept>
1057
1058 #include <assert.h>
1059 #include <setjmp.h>
1060 #include <stdio.h>
1061 #include <string.h>

Callers 1

cibuildwheelFunction · 0.85

Calls 2

runFunction · 0.70
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…