From 3a01de24b7102448b3cc2cd81ba60a88b5fd9d42 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Mon, 23 Feb 2026 22:24:24 +0000 Subject: [PATCH 1/3] tests/conftest.py: add some platform details to any junit .xml file. --- tests/conftest.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 44c5e4d02..c79e69906 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -38,6 +38,11 @@ def install_required_packages(): install_required_packages() + +@pytest.fixture(scope="session", autouse=True) +def log_global_env_facts(record_testsuite_property): + record_testsuite_property('platform.python_version()', platform.python_version()) + # Need to import pymupdf only after we've installed pymupdf-fonts above, # because pymupdf imports pymupdf_fonts, and copes with import failure. import pymupdf From af559dcb6ee3b7d4252aa23540b1a8a9f0a89ec2 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Tue, 24 Feb 2026 09:57:41 +0000 Subject: [PATCH 2/3] setup.py: fixed handling of --clean if mupdf is not within pymupdf checkout. --- setup.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index d09be30cf..617cd47df 100755 --- a/setup.py +++ b/setup.py @@ -1218,14 +1218,19 @@ def clean(all_): ret.append(f'{g_root}/src/build') path_mupdf, _ = get_mupdf() - ret.append(f'{path_mupdf}/platform/c++') - ret.append(f'{path_mupdf}/platform/python') + + # We remove mupdf directories directly with shutil.rmtree() instead of + # returning them to pipcl, because pipcl will deliberately fail if asked to + # remove things that are outside our checkout. + shutil.rmtree(f'{path_mupdf}/platform/c++', ignore_errors=True) + shutil.rmtree(f'{path_mupdf}/platform/python', ignore_errors=True) + if all_: # Clean mupdf C library. - ret.append(f'{path_mupdf}/build') - ret.append(f'{path_mupdf}/platform/win32') - ret.append(f'{path_mupdf}/platform/win32/Release') - ret.append(f'{path_mupdf}/platform/win32/x64') + shutil.rmtree(f'{path_mupdf}/build', ignore_errors=True) + shutil.rmtree(f'{path_mupdf}/platform/win32', ignore_errors=True) + shutil.rmtree(f'{path_mupdf}/platform/win32/Release', ignore_errors=True) + shutil.rmtree(f'{path_mupdf}/platform/win32/x64', ignore_errors=True) pipcl.log(f'Returning: {ret=}') return ret @@ -1441,6 +1446,7 @@ def platform_release_tuple(): elif darwin or os.environ.get('PYODIDE_ROOT'): # 2025-10-27: new swig-4.4.0 fails badly at runtime on macos. # 2025-11-06: similar for pyodide. + # 2026-02-24: Stil fails badly on macos with swig 4.4.1. ret.append('swig==4.3.1') else: ret.append('swig') From 7f4526f24da05ed310182e67458ec92d0dd25b02 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Tue, 24 Feb 2026 13:40:03 +0000 Subject: [PATCH 3/3] setup.py: use latest swig on macos. --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 617cd47df..ff037a496 100755 --- a/setup.py +++ b/setup.py @@ -1443,10 +1443,10 @@ def platform_release_tuple(): print(f'OpenBSD: pip install of swig does not build; assuming `pkg_add swig`.') elif PYMUPDF_SETUP_SWIG: pass - elif darwin or os.environ.get('PYODIDE_ROOT'): + elif os.environ.get('PYODIDE_ROOT'): # 2025-10-27: new swig-4.4.0 fails badly at runtime on macos. # 2025-11-06: similar for pyodide. - # 2026-02-24: Stil fails badly on macos with swig 4.4.1. + # 2026-02-24: Appears to work on macos with swig 4.4.1. ret.append('swig==4.3.1') else: ret.append('swig')