Jules - support pyodide builds with cibuildwheel, support for graal.#4643
Merged
Conversation
We can't run child processes on Pyodide, so for testing we import pytest and call pytest.main().
We need to specify pytest in requires_dist if on pyodide, because we cannot `pip install` it ourselves because child processes are not supported. Set extra compile/link flags for pyodide, including in XCFLAGS and XCXXFLAGS, for building MuPDF.
Graal builds work by deferring to a non-graal build with graal-python's include
and library paths.
Other:
run():
Added <prefix> arg, output with prefix for each line.
Added <env> arg so caller can use a subset of os.environ.
Removed <shell> arg - we always use text command, not list of args.
Use run()'s <prefix> when running some commands.
build_extension(): allow swig=None to default to 'swig'.
git_get(): allow 'git:' string to override/specify remote/branch/tag.
PythonFlags:
Added experimental code using sysconfig.*() instead of python-config
command.
swig_get(): new, useful when wanting to use latest/specific swig.
See new arg `--graal`. Also: * support venv=3 - delete any existing venv. * support clean mupdf builds. * support custom swig command.
Also use pipcl.py's logging and run() directly.
tests/test_pixmap.py:
test_2093: exclude on graal because slow.
tests/conftest.py:
don't show or check fds on graal because lots of failures.
tests/test_tables.py:
test_2979() is slow on graal.
test_add_lines() seems to break tests/conftest.py's resetting and checking
of global state for each test. For example after test_add_lines(),
pymupdf.TOOLS.set_small_glyph_heights() always seeme to return true, so all
later tests are marked as ERROR.
JorjMcKie
approved these changes
Aug 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.