Michele Dolfi commited on
Commit
2acaa40
·
unverified ·
1 Parent(s): cffea61

fix: support python 3.13 and docling updates and switch to uv (#48)

Browse files
.github/actions/setup-poetry/action.yml DELETED
@@ -1,19 +0,0 @@
1
- name: 'Set up Poetry and install'
2
- description: 'Set up a specific version of Poetry and install dependencies using caching.'
3
- inputs:
4
- python-version:
5
- description: "Version range or exact version of Python or PyPy to use, using SemVer's version range syntax."
6
- default: '3.12'
7
- runs:
8
- using: 'composite'
9
- steps:
10
- - name: Install poetry
11
- run: pipx install poetry==1.8.5
12
- shell: bash
13
- - uses: actions/setup-python@v4
14
- with:
15
- python-version: ${{ inputs.python-version }}
16
- cache: 'poetry'
17
- - name: Install dependencies
18
- run: poetry install --all-extras
19
- shell: bash
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/scripts/release.sh CHANGED
@@ -10,11 +10,11 @@ fi
10
  CHGLOG_FILE="${CHGLOG_FILE:-CHANGELOG.md}"
11
 
12
  # update package version
13
- poetry version "${TARGET_VERSION}"
14
 
15
  # collect release notes
16
  REL_NOTES=$(mktemp)
17
- poetry run semantic-release changelog --unreleased >> "${REL_NOTES}"
18
 
19
  # update changelog
20
  TMP_CHGLOG=$(mktemp)
 
10
  CHGLOG_FILE="${CHGLOG_FILE:-CHANGELOG.md}"
11
 
12
  # update package version
13
+ uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version "${TARGET_VERSION}"
14
 
15
  # collect release notes
16
  REL_NOTES=$(mktemp)
17
+ uv run --no-sync semantic-release changelog --unreleased >> "${REL_NOTES}"
18
 
19
  # update changelog
20
  TMP_CHGLOG=$(mktemp)
.github/workflows/cd.yml CHANGED
@@ -14,15 +14,20 @@ jobs:
14
  - uses: actions/checkout@v4
15
  with:
16
  fetch-depth: 0 # for fetching tags, required for semantic-release
17
- - uses: ./.github/actions/setup-poetry
 
 
 
 
 
18
  - name: Check version of potential release
19
  id: version_check
20
  run: |
21
- TRGT_VERSION=$(poetry run semantic-release print-version)
22
  echo "TRGT_VERSION=${TRGT_VERSION}" >> "$GITHUB_OUTPUT"
23
  echo "${TRGT_VERSION}"
24
  - name: Check notes of potential release
25
- run: poetry run semantic-release changelog --unreleased
26
  release:
27
  needs: [code-checks, pre-release-check]
28
  if: needs.pre-release-check.outputs.TARGET_TAG_V != ''
@@ -39,7 +44,12 @@ jobs:
39
  with:
40
  token: ${{ steps.app-token.outputs.token }}
41
  fetch-depth: 0 # for fetching tags, required for semantic-release
42
- - uses: ./.github/actions/setup-poetry
 
 
 
 
 
43
  - name: Run release script
44
  env:
45
  GH_TOKEN: ${{ steps.app-token.outputs.token }}
 
14
  - uses: actions/checkout@v4
15
  with:
16
  fetch-depth: 0 # for fetching tags, required for semantic-release
17
+ - name: Install uv and set the python version
18
+ uses: astral-sh/setup-uv@v5
19
+ with:
20
+ enable-cache: true
21
+ - name: Install dependencies
22
+ run: uv sync --only-dev
23
  - name: Check version of potential release
24
  id: version_check
25
  run: |
26
+ TRGT_VERSION=$(uv run --no-sync semantic-release print-version)
27
  echo "TRGT_VERSION=${TRGT_VERSION}" >> "$GITHUB_OUTPUT"
28
  echo "${TRGT_VERSION}"
29
  - name: Check notes of potential release
30
+ run: uv run --no-sync semantic-release changelog --unreleased
31
  release:
32
  needs: [code-checks, pre-release-check]
33
  if: needs.pre-release-check.outputs.TARGET_TAG_V != ''
 
44
  with:
45
  token: ${{ steps.app-token.outputs.token }}
46
  fetch-depth: 0 # for fetching tags, required for semantic-release
47
+ - name: Install uv and set the python version
48
+ uses: astral-sh/setup-uv@v5
49
+ with:
50
+ enable-cache: true
51
+ - name: Install dependencies
52
+ run: uv sync --only-dev
53
  - name: Run release script
54
  env:
55
  GH_TOKEN: ${{ steps.app-token.outputs.token }}
.github/workflows/ci-images-dryrun.yml CHANGED
@@ -20,7 +20,7 @@ jobs:
20
  with:
21
  publish: false
22
  build_args: |
23
- --build-arg CPU_ONLY=true
24
  ghcr_image_name: ds4sd/docling-serve-cpu
25
  quay_image_name: ""
26
 
@@ -37,6 +37,7 @@ jobs:
37
  with:
38
  publish: false
39
  build_args: |
40
- --build-arg CPU_ONLY=false
 
41
  ghcr_image_name: ds4sd/docling-serve
42
  quay_image_name: ""
 
20
  with:
21
  publish: false
22
  build_args: |
23
+ CPU_ONLY=true
24
  ghcr_image_name: ds4sd/docling-serve-cpu
25
  quay_image_name: ""
26
 
 
37
  with:
38
  publish: false
39
  build_args: |
40
+ CPU_ONLY=false
41
+ platforms: linux/amd64
42
  ghcr_image_name: ds4sd/docling-serve
43
  quay_image_name: ""
.github/workflows/images.yml CHANGED
@@ -34,7 +34,7 @@ jobs:
34
  publish: true
35
  environment: registry-creds
36
  build_args: |
37
- --build-arg CPU_ONLY=true
38
  ghcr_image_name: ds4sd/docling-serve-cpu
39
  quay_image_name: ds4sd/docling-serve-cpu
40
 
@@ -53,7 +53,8 @@ jobs:
53
  publish: true
54
  environment: registry-creds
55
  build_args: |
56
- --build-arg CPU_ONLY=false
 
57
  ghcr_image_name: ds4sd/docling-serve
58
  quay_image_name: ds4sd/docling-serve
59
 
 
34
  publish: true
35
  environment: registry-creds
36
  build_args: |
37
+ CPU_ONLY=true
38
  ghcr_image_name: ds4sd/docling-serve-cpu
39
  quay_image_name: ds4sd/docling-serve-cpu
40
 
 
53
  publish: true
54
  environment: registry-creds
55
  build_args: |
56
+ CPU_ONLY=false
57
+ platforms: linux/amd64
58
  ghcr_image_name: ds4sd/docling-serve
59
  quay_image_name: ds4sd/docling-serve
60
 
.github/workflows/job-checks.yml CHANGED
@@ -11,11 +11,15 @@ jobs:
11
  python-version: ['3.12']
12
  steps:
13
  - uses: actions/checkout@v4
14
- - uses: ./.github/actions/setup-poetry
 
15
  with:
16
  python-version: ${{ matrix.python-version }}
 
 
 
17
  - name: Run styling check
18
- run: poetry run pre-commit run --all-files
19
 
20
  markdown-lint:
21
  runs-on: ubuntu-latest
 
11
  python-version: ['3.12']
12
  steps:
13
  - uses: actions/checkout@v4
14
+ - name: Install uv and set the python version
15
+ uses: astral-sh/setup-uv@v5
16
  with:
17
  python-version: ${{ matrix.python-version }}
18
+ enable-cache: true
19
+ - name: Install dependencies
20
+ run: uv sync --all-extras --no-extra cu124
21
  - name: Run styling check
22
+ run: uv run --no-sync pre-commit run --all-files
23
 
24
  markdown-lint:
25
  runs-on: ubuntu-latest
.github/workflows/pypi.yml CHANGED
@@ -17,9 +17,14 @@ jobs:
17
  id-token: write # IMPORTANT: mandatory for trusted publishing
18
  steps:
19
  - uses: actions/checkout@v4
20
- - uses: ./.github/actions/setup-poetry
 
 
 
 
 
21
  - name: Build
22
- run: poetry build
23
  - name: Publish distribution 📦 to PyPI
24
  uses: pypa/gh-action-pypi-publish@release/v1
25
  with:
 
17
  id-token: write # IMPORTANT: mandatory for trusted publishing
18
  steps:
19
  - uses: actions/checkout@v4
20
+ - name: Install uv and set the python version
21
+ uses: astral-sh/setup-uv@v5
22
+ with:
23
+ enable-cache: true
24
+ - name: Install dependencies
25
+ run: uv sync --all-extras --no-extra cu124
26
  - name: Build
27
+ run: uv build
28
  - name: Publish distribution 📦 to PyPI
29
  uses: pypa/gh-action-pypi-publish@release/v1
30
  with:
.pre-commit-config.yaml CHANGED
@@ -4,7 +4,7 @@ repos:
4
  hooks:
5
  - id: system
6
  name: Black
7
- entry: poetry run black docling_serve tests
8
  pass_filenames: false
9
  language: system
10
  files: '\.py$'
@@ -12,7 +12,7 @@ repos:
12
  hooks:
13
  - id: system
14
  name: isort
15
- entry: poetry run isort docling_serve tests
16
  pass_filenames: false
17
  language: system
18
  files: '\.py$'
@@ -20,7 +20,7 @@ repos:
20
  hooks:
21
  - id: autoflake
22
  name: autoflake
23
- entry: poetry run autoflake docling_serve tests
24
  pass_filenames: false
25
  language: system
26
  files: '\.py$'
@@ -28,7 +28,7 @@ repos:
28
  hooks:
29
  - id: system
30
  name: flake8
31
- entry: poetry run flake8 docling_serve
32
  pass_filenames: false
33
  language: system
34
  files: '\.py$'
@@ -36,14 +36,12 @@ repos:
36
  hooks:
37
  - id: system
38
  name: MyPy
39
- entry: poetry run mypy docling_serve
40
  pass_filenames: false
41
  language: system
42
  files: '\.py$'
43
- - repo: local
 
 
44
  hooks:
45
- - id: system
46
- name: Poetry check
47
- entry: poetry check --lock
48
- pass_filenames: false
49
- language: system
 
4
  hooks:
5
  - id: system
6
  name: Black
7
+ entry: uv run --no-sync black docling_serve tests
8
  pass_filenames: false
9
  language: system
10
  files: '\.py$'
 
12
  hooks:
13
  - id: system
14
  name: isort
15
+ entry: uv run --no-sync isort docling_serve tests
16
  pass_filenames: false
17
  language: system
18
  files: '\.py$'
 
20
  hooks:
21
  - id: autoflake
22
  name: autoflake
23
+ entry: uv run --no-sync autoflake docling_serve tests
24
  pass_filenames: false
25
  language: system
26
  files: '\.py$'
 
28
  hooks:
29
  - id: system
30
  name: flake8
31
+ entry: uv run --no-sync flake8 docling_serve
32
  pass_filenames: false
33
  language: system
34
  files: '\.py$'
 
36
  hooks:
37
  - id: system
38
  name: MyPy
39
+ entry: uv run --no-sync mypy docling_serve
40
  pass_filenames: false
41
  language: system
42
  files: '\.py$'
43
+ - repo: https://github.com/astral-sh/uv-pre-commit
44
+ # uv version.
45
+ rev: 0.6.1
46
  hooks:
47
+ - id: uv-lock
 
 
 
 
.python-version ADDED
@@ -0,0 +1 @@
 
 
1
+ 3.12
Containerfile CHANGED
@@ -3,6 +3,7 @@ ARG BASE_IMAGE=quay.io/sclorg/python-312-c9s:c9s
3
  FROM ${BASE_IMAGE}
4
 
5
  ARG CPU_ONLY=false
 
6
 
7
  USER 0
8
 
@@ -21,6 +22,8 @@ RUN --mount=type=bind,source=os-packages.txt,target=/tmp/os-packages.txt \
21
 
22
  ENV TESSDATA_PREFIX=/usr/share/tesseract/tessdata/
23
 
 
 
24
  ###################################################################################################
25
  # Docling layer #
26
  ###################################################################################################
@@ -35,27 +38,29 @@ ENV OMP_NUM_THREADS=4
35
  ENV LANG=en_US.UTF-8
36
  ENV LC_ALL=en_US.UTF-8
37
  ENV PYTHONIOENCODING=utf-8
 
 
38
 
39
  ENV WITH_UI=True
40
 
41
- COPY --chown=1001:0 pyproject.toml poetry.lock models_download.py README.md ./
42
 
43
- RUN pip install --no-cache-dir poetry && \
44
- # We already are in a virtual environment, so we don't need to create a new one, only activate it.
45
- poetry config virtualenvs.create false && \
46
- source /opt/app-root/bin/activate && \
47
  if [ "$CPU_ONLY" = "true" ]; then \
48
- poetry install --no-root --no-cache --no-interaction --all-extras --with cpu --without dev; \
49
  else \
50
- poetry install --no-root --no-cache --no-interaction --all-extras --without dev; \
51
  fi && \
52
- echo "Downloading models..." && \
53
- python models_download.py && \
54
- chown -R 1001:0 /opt/app-root/src && \
55
- chmod -R g=u /opt/app-root/src
 
 
56
 
57
  COPY --chown=1001:0 --chmod=664 ./docling_serve ./docling_serve
58
 
 
59
  EXPOSE 5001
60
 
61
  CMD ["python", "-m", "docling_serve"]
 
3
  FROM ${BASE_IMAGE}
4
 
5
  ARG CPU_ONLY=false
6
+ ARG MODELS_LIST="layout tableformer picture_classifier easyocr"
7
 
8
  USER 0
9
 
 
22
 
23
  ENV TESSDATA_PREFIX=/usr/share/tesseract/tessdata/
24
 
25
+ COPY --from=ghcr.io/astral-sh/uv:0.6.1 /uv /uvx /bin/
26
+
27
  ###################################################################################################
28
  # Docling layer #
29
  ###################################################################################################
 
38
  ENV LANG=en_US.UTF-8
39
  ENV LC_ALL=en_US.UTF-8
40
  ENV PYTHONIOENCODING=utf-8
41
+ ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
42
+ ENV UV_PROJECT_ENVIRONMENT=/opt/app-root
43
 
44
  ENV WITH_UI=True
45
 
46
+ COPY --chown=1001:0 pyproject.toml uv.lock README.md ./
47
 
48
+ RUN --mount=type=cache,target=/opt/app-root/src/.cache/uv,uid=1001 \
 
 
 
49
  if [ "$CPU_ONLY" = "true" ]; then \
50
+ NO_EXTRA=cu124; \
51
  else \
52
+ NO_EXTRA=cpu; \
53
  fi && \
54
+ uv sync --frozen --no-install-project --no-dev --all-extras --no-extra ${NO_EXTRA}
55
+
56
+ RUN echo "Downloading models..." && \
57
+ docling-tools models download ${MODELS_LIST} && \
58
+ chown -R 1001:0 /opt/app-root/src/.cache && \
59
+ chmod -R g=u /opt/app-root/src/.cache
60
 
61
  COPY --chown=1001:0 --chmod=664 ./docling_serve ./docling_serve
62
 
63
+
64
  EXPOSE 5001
65
 
66
  CMD ["python", "-m", "docling_serve"]
README.md CHANGED
@@ -325,10 +325,11 @@ RELOAD=true bash start_server.sh
325
 
326
  The following variables are available:
327
 
328
- `TESSDATA_PREFIX`: Tesseract data location, example `/usr/share/tesseract/tessdata/`.
329
- `UVICORN_WORKERS`: Number of workers to use.
330
- `RELOAD`: If `True`, this will enable auto-reload when you modify files, useful for development.
331
- `WITH_UI`: If `True`, The Gradio UI will be available at `/ui`.
 
332
 
333
  ## Get help and support
334
 
 
325
 
326
  The following variables are available:
327
 
328
+ - `DOCLING_ARTIFACTS_PATH`: if set Docling will use only the local weights of models, for example `/opt/app-root/.cache/docling/cache`.
329
+ - `TESSDATA_PREFIX`: Tesseract data location, example `/usr/share/tesseract/tessdata/`.
330
+ - `UVICORN_WORKERS`: Number of workers to use.
331
+ - `RELOAD`: If `True`, this will enable auto-reload when you modify files, useful for development.
332
+ - `WITH_UI`: If `True`, The Gradio UI will be available at `/ui`.
333
 
334
  ## Get help and support
335
 
models_download.py DELETED
@@ -1,36 +0,0 @@
1
- import os
2
- import zipfile
3
-
4
- import requests
5
- from deepsearch_glm.utils.load_pretrained_models import load_pretrained_nlp_models
6
- from docling.pipeline.standard_pdf_pipeline import StandardPdfPipeline
7
-
8
- # Download Docling models
9
- StandardPdfPipeline.download_models_hf(force=True)
10
- load_pretrained_nlp_models(verbose=True)
11
-
12
- # Download EasyOCR models
13
- urls = [
14
- "https://github.com/JaidedAI/EasyOCR/releases/download/v1.3/latin_g2.zip",
15
- "https://github.com/JaidedAI/EasyOCR/releases/download/pre-v1.1.6/craft_mlt_25k.zip"
16
- ]
17
-
18
- local_zip_paths = [
19
- "/opt/app-root/src/latin_g2.zip",
20
- "/opt/app-root/src/craft_mlt_25k.zip"
21
- ]
22
-
23
- extract_path = "/opt/app-root/src/.EasyOCR/model/"
24
-
25
- for url, local_zip_path in zip(urls, local_zip_paths):
26
- # Download the file
27
- response = requests.get(url)
28
- with open(local_zip_path, "wb") as file:
29
- file.write(response.content)
30
-
31
- # Unzip the file
32
- with zipfile.ZipFile(local_zip_path, "r") as zip_ref:
33
- zip_ref.extractall(extract_path)
34
-
35
- # Clean up the zip file
36
- os.remove(local_zip_path)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
poetry.lock DELETED
The diff for this file is too large to render. See raw diff
 
pyproject.toml CHANGED
@@ -1,25 +1,25 @@
1
- [tool.poetry]
2
  name = "docling-serve"
3
  version = "0.2.0" # DO NOT EDIT, updated automatically
4
  description = "Running Docling as a service"
5
- license = "MIT"
6
  authors = [
7
- "Michele Dolfi <[email protected]>",
8
- "Christoph Auer <cau@zurich.ibm.com>",
9
- "Panos Vagenas <pva@zurich.ibm.com>",
10
- "Cesar Berrospi Ramis <ceb@zurich.ibm.com>",
11
- "Peter Staar <taa@zurich.ibm.com>",
 
 
12
  ]
13
  maintainers = [
14
- "Peter Staar <taa@zurich.ibm.com>",
15
- "Christoph Auer <cau@zurich.ibm.com>",
16
- "Michele Dolfi <dol@zurich.ibm.com>",
17
- "Cesar Berrospi Ramis <ceb@zurich.ibm.com>",
18
- "Panos Vagenas <pva@zurich.ibm.com>",
19
  ]
20
  readme = "README.md"
21
- repository = "https://github.com/DS4SD/docling-serve"
22
- homepage = "https://github.com/DS4SD/docling-serve"
23
  classifiers = [
24
  "License :: OSI Approved :: MIT License",
25
  "Operating System :: OS Independent",
@@ -28,80 +28,88 @@ classifiers = [
28
  "Typing :: Typed",
29
  "Programming Language :: Python :: 3"
30
  ]
31
-
32
- [tool.poetry.dependencies]
33
- python = ">=3.10,<3.13" # 3.10 needed for Gradio, and no torchvision build for 3.13 yet
34
- docling = "^2.14.0"
35
- fastapi = {version = "^0.115.6", extras = ["standard"]}
36
- gradio = { version = "^5.9.1", optional = true }
37
- uvicorn = "~0.29.0"
38
- pydantic = "^2.10.3"
39
- pydantic-settings = "^2.4.0"
40
- python-multipart = "^0.0.19"
41
- httpx = "^0.28.1"
42
- tesserocr = { version = "^2.7.1", optional = true }
43
- rapidocr-onnxruntime = { version = "^1.4.0", optional = true, markers = "python_version < '3.13'" }
44
- onnxruntime = [
45
- # 1.19.2 is the last version with python3.9 support,
46
- # see https://github.com/microsoft/onnxruntime/releases/tag/v1.20.0
47
- { version = ">=1.7.0,<1.20.0", optional = true, markers = "python_version < '3.10'" },
48
- { version = "^1.7.0", optional = true, markers = "python_version >= '3.10'" }
49
  ]
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
- [tool.poetry.extras]
53
- ui = ["gradio"]
54
- tesserocr = ["tesserocr"]
55
- rapidocr = ["rapidocr-onnxruntime", "onnxruntime"]
56
-
 
 
 
 
 
 
 
 
57
 
58
- [tool.poetry.group.pypi-torch]
59
- optional = false
 
 
 
 
 
60
 
61
- [tool.poetry.group.pypi-torch.dependencies]
62
  torch = [
63
- {version = "!=2.4.1+cpu" },
 
64
  ]
65
  torchvision = [
66
- {version = "!=0.19.1+cpu" },
 
67
  ]
68
 
69
- [tool.poetry.group.cpu]
70
- optional = true
71
-
72
- [tool.poetry.group.cpu.dependencies]
73
- torch = [
74
- {markers = 'platform_machine=="x86_64" and sys_platform=="linux" and python_version == "3.10"', url="https://download.pytorch.org/whl/cpu/torch-2.4.1%2Bcpu-cp310-cp310-linux_x86_64.whl"},
75
- {markers = 'platform_machine=="x86_64" and sys_platform=="linux" and python_version == "3.11"', url="https://download.pytorch.org/whl/cpu/torch-2.4.1%2Bcpu-cp311-cp311-linux_x86_64.whl"},
76
- {markers = 'platform_machine=="x86_64" and sys_platform=="linux" and python_version == "3.12"', url="https://download.pytorch.org/whl/cpu/torch-2.4.1%2Bcpu-cp312-cp312-linux_x86_64.whl"},
77
- ]
78
- torchvision = [
79
- {markers = 'platform_machine=="x86_64" and sys_platform=="linux" and python_version == "3.10"', url="https://download.pytorch.org/whl/cpu/torchvision-0.19.1%2Bcpu-cp310-cp310-linux_x86_64.whl"},
80
- {markers = 'platform_machine=="x86_64" and sys_platform=="linux" and python_version == "3.11"', url="https://download.pytorch.org/whl/cpu/torchvision-0.19.1%2Bcpu-cp311-cp311-linux_x86_64.whl"},
81
- {markers = 'platform_machine=="x86_64" and sys_platform=="linux" and python_version == "3.12"', url="https://download.pytorch.org/whl/cpu/torchvision-0.19.1%2Bcpu-cp312-cp312-linux_x86_64.whl"},
82
- ]
83
-
84
- [tool.poetry.group.constraints.dependencies]
85
- numpy = [
86
- { version = "^2.1.0", markers = 'python_version >= "3.13"' },
87
- { version = "^1.24.4", markers = 'python_version < "3.13"' },
88
- ]
89
-
90
- [tool.poetry.group.dev.dependencies]
91
- black = "^24.8.0"
92
- isort = "^5.13.2"
93
- pre-commit = "^3.8.0"
94
- autoflake = "^2.3.1"
95
- flake8 = "^7.1.1"
96
- pytest = "^8.3.4"
97
- pytest-asyncio = "^0.24.0"
98
- pytest-check = "^2.4.1"
99
- mypy = "^1.11.2"
100
- python-semantic-release = "^7.32.2"
101
-
102
- [build-system]
103
- requires = ["poetry-core"]
104
- build-backend = "poetry.core.masonry.api"
105
 
106
  [tool.black]
107
  line-length = 88
 
1
+ [project]
2
  name = "docling-serve"
3
  version = "0.2.0" # DO NOT EDIT, updated automatically
4
  description = "Running Docling as a service"
5
+ license = {text = "MIT"}
6
  authors = [
7
+ {name="Michele Dolfi", email="[email protected]"},
8
+ {name="Guillaume Moutier", email="gmoutier@redhat.com"},
9
+ {name="Anil Vishnoi", email="avishnoi@redhat.com"},
10
+ {name="Panos Vagenas", email="pva@zurich.ibm.com"},
11
+ {name="Panos Vagenas", email="pva@zurich.ibm.com"},
12
+ {name="Christoph Auer", email="[email protected]"},
13
+ {name="Peter Staar", email="[email protected]"},
14
  ]
15
  maintainers = [
16
+ {name="Michele Dolfi", email="dol@zurich.ibm.com"},
17
+ {name="Anil Vishnoi", email="avishnoi@redhat.com"},
18
+ {name="Panos Vagenas", email="pva@zurich.ibm.com"},
19
+ {name="Christoph Auer", email="cau@zurich.ibm.com"},
20
+ {name="Peter Staar", email="taa@zurich.ibm.com"},
21
  ]
22
  readme = "README.md"
 
 
23
  classifiers = [
24
  "License :: OSI Approved :: MIT License",
25
  "Operating System :: OS Independent",
 
28
  "Typing :: Typed",
29
  "Programming Language :: Python :: 3"
30
  ]
31
+ requires-python = ">=3.10"
32
+ dependencies = [
33
+ "docling~=2.23",
34
+ "fastapi[standard]~=0.115",
35
+ "httpx~=0.28",
36
+ "pydantic~=2.10",
37
+ "pydantic-settings~=2.4",
38
+ "python-multipart>=0.0.14,<0.1.0",
39
+ "uvicorn[standard]>=0.29.0,<1.0.0",
 
 
 
 
 
 
 
 
 
40
  ]
41
 
42
+ [project.optional-dependencies]
43
+ ui = [
44
+ "gradio~=5.9"
45
+ ]
46
+ tesserocr = [
47
+ "tesserocr~=2.7"
48
+ ]
49
+ rapidocr = [
50
+ "rapidocr-onnxruntime~=1.4; python_version<'3.13'",
51
+ "onnxruntime~=1.7",
52
+ ]
53
+ cpu = [
54
+ "torch>=2.6.0",
55
+ "torchvision>=0.21.0",
56
+ ]
57
+ cu124 = [
58
+ "torch>=2.6.0",
59
+ "torchvision>=0.21.0",
60
+ ]
61
 
62
+ [dependency-groups]
63
+ dev = [
64
+ "autoflake~=2.3",
65
+ "black~=24.8",
66
+ "flake8~=7.1",
67
+ "isort~=5.13",
68
+ "mypy~=1.11",
69
+ "pre-commit~=3.8",
70
+ "pytest~=8.3",
71
+ "pytest-asyncio~=0.24",
72
+ "pytest-check~=2.4",
73
+ "python-semantic-release~=7.32",
74
+ ]
75
 
76
+ [tool.uv]
77
+ conflicts = [
78
+ [
79
+ { extra = "cpu" },
80
+ { extra = "cu124" },
81
+ ],
82
+ ]
83
 
84
+ [tool.uv.sources]
85
  torch = [
86
+ { index = "pytorch-cpu", extra = "cpu" },
87
+ { index = "pytorch-cu124", extra = "cu124" },
88
  ]
89
  torchvision = [
90
+ { index = "pytorch-cpu", extra = "cpu" },
91
+ { index = "pytorch-cu124", extra = "cu124" },
92
  ]
93
 
94
+ [[tool.uv.index]]
95
+ name = "pytorch-cpu"
96
+ url = "https://download.pytorch.org/whl/cpu"
97
+ explicit = true
98
+
99
+ [[tool.uv.index]]
100
+ name = "pytorch-cu124"
101
+ url = "https://download.pytorch.org/whl/cu124"
102
+ explicit = true
103
+
104
+ [tool.setuptools.packages.find]
105
+ include = ["docling_serve"]
106
+
107
+ [project.urls]
108
+ Homepage = "https://github.com/DS4SD/docling-serve"
109
+ # Documentation = "https://ds4sd.github.io/docling"
110
+ Repository = "https://github.com/DS4SD/docling-serve"
111
+ Issues = "https://github.com/DS4SD/docling-serve/issues"
112
+ Changelog = "https://github.com/DS4SD/docling-serve/blob/main/CHANGELOG.md"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
 
114
  [tool.black]
115
  line-length = 88
uv.lock ADDED
The diff for this file is too large to render. See raw diff