Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Change Log

* **Fixed** `4699 <https://github.com/pymupdf/PyMuPDF/issues/4699>`_: cannot find ExtGState resource
* **Fixed** `4712 <https://github.com/pymupdf/PyMuPDF/issues/4712>`_: Crash with "corrupted double-linked list"
* **Fixed** `4720 <https://github.com/pymupdf/PyMuPDF/issues/4720>`_: Memory leaking in rewrite_images?
* **Fixed** `4742 <https://github.com/pymupdf/PyMuPDF/issues/4742>`_: 'Rect' object has no attribute 'get_area'
* **Fixed** `4746 <https://github.com/pymupdf/PyMuPDF/issues/4746>`_: Document.__init__() got an unexpected keyword argument 'encoding'

Expand Down
15 changes: 11 additions & 4 deletions scripts/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,17 @@
--graal
Use graal - run inside a Graal VM instead of a Python venv.
As of 2025-08-04 we:
* Clone the latest pyenv and build it.
* Use pyenv to install graalpy.
* Use graalpy to create venv.
As of 2025-08-04, if specified:
* We assert-fail if cibw and non-cibw commands are specified.
* If `cibw` is specified:
* We use a conventional venv.
* We set CIBW_ENABLE=graalpy.
* We set CIBW_BUILD = 'gp*'.
* Otherwise:
* We don't create a conventional venv.
* Clone the latest pyenv and build it.
* Use pyenv to install graalpy.
* Use graalpy to create venv.
[After the first time, suggest `-v 1` to avoid delay from
updating/building pyenv and recreating the graal venv.]
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,8 @@ def platform_release_tuple():
elif openbsd:
print(f'OpenBSD: pip install of swig does not build; assuming `pkg_add swig`.')
else:
ret.append( 'swig')
# 2025-10-27: new swig-4.4.0 fails badly at runtime.
ret.append( 'swig==4.3.1')
return ret


Expand Down
31 changes: 30 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,40 @@
import copy
import os
import platform
import subprocess
import sys

import pytest

# Install required packages. There doesn't seem to be any official way for
# us to programmatically specify required test packages in setup.py, or in
# pytest. Doing it here seems to be the least ugly approach.
#
# However our diagnostics do not show up so this can cause an unfortunate pause
# before tests start to run.
#
def install_required_packages():
packages = 'pytest fontTools pymupdf-fonts flake8 pylint codespell'
if platform.system() == 'Windows' and int.bit_length(sys.maxsize+1) == 32:
# No pillow wheel available, and doesn't build easily.
pass
else:
packages += ' pillow'
if platform.system().startswith('MSYS_NT-'):
# psutil not available on msys2.
pass
else:
packages += ' psutil'
command = f'pip install --upgrade {packages}'
print(f'{__file__}:install_required_packages)(): Running: {command}', flush=1)
subprocess.run(command, shell=1, check=1)

install_required_packages()

# Need to import pymupdf only after we've installed pymupdf-fonts above,
# because pymupdf imports pymupdf_fonts, and copes with import failure.
import pymupdf

import pytest

PYMUPDF_PYTEST_RESUME = os.environ.get('PYMUPDF_PYTEST_RESUME')

Expand Down