Skip to content

Commit e5bb33a

Browse files
Add 3.14 to list of supported Python versions.
We now use a central definition of supported versions in scripts/test.py. This is used when building with cibuildwheel, and also in docs.
1 parent 001f329 commit e5bb33a

File tree

5 files changed

+35
-6
lines changed

5 files changed

+35
-6
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ body:
8282
# Need quotes around `3.10` otherwise it is treated as a number and shows as `3.1`.
8383
options:
8484
-
85+
- "3.14"
8586
- "3.13"
8687
- "3.12"
8788
- "3.11"

changes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Change Log
1616

1717
* Other:
1818

19-
19+
* Supported Python versions are now 3.9-3.14.
2020
* We now define all class methods explicitly instead of with dynamic assignment; this improves type hints.
2121
* Removed `pymupdf.utils.Shape` class, was duplicate of `pymupdf.Shape`.
2222
* Allow use of cibuildwheel to build and test on Pyodide.

docs/conf.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
# The master toctree document.
4040
root_doc = "index"
4141

42+
rst_epilog = ''
43+
4244
# General information about the project.
4345
project = "PyMuPDF"
4446
thisday = datetime.date.today()
@@ -59,6 +61,19 @@
5961
version = setup.version_p
6062
del setup # Necessary otherwise sphinx seems to do `setup()`.
6163

64+
# Supported Python versions are set in scripts.test.py.
65+
sys.path.insert(0, os.path.abspath(f'{__file__}/../../scripts'))
66+
try:
67+
import test
68+
finally:
69+
del sys.path[0]
70+
python_versions_minor = test.python_versions_minor
71+
del test
72+
python_versions_list = [f'3.{i}' for i in python_versions_minor]
73+
python_versions = ', '.join(python_versions_list[:-1]) + f' and {python_versions_list[-1]}'
74+
# Make `|python_versions|` available in .rst files.
75+
rst_epilog += f'.. |python_versions| replace:: {python_versions}\n'
76+
6277
# The language for content autogenerated by Sphinx. Refer to documentation
6378
# for a list of supported languages.
6479
# language = None

docs/installation.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,8 @@ Notes
146146
versions, including new Python releases.
147147

148148
*
149-
Wheels are tested on all Python versions currently marked as "Supported" on
150-
https://devguide.python.org/versions/, currently 3.9, 3.10, 3.11, 3.12 and
151-
3.13.
149+
Wheels are tested on all Python versions currently marked as "Supported"
150+
on https://devguide.python.org/versions/, currently |python_versions|.
152151

153152
*
154153
Wheels are not available for Python installed with `Chocolatey

scripts/test.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,19 @@
384384
run = pipcl.run
385385

386386

387+
# We build and test Python 3.x for x in this range.
388+
python_versions_minor = range(9, 14+1)
389+
390+
def cibw_cp(*version_minors):
391+
'''
392+
Returns <version_tuples> in 'cp39*' format.
393+
'''
394+
ret = list()
395+
for version_minor in version_minors:
396+
ret.append(f'cp3{version_minor}*')
397+
return ' '.join(ret)
398+
399+
387400
def main(argv):
388401

389402
if github_workflow_unimportant():
@@ -467,7 +480,8 @@ def main(argv):
467480
env_extra['CIBW_ARCHS_LINUX'] = 'aarch64'
468481
# Testing only first and last python versions because otherwise
469482
# Github times out after 6h.
470-
env_extra['CIBW_BUILD'] = 'cp39* cp313*'
483+
versions = python_versions_cibw()
484+
env_extra['CIBW_BUILD'] = f'{cibw_cp(python_versions_minor[0], python_versions_minor[-1])}'
471485
os_names = ['linux']
472486

473487
elif arg == '--cibw-archs-linux':
@@ -896,7 +910,7 @@ def cibuildwheel(
896910
CIBW_BUILD = 'cp313*'
897911
elif os.environ.get('GITHUB_ACTIONS') == 'true':
898912
# Build/test all supported Python versions.
899-
CIBW_BUILD = 'cp39* cp310* cp311* cp312* cp313*'
913+
CIBW_BUILD = cibw_cp(*python_versions_minor)
900914
else:
901915
# Build/test current Python only.
902916
v = platform.python_version_tuple()[:2]

0 commit comments

Comments
 (0)