Skip to content
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

Jules - various build improvements, drop support for python-3.8, fix for latest mupdf. #3926

Merged
merged 10 commits into from
Oct 8, 2024
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ body:
# Need quotes around `3.10` otherwise it is treated as a number and shows as `3.1`.
options:
-
- "3.13"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
validations:
required: true
2 changes: 1 addition & 1 deletion .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ on:
# We can't currently have more than 10 inputs

PYMUPDF_SETUP_PY_LIMITED_API:
description: 'If not "", is used to build single wheel for each OS.'
description: 'If not "0", we build a single wheel for each platform.'
type: string
default: ''

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_mupdf-master-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
inputs_wheels_cps: "cp312* cp313*"
inputs_wheels_default: "0"
inputs_wheels_linux_auto: "1"
inputs_wheels_linux_pyodide: "1"
inputs_wheels_macos_auto: "1"
inputs_wheels_windows_auto: "1"
run:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_mupdf-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
inputs_wheels_cps: "cp312*"
inputs_wheels_default: "0"
inputs_wheels_linux_auto: "1"
inputs_wheels_linux_pyodide: "1"
inputs_wheels_macos_auto: "1"
inputs_wheels_windows_auto: "1"
run:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test_pyodide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ on:
description: 'Value for PYMUPDF_SETUP_MUPDF_BUILD, e.g.: git:--branch master https://github.com/ArtifexSoftware/mupdf.git'
type: string
default: 'git:--branch master https://github.com/ArtifexSoftware/mupdf.git'

PYMUPDF_SETUP_PY_LIMITED_API:
type: string
default: '1'

schedule:
- cron: '13 5 * * *'

Expand Down Expand Up @@ -40,6 +43,7 @@ jobs:
env:
inputs_sdist: 0
inputs_PYMUPDF_SETUP_MUPDF_BUILD: ${{inputs.PYMUPDF_SETUP_MUPDF_BUILD}}
PYMUPDF_SETUP_PY_LIMITED_API: ${{inputs.PYMUPDF_SETUP_PY_LIMITED_API}}
inputs_wheels_default: 0
inputs_wheels_linux_pyodide: 1
run:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Join us on **Discord** here: [#pymupdf](https://discord.gg/TSpYGBW4eq)

# Installation

**PyMuPDF** requires **Python 3.8 or later**, install using **pip** with:
**PyMuPDF** requires **Python 3.9 or later**, install using **pip** with:

`pip install PyMuPDF`

Expand Down
11 changes: 4 additions & 7 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,13 @@ Notes

*
Each wheel uses the Python Stable ABI of the current oldest supported
Python version, and so works with all later Python versions, including new
Python releases.
Python version (currently 3.9), and so works with all later Python
versions, including new Python releases.

*
Wheels are tested on all Python versions currently marked as "Supported" on
https://devguide.python.org/versions/.
https://devguide.python.org/versions/, currently 3.9, 3.10, 3.11, 3.12 and
3.13.

*
Wheels are not available for Python installed with `Chocolatey
Expand All @@ -153,10 +154,6 @@ Notes
<https://alpinelinux.org/>`_ on aarch64), and building from source is known
to fail.

* PyMuPDF does not support Python versions prior to 3.8. Older wheels can be found in `this <https://github.com/pymupdf/PyMuPDF-Optional-Material/tree/master/wheels-upto-Py3.5>`_ repository and on `PyPI <https://pypi.org/project/PyMuPDF/>`_.

* Please note that we generally follow the official Python release schedules. For Python versions dropping out of official support this means, that generation of wheels will also be ceased for them.

* There are no **mandatory** external dependencies. However, some optional feature are available only if additional components are installed:

* `Pillow <https://pypi.org/project/Pillow/>`_ is required for :meth:`Pixmap.pil_save` and :meth:`Pixmap.pil_tobytes`.
Expand Down
4 changes: 1 addition & 3 deletions docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ With PyMuPDF you can access files with extensions like “.pdf”, “.xps”,

PyMuPDF provides access to many important functions of MuPDF from within a Python environment, and we are continuously seeking to expand this function set.

PyMuPDF runs and has been tested on Mac, Linux and Windows for Python versions 3.8 [#f1]_ and up. Other platforms should work too, as long as MuPDF and Python support them.
PyMuPDF runs and has been tested on Mac, Linux and Windows for all currently supported Python versions. Other platforms should work too, as long as MuPDF and Python support them.

PyMuPDF is hosted on `GitHub <https://github.com/pymupdf/PyMuPDF>`_ and registered on `PyPI <https://pypi.org/project/PyMuPDF/>`_.

Expand Down Expand Up @@ -64,6 +64,4 @@ Artifex, the Artifex logo, MuPDF, and the MuPDF logo are registered trademarks o
.. rubric:: Footnotes


.. [#f1] PyMuPDF generally only supports Python versions that are still maintained by the Python Software Foundation. Once a Python version is being retired, PyMuPDF support will also be ended. This means that wheels for a retired Python platform will no longer be provided, and that Python language features may be used that did not exist in the retired Python version.

.. include:: footer.rst
4 changes: 3 additions & 1 deletion docs/samples/code-printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,11 @@ def code_printer(outfile):
pages = [doc[i] for i in new_range] # these are the TOC pages within main PDF
for item in TOC: # search for TOC item text to get its rectangle
for page in pages:
rl = page.search_for(item[1], flags=~(pymupdf.TEXT_PRESERVE_LIGATURES | pymupdf.TEXT_PRESERVE_SPANS))
rl = page.search_for(item[1], flags=pymupdf.TEXTFLAGS_SEARCH)
if rl != []: # this text must be on next page
break
else:
assert 0, f'Cannot find {item[1]=} in {len(pages)=}.'
rect = rl[0] # rectangle of TOC item text
link = { # make a link from it
"kind": pymupdf.LINK_GOTO,
Expand Down
Loading
Loading