From 1c756794296608e7d9000ac51609aec38197d1e9 Mon Sep 17 00:00:00 2001 From: felix Date: Thu, 2 Jul 2026 11:18:22 +0200 Subject: [PATCH 1/3] Drop py3.10 --- .github/workflows/builds.yml | 5 ++-- .github/workflows/demo.yml | 4 ++-- .github/workflows/doc-status.yml | 2 +- .github/workflows/docker.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/main.yml | 4 ++-- .github/workflows/public_docker_images.yml | 2 +- .github/workflows/publish.yml | 4 ++-- .github/workflows/pull_requests.yml | 2 +- .github/workflows/references.yml | 28 +++++++++++----------- .github/workflows/scripts.yml | 11 ++++----- .github/workflows/style.yml | 4 ++-- Dockerfile | 2 +- README.md | 4 ++-- api/pyproject.toml | 2 +- docs/source/getting_started/installing.rst | 2 +- pyproject.toml | 7 +++--- 17 files changed, 43 insertions(+), 44 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 77d23685d0..d9d0196be3 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python: ["3.10", "3.11"] + python: ["3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v7 - if: matrix.os == 'macos-latest' @@ -22,8 +22,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v6 with: - # MacOS issue ref.: https://github.com/actions/setup-python/issues/855 & https://github.com/actions/setup-python/issues/865 - python-version: ${{ matrix.os == 'macos-latest' && matrix.python == '3.10' && '3.11' || matrix.python }} + python-version: ${{ matrix.python }} architecture: x64 - name: Cache python modules uses: actions/cache@v6 diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 6f765c892e..53424fe69e 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -26,7 +26,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - if: matrix.os == 'macos-latest' name: Install MacOS prerequisites @@ -63,7 +63,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 with: diff --git a/.github/workflows/doc-status.yml b/.github/workflows/doc-status.yml index 318f0e344a..3e96b5f667 100644 --- a/.github/workflows/doc-status.yml +++ b/.github/workflows/doc-status.yml @@ -9,7 +9,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v6 with: - python-version: "3.10" + python-version: "3.11" architecture: x64 - name: check status run: | diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8dcb2d5f59..6ba2601907 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - uses: actions/setup-python@v6 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b563ae7f84..8d300dea57 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 with: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f348b64120..f06c5698fe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python @@ -46,7 +46,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python diff --git a/.github/workflows/public_docker_images.yml b/.github/workflows/public_docker_images.yml index 6f9259c2b9..681fbe57e4 100644 --- a/.github/workflows/public_docker_images.yml +++ b/.github/workflows/public_docker_images.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: # Must match version at https://www.python.org/ftp/python/ - python: ["3.10.13", "3.11.8", "3.12.7"] + python: ["3.11.15", "3.12.9", "3.13.14"] # NOTE: Since docTR 1.0.0 torch doesn't exist as a seperate install option it's only to keep the naming convention framework: ["torch", "torch,viz,html,contrib"] diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 41916c7856..ccbdac9a37 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v7 @@ -49,7 +49,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml index 26f5fea683..6d0854466f 100644 --- a/.github/workflows/pull_requests.yml +++ b/.github/workflows/pull_requests.yml @@ -12,7 +12,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v6 with: - python-version: "3.10" + python-version: "3.11" architecture: x64 - name: Cache python modules uses: actions/cache@v6 diff --git a/.github/workflows/references.yml b/.github/workflows/references.yml index 74e39ccf52..d8c4c67f06 100644 --- a/.github/workflows/references.yml +++ b/.github/workflows/references.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python @@ -44,7 +44,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python @@ -85,7 +85,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python @@ -119,7 +119,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python @@ -145,7 +145,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python @@ -171,7 +171,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python @@ -205,7 +205,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python @@ -232,7 +232,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python @@ -259,7 +259,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python @@ -293,7 +293,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python @@ -325,7 +325,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python @@ -351,7 +351,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python @@ -385,7 +385,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python @@ -417,7 +417,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python diff --git a/.github/workflows/scripts.yml b/.github/workflows/scripts.yml index d98e7c15b9..bd1183650e 100644 --- a/.github/workflows/scripts.yml +++ b/.github/workflows/scripts.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10", "3.11"] + python: ["3.11", "3.12"] steps: - if: matrix.os == 'macos-latest' name: Install MacOS prerequisites @@ -45,7 +45,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10", "3.11"] + python: ["3.11", "3.12"] steps: - if: matrix.os == 'macos-latest' name: Install MacOS prerequisites @@ -77,7 +77,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10", "3.11"] + python: ["3.11", "3.12"] steps: - if: matrix.os == 'macos-latest' name: Install MacOS prerequisites @@ -108,14 +108,13 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python: ["3.10", "3.11"] + python: ["3.11", "3.12"] steps: - uses: actions/checkout@v7 - name: Set up Python uses: actions/setup-python@v6 with: - # MacOS issue ref.: https://github.com/actions/setup-python/issues/855 & https://github.com/actions/setup-python/issues/865 - python-version: ${{ matrix.os == 'macos-latest' && matrix.python == '3.10' && '3.11' || matrix.python }} + python-version: ${{ matrix.python }} architecture: x64 - name: Run environment collection script run: python scripts/collect_env.py diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 121ef89dd4..b39f046003 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python @@ -31,7 +31,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python diff --git a/Dockerfile b/Dockerfile index 1a2bd38a59..27f5eefbff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* # Install Python -ARG PYTHON_VERSION=3.10.13 +ARG PYTHON_VERSION=3.11.15 RUN wget http://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz && \ tar -zxf Python-$PYTHON_VERSION.tgz && \ diff --git a/README.md b/README.md index b9097cc55d..d882f91e35 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,7 @@ This project is supported by [t2k GmbH](https://www.text2knowledge.de/de), ### Prerequisites -Python 3.10 (or higher) and [pip](https://pip.pypa.io/en/stable/) are required to install docTR. +Python 3.11 (or higher) and [pip](https://pip.pypa.io/en/stable/) are required to install docTR. ### Latest release @@ -268,7 +268,7 @@ docker run -it --gpus all ghcr.io/mindee/doctr:torch-py3.9.18-2024-10 bash The Docker images for docTR follow a specific tag nomenclature: `-py-`. Here's a breakdown of the tag structure: - ``: `torch`, `torch-viz-html-contrib`. -- ``: `3.9.18`, `3.10.13` or `3.11.8`. +- ``: `3.10.13`, `3.11.8`, etc. - ``: a tag >= `v0.11.0` - ``: e.g. `2014-10` diff --git a/api/pyproject.toml b/api/pyproject.toml index 3bdc360c58..8dac7f9706 100644 --- a/api/pyproject.toml +++ b/api/pyproject.toml @@ -10,7 +10,7 @@ authors = ["Mindee "] license = "Apache-2.0" [tool.poetry.dependencies] -python = ">=3.10,<3.13" +python = ">=3.11,<3.13" python-doctr = {git = "https://github.com/mindee/doctr.git", branch = "main" } # Fastapi: minimum version required to avoid pydantic error # cf. https://github.com/tiangolo/fastapi/issues/4168 diff --git a/docs/source/getting_started/installing.rst b/docs/source/getting_started/installing.rst index 8552a2434e..d8c99d8f50 100644 --- a/docs/source/getting_started/installing.rst +++ b/docs/source/getting_started/installing.rst @@ -3,7 +3,7 @@ Installation ************ -This library requires `Python `_ 3.10 or higher. +This library requires `Python `_ 3.11 or higher. Via Python Package diff --git a/pyproject.toml b/pyproject.toml index 2ec1bd38d7..e67d4eb84b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ maintainers = [ {name = "Felix Dittrich"}, ] readme = "README.md" -requires-python = ">=3.10.0,<4" +requires-python = ">=3.11.0,<4" license = {file = "LICENSE"} keywords=["OCR", "deep learning", "computer vision", "pytorch", "text detection", "text recognition"] classifiers=[ @@ -25,9 +25,10 @@ classifiers=[ "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Scientific/Engineering :: Artificial Intelligence", ] dynamic = ["version"] @@ -171,7 +172,7 @@ ignore_missing_imports = true [tool.ruff] exclude = [".git", "venv*", "build", "**/__init__.py"] line-length = 120 -target-version = "py310" +target-version = "py311" preview=true [tool.ruff.lint] From b6acca0069902e884db74ea1b9fef3dcea53dfa7 Mon Sep 17 00:00:00 2001 From: felix Date: Thu, 2 Jul 2026 11:18:50 +0200 Subject: [PATCH 2/3] Drop py3.10 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e885088d2d..6e9ed103f3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: - id: no-commit-to-branch args: ['--branch', 'main'] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.14 + rev: v0.15.20 hooks: - id: ruff args: [ --fix ] From 4b745135d81cbaeb6298e78b56503d278dc9d54d Mon Sep 17 00:00:00 2001 From: felix Date: Thu, 2 Jul 2026 11:31:13 +0200 Subject: [PATCH 3/3] mypy & API --- api/Dockerfile | 2 +- doctr/utils/visualization.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/Dockerfile b/api/Dockerfile index 6fd83e4ebd..42040badad 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,4 +1,4 @@ -FROM tiangolo/uvicorn-gunicorn-fastapi:python3.10-slim +FROM tiangolo/uvicorn-gunicorn-fastapi:python3.11-slim WORKDIR /app diff --git a/doctr/utils/visualization.py b/doctr/utils/visualization.py index 9940cb9bd8..ce68b01701 100644 --- a/doctr/utils/visualization.py +++ b/doctr/utils/visualization.py @@ -148,7 +148,7 @@ def get_colors(num_colors: int) -> list[tuple[float, float, float]]: hue = i / 360.0 lightness = (50 + np.random.rand() * 10) / 100.0 saturation = (90 + np.random.rand() * 10) / 100.0 - colors.append(colorsys.hls_to_rgb(hue, lightness, saturation)) # type: ignore[arg-type] + colors.append(colorsys.hls_to_rgb(hue, lightness, saturation)) return colors