Skip to content

Commit 6f7b5ab

Browse files
scripts/test.py: various
* Always set env_extra instead of os.environ. * Updates to match new pipcl.git_get(). * Fixed handling of local MuPDF directory with cibw and Linux. We now use /host/<PYMUPDF_SETUP_MUPDF_BUILD> within manylinux docker.
1 parent 87975bf commit 6f7b5ab

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

scripts/test.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -520,12 +520,12 @@ def main(argv):
520520
elif _mupdf.startswith(':'):
521521
_branch = _mupdf[1:]
522522
_mupdf = f'git:--branch {_branch} https://github.com/ArtifexSoftware/mupdf.git'
523-
os.environ['PYMUPDF_SETUP_MUPDF_BUILD'] = _mupdf
523+
env_extra['PYMUPDF_SETUP_MUPDF_BUILD'] = _mupdf
524524
elif _mupdf.startswith('git:') or '://' in _mupdf:
525-
os.environ['PYMUPDF_SETUP_MUPDF_BUILD'] = _mupdf
525+
env_extra['PYMUPDF_SETUP_MUPDF_BUILD'] = _mupdf
526526
else:
527527
assert os.path.isdir(_mupdf), f'Not a directory: {_mupdf=}'
528-
os.environ['PYMUPDF_SETUP_MUPDF_BUILD'] = os.path.abspath(_mupdf)
528+
env_extra['PYMUPDF_SETUP_MUPDF_BUILD'] = os.path.abspath(_mupdf)
529529
mupdf_sync = _mupdf
530530

531531
elif arg == '--mupdf-clean':
@@ -634,7 +634,7 @@ def main(argv):
634634
if venv == 1 and os.path.exists(pyenv_dir) and os.path.exists(venv_name):
635635
log(f'{venv=} and {venv_name=} already exists so not building pyenv or creating venv.')
636636
else:
637-
pipcl.git_get('https://github.com/pyenv/pyenv.git', pyenv_dir, branch='master')
637+
pipcl.git_get(pyenv_dir, remote='https://github.com/pyenv/pyenv.git', branch='master')
638638
run(f'cd {pyenv_dir} && src/configure && make -C src')
639639
run(f'which pyenv')
640640
run(f'pyenv install -v -s {graalpy}')
@@ -678,6 +678,13 @@ def main(argv):
678678

679679
elif command == 'cibw':
680680
# Build wheel(s) with cibuildwheel.
681+
682+
if platform.system() == 'Linux':
683+
PYMUPDF_SETUP_MUPDF_BUILD = env_extra.get('PYMUPDF_SETUP_MUPDF_BUILD')
684+
if PYMUPDF_SETUP_MUPDF_BUILD and not PYMUPDF_SETUP_MUPDF_BUILD.startswith('git:'):
685+
assert PYMUPDF_SETUP_MUPDF_BUILD.startswith('/')
686+
env_extra['PYMUPDF_SETUP_MUPDF_BUILD'] = f'/host/{PYMUPDF_SETUP_MUPDF_BUILD}'
687+
681688
cibuildwheel(
682689
env_extra,
683690
cibw_name or 'cibuildwheel',

0 commit comments

Comments
 (0)