Closed Antiz96 closed 1 month ago
Thanks for the report. This is a little unexpected - every wheel in the 1.24.3 release passed all tests when it was built.
Could you describe exactly how you are building PyMuPDF?
Thanks for the report. This is a little unexpected - every wheel in the 1.24.3 release passed all tests when it was built.
Could you describe exactly how you are building PyMuPDF?
Thanks for your quick answer. The used build instructions are below:
local cflags=(
-I/usr/include
-I/usr/include/freetype2
-I/usr/include/harbuzz
-I/usr/include/mupdf
)
local ldflags=(
-lfreetype
-lgumbo
-lharfbuzz
-ljbig2dec
-ljpeg
-lleptonica
-lmupdf
-lopenjp2
-ltesseract
)
cd PyMuPDF-1.24.3
# build against system libmupdf
export PYMUPDF_SETUP_MUPDF_BUILD=''
# provide tessdata location
export TESSDATA_PREFIX="/usr/share/tessdata"
# build against mupdf's C++/ Python language bindings
export PYMUPDF_SETUP_IMPLEMENTATIONS=b
CFLAGS+=" ${cflags[@]}"
LDFLAGS+=" ${ldflags[@]}"
python -m build --wheel --no-isolation
Ah, you're building with a system install of MuPDF. In that case it would be useful to know the MuPDF version and how it was built.
In general we can't guarantee behaviour with non-default MuPDF versions/builds. See scripts/sysinstall.py
where it currently excludes these tests:
test_color_count test_3050 test_cli test_cli_out test_pylint test_textbox3
Ah, you're building with a system install of MuPDF. In that case it would be useful to know the MuPDF version and how it was built.
Indeed. This is MuPDF v1.24.1 built with the following (here again, built with some system libraries):
{
printf "LINUX_OR_OPENBSD := yes\n" # required so that Makefile sets soname symlink
printf "USE_SYSTEM_CURL := yes\n"
printf "USE_SYSTEM_FREETYPE := yes\n"
printf "USE_SYSTEM_GLUT := yes\n"
printf "USE_SYSTEM_GUMBO := yes\n"
printf "USE_SYSTEM_HARFBUZZ := yes\n"
printf "USE_SYSTEM_JBIG2DEC := yes\n"
printf "USE_SYSTEM_JPEGXR := yes\n" # not used without HAVE_JPEGXR
printf "USE_SYSTEM_LCMS2 := no\n" # need lcms2-art fork
printf "USE_SYSTEM_LEPTONICA := yes\n"
printf "USE_SYSTEM_LIBJPEG := yes\n"
printf "USE_SYSTEM_LIBS := yes\n"
printf "USE_SYSTEM_MUJS := no\n" # needs patch to debundle
printf "USE_SYSTEM_OPENJPEG := yes\n"
printf "USE_SYSTEM_TESSERACT := yes\n"
printf "USE_SYSTEM_ZLIB := yes\n"
printf "USE_TESSERACT := yes\n"
} > user.make
cd mupdf
make -j1 VENV_FLAG= shared=yes build=release libs apps c++ python
In general we can't guarantee behaviour with non-default MuPDF versions/builds. See
scripts/sysinstall.py
where it currently excludes these tests:
test_color_count test_3050 test_cli test_cli_out test_pylint test_textbox3
Fair enough, thanks for the info! Since text_textbox3
is in that list, I guess I can close https://github.com/pymupdf/PyMuPDF/issues/3398 (which uses the same build environment).
I have created a PR to update expectations for this test with MuPDF 1.24.0 and 1.24.1. So tests should pass fine for you after it's been merged - hopefully in the next day or so.
Alright, thanks for your quick actions! :slightly_smiling_face:
My PR has been merged now.
However it's been pointed out to me that we probably shouldn't simply allow the test to succeed with MuPDF-1.24.1.
The test is for an important feature in PyMuPDF-1.24.3, ensuring worry-free object inserts. Packaging with a MuPDF that is older than the specified version will result in behaviour that differs from what is documented for PyMuPDF-1.24.3, which will cause confusion.
There's probably no easy answer here, but we might want to encourage a later MuPDF to be used if this sort of thing happens again.
My PR has been merged now.
Alright, thanks!
However it's been pointed out to me that we probably shouldn't simply allow the test to succeed with MuPDF-1.24.1.
The test is for an important feature in PyMuPDF-1.24.3, ensuring worry-free object inserts. Packaging with a MuPDF that is older than the specified version will result in behaviour that differs from what is documented for PyMuPDF-1.24.3, which will cause confusion.
I'm confused... At the time I'm writing those lines, MuPDF-1.24.1 seems to be the latest version available. Am I missing something or does that mean that PyMuPDF-1.24.3 expects a version of MuPDF that has not been released yet?
Ah, latest PyMuPDF in git, and current release PyMuPDF-1.24.3, hard-codes https://mupdf.com/downloads/archive/mupdf-1.24.2-source.tar.gz.
But it looks like the MuPDF tag 1.24.2 hasn't been pushed yet. Thanks for pointing this out, i'm chatting to the mupdf people so it'll get pushed soon.
Thanks for pushing the MuPDF 1.24.2 tag. I confirm rebuilding PyMUDF 1.24.3 against it solved the issue :)
Great, i'm glad it's working for you now.
Description of the bug
Hello,
The test_q_count (in test_balance_count.py) is failing with v1.24.3:
I remain available if needed :)
cc @dvzrv
How to reproduce the bug
build pymupdf v1.24.2 Run tests and see the above one failing
PyMuPDF version
1.24.3
Operating system
Linux
Python version
3.12