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

Function build

scripts/test.py:842–882  ·  view source on GitHub ↗
(
        env_extra,
        *,
        build_isolation,
        venv,
        wheel,
        )

Source from the content-addressed store, hash-verified

840
841
842def build(
843 env_extra,
844 *,
845 build_isolation,
846 venv,
847 wheel,
848 ):
849 log(f'{build_isolation=}')
850
851 if build_isolation is None:
852 # On OpenBSD libclang is not available on pypi.org, so we need to force
853 # use of system package py3-llvm with --no-build-isolation, manually
854 # installing other required packages.
855 build_isolation = False if platform.system() == 'OpenBSD' else True
856
857 if build_isolation:
858 # This is the default on non-OpenBSD.
859 build_isolation_text = ''
860 else:
861 # Not using build isolation - i.e. pip will not be using its own clean
862 # venv, so we need to explicitly install required packages. Manually
863 # install required packages from pyproject.toml.
864 sys.path.insert(0, os.path.abspath(f'{__file__}/../..'))
865 import setup
866 names = setup.get_requires_for_build_wheel()
867 del sys.path[0]
868 if names:
869 names = ' '.join(names)
870 if venv == 2:
871 run( f'python -m pip install --upgrade {names}')
872 else:
873 log(f'{venv=}: Not installing packages with pip: {names}')
874 build_isolation_text = ' --no-build-isolation'
875
876 if wheel:
877 new_files = pipcl.NewFiles(f'wheelhouse/*.whl')
878 run(f'pip wheel{build_isolation_text} -w wheelhouse -v {pymupdf_dir_abs}', env_extra=env_extra)
879 wheel = new_files.get_one()
880 run(f'pip install --force-reinstall {wheel}')
881 else:
882 run(f'pip install{build_isolation_text} -v --force-reinstall {pymupdf_dir_abs}', env_extra=env_extra)
883
884
885def cibuildwheel(

Callers 1

mainFunction · 0.70

Calls 3

get_oneMethod · 0.95
runFunction · 0.70
logFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…