Skip to content

Jules - support pyodide builds with cibuildwheel, support for graal.#4643

Merged
julian-smith-artifex-com merged 10 commits into
mainfrom
jules
Aug 8, 2025
Merged

Jules - support pyodide builds with cibuildwheel, support for graal.#4643
julian-smith-artifex-com merged 10 commits into
mainfrom
jules

Conversation

@julian-smith-artifex-com
Copy link
Copy Markdown
Collaborator

No description provided.

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.
@julian-smith-artifex-com julian-smith-artifex-com merged commit 960257e into main Aug 8, 2025
3 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants