Skip to content

Jules - minor changes #4609

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 15, 2025
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 @@ -33,6 +33,7 @@ Change Log
* **Fixed** `4520 <https://github.com/pymupdf/PyMuPDF/issues/4520>`_: show_pdf_page does not like empty pages created by new_page
* **Fixed** `4524 <https://github.com/pymupdf/PyMuPDF/issues/4524>`_: fitz.get_text ignores 'pages' kwarg
* **Fixed** `4412 <https://github.com/pymupdf/PyMuPDF/issues/4412>`_: Regression? Spurious error? in insert_pdf in v1.25.4
* **Fixed** `4496 <https://github.com/pymupdf/PyMuPDF/issues/4496>`_: pymupdf4llm with pymupdfpro

* Other:

Expand Down
25 changes: 16 additions & 9 deletions scripts/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,16 @@
-h
Show help.

-i <implementations>
-I <implementations>
Set PyMuPDF implementations to test.
<implementations> must contain only these individual characters:
'r' - rebased.
'R' - rebased without optimisations.
Default is 'r'. Also see `PyMuPDF:tests/run_compound.py`.

-i <install_version>
Set version installed by the 'install' command.

-k <expression>
Specify which test(s) to run; passed straight through to pytest's `-k`.
For example `-k test_3354`.
Expand Down Expand Up @@ -298,6 +301,7 @@ def main(argv):
commands = list()
env_extra = dict()
implementations = 'r'
install_version = None
mupdf_sync = None
os_names = list()
system_packages = False
Expand Down Expand Up @@ -393,6 +397,9 @@ def main(argv):
show_help = True

elif arg == '-i':
install_version = next(args)

elif arg == '-I':
implementations = next(args)

elif arg == '-k':
Expand Down Expand Up @@ -459,16 +466,12 @@ def main(argv):
venv = int(next(args))
assert venv in (0, 1, 2), f'Invalid {venv=} should be 0, 1 or 2.'

elif arg in ('build', 'cibw', 'pyodide', 'test', 'wheel'):
elif arg in ('build', 'cibw', 'install', 'pyodide', 'test', 'wheel'):
commands.append(arg)

elif arg == 'buildtest':
commands += ['build', 'test']

elif arg == 'install':
_pymupdf = next(args)
commands.append(f'{arg}.{_pymupdf}')

else:
assert 0, f'Unrecognised option/command: {arg=}.'

Expand Down Expand Up @@ -530,9 +533,13 @@ def main(argv):
# Build wheel(s) with cibuildwheel.
cibuildwheel(env_extra, cibw_name, cibw_pyodide, cibw_sdist)

elif command.startswith('install.'):
name = command[len('install.'):]
run(f'pip install --force-reinstall {name}')
elif command == 'install':
p = 'pymupdf'
if install_version:
if not install_version.startswith(('==', '>=', '>')):
p = f'{p}=='
p = f'{p}{install_version}'
run(f'pip install --force-reinstall {p}')
have_installed = True

elif command == 'test':
Expand Down
Binary file added tests/resources/test_4496.hwpx
Binary file not shown.
6 changes: 6 additions & 0 deletions tests/test_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -1907,3 +1907,9 @@ def test_4564():
assert document.metadata['producer'] == 'Adobe PSL 1.3e for Canon\x00'
else:
assert document.metadata['producer'] == 'Adobe PSL 1.3e for Canon\udcc0\udc80'


def test_4496():
path = os.path.normpath(f'{__file__}/../../tests/resources/test_4496.hwpx')
with pymupdf.open(path) as document:
print(document.page_count)