Skip to content

Commit e21d57c

Browse files
authored
feat: support for python 3.14 (#131)
Signed-off-by: Michele Dolfi <[email protected]>
1 parent b9ff7eb commit e21d57c

File tree

4 files changed

+3115
-1945
lines changed

4 files changed

+3115
-1945
lines changed

.github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
strategy:
2121
matrix:
22-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
22+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
2323
steps:
2424
- uses: actions/checkout@v4
2525
- name: Cache Hugging Face models

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@ classifiers = [
2727
"Programming Language :: Python :: 3.11",
2828
"Programming Language :: Python :: 3.12",
2929
"Programming Language :: Python :: 3.13",
30+
"Programming Language :: Python :: 3.14",
3031
]
3132
requires-python = '>=3.9,<4.0'
3233
dependencies = [
3334
'torch (>=2.2.2,<3.0.0)',
3435
'torchvision (>=0,<1)',
35-
'jsonlines (>=3.1.0,<4.0.0)',
36-
'Pillow (>=10.0.0,<12.0.0)',
36+
'jsonlines (>=3.1.0,<5.0.0)',
37+
'Pillow (>=10.0.0,<13.0.0)',
3738
'tqdm (>=4.64.0,<5.0.0)',
3839
'huggingface_hub (>=0.23,<1)',
3940
'safetensors[torch] (>=0.4.3,<1)',
@@ -74,7 +75,7 @@ dev = [
7475
"pytest-dependency~=0.6",
7576
"pytest-xdist~=3.3",
7677
"python-semantic-release~=7.32",
77-
"datasets~=3.2",
78+
'datasets~=3.2; python_version < "3.14"',
7879
]
7980

8081
[tool.uv]

tests/test_reading_order.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
1-
import os
2-
import json
3-
import glob
41
import copy
52

63
import logging
74

8-
from pathlib import Path
5+
import sys
96

10-
import numpy as np
117
import pytest
12-
from PIL import Image
13-
14-
from datasets import load_dataset
158

169
from typing import List, Dict
1710
import random
1811

1912
from docling_ibm_models.reading_order.reading_order_rb import PageElement, ReadingOrderPredictor
2013

21-
from docling_core.types.doc.document import DoclingDocument, DocItem, RefItem, TextItem, ContentLayer
14+
from docling_core.types.doc.document import DoclingDocument, DocItem, TextItem, ContentLayer
2215

2316
# Configure logging
2417
logging.basicConfig(
@@ -60,6 +53,11 @@ def spearman_rank_correlation(arr1, arr2):
6053
return rho
6154

6255
def test_readingorder():
56+
if sys.version_info >= (3, 14):
57+
pytest.skip("Pyarrow is not yet available for Python 3.14, hence we cannot load the dataset.")
58+
59+
from datasets import load_dataset
60+
6361

6462
ro_scores, caption_scores, footnote_scores = [], [], []
6563

0 commit comments

Comments
 (0)