Skip to content

Add support for Python 3.13 #718

@stweil

Description

@stweil

The new Debian stable "Trixie" comes with Python 3.13. Therefore support for this Python release would be nice.

Here I collect my current results with kraken and Python 3.13.

  • scikit-image 0.24.0 does not work with Python 3.13 ("KeyError: 'area_bbox'"), so I upgraded to scikit-image-0.25.2.
diff --git a/setup.cfg b/setup.cfg
index a936baae..902df91d 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -38,7 +38,7 @@ max_line_length = 160
 exclude = tests/*
 
 [options]
-python_requires = >=3.9,<3.13
+python_requires = >=3.9,<3.14
 install_requires =
     jsonschema
     lxml
@@ -55,7 +55,7 @@ install_requires =
     torchvision>=0.5.0
     torch>=2.4.0,<2.8.0
     scikit-learn~=1.5.0
-    scikit-image~=0.24.0
+    scikit-image>=0.24.0,<2.26.0
     shapely>=2.0.6,~=2.0.6
     pyarrow
     htrmopo>=0.3,~=0.3

pytest -k 'not test_train' fails in some tests:

============================================================================================== test session starts ==============================================================================================
platform linux -- Python 3.13.5, pytest-8.4.1, pluggy-1.6.0
rootdir: /home/stweil/src/github/mittagessen/kraken
configfile: pytest.ini
testpaths: tests
collected 226 items / 14 deselected / 212 selected                                                                                                                                                              

tests/test_align.py .                                                                                                                                                                                     [  0%]
tests/test_arrow_dataset.py ......                                                                                                                                                                        [  3%]
tests/test_binarization.py .....                                                                                                                                                                          [  5%]
tests/test_cli.py ...                                                                                                                                                                                     [  7%]
tests/test_codec.py ..............................                                                                                                                                                        [ 21%]
tests/test_dataset.py ............                                                                                                                                                                        [ 26%]
tests/test_layers.py .............................                                                                                                                                                        [ 40%]
tests/test_lineest.py ....                                                                                                                                                                                [ 42%]
tests/test_merging.py .......                                                                                                                                                                             [ 45%]
tests/test_models.py .                                                                                                                                                                                    [ 46%]
tests/test_newpolygons.py ......FFF...FFFFFFF...                                                                                                                                                          [ 56%]
tests/test_pageseg.py ..                                                                                                                                                                                  [ 57%]
tests/test_readingorder.py ......x...x....                                                                                                                                                                [ 64%]
tests/test_repo.py ...                                                                                                                                                                                    [ 66%]
tests/test_rpred.py .........................                                                                                                                                                             [ 77%]
tests/test_serialization.py .................                                                                                                                                                             [ 85%]
tests/test_transcribe.py .                                                                                                                                                                                [ 86%]
tests/test_vgsl.py ...s.....                                                                                                                                                                              [ 90%]
tests/test_xml.py ....................                                                                                                                                                                    [100%]

=================================================================================================== FAILURES ====================================================================================================
[...]
FAILED tests/test_newpolygons.py::TestNewPolygons::test_ketoscli_pretrain_new_model - AssertionError: Expected 'mock' to have been called.
FAILED tests/test_newpolygons.py::TestNewPolygons::test_ketoscli_pretrain_new_model_force_legacy - AssertionError: Expected 'mock' to have been called.
FAILED tests/test_newpolygons.py::TestNewPolygons::test_ketoscli_pretrain_old_model - AssertionError: Expected 'mock' to have been called.
FAILED tests/test_newpolygons.py::TestNewPolygons::test_ketoscli_train_new_model - AssertionError: Expected 'mock' to have been called.
FAILED tests/test_newpolygons.py::TestNewPolygons::test_ketoscli_train_new_model_force_legacy - AssertionError: Expected 'mock' to have been called.
FAILED tests/test_newpolygons.py::TestNewPolygons::test_ketoscli_train_old_model - AssertionError: Expected 'mock' to have been called.
FAILED tests/test_newpolygons.py::TestNewPolygons::test_ketoscli_train_old_model_force_legacy - AssertionError: Expected 'mock' to have been called.
FAILED tests/test_newpolygons.py::TestNewPolygons::test_krakencli_ocr_new_model - AssertionError: 1 != 0
FAILED tests/test_newpolygons.py::TestNewPolygons::test_krakencli_ocr_old_model - AssertionError: 1 != 0
FAILED tests/test_newpolygons.py::TestNewPolygons::test_krakencli_ocr_old_model_force_new - AssertionError: 1 != 0
======================================================= 10 failed, 199 passed, 1 skipped, 14 deselected, 2 xfailed, 1278818 warnings in 261.44s (0:04:21) =======================================================

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions