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

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
Michele Dolfi
2025-02-19 09:53:07 +01:00
committed by GitHub
parent 7a351fcdea
commit ae3b4906f1
15 changed files with 4148 additions and 5518 deletions

View File

@@ -1,19 +0,0 @@
name: 'Set up Poetry and install'
description: 'Set up a specific version of Poetry and install dependencies using caching.'
inputs:
python-version:
description: "Version range or exact version of Python or PyPy to use, using SemVer's version range syntax."
default: '3.12'
runs:
using: 'composite'
steps:
- name: Install poetry
run: pipx install poetry==1.8.5
shell: bash
- uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
cache: 'poetry'
- name: Install dependencies
run: poetry install --all-extras
shell: bash

View File

@@ -10,11 +10,11 @@ fi
CHGLOG_FILE="${CHGLOG_FILE:-CHANGELOG.md}"
# update package version
poetry version "${TARGET_VERSION}"
uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version "${TARGET_VERSION}"
# collect release notes
REL_NOTES=$(mktemp)
poetry run semantic-release changelog --unreleased >> "${REL_NOTES}"
uv run --no-sync semantic-release changelog --unreleased >> "${REL_NOTES}"
# update changelog
TMP_CHGLOG=$(mktemp)

View File

@@ -14,15 +14,20 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # for fetching tags, required for semantic-release
- uses: ./.github/actions/setup-poetry
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install dependencies
run: uv sync --only-dev
- name: Check version of potential release
id: version_check
run: |
TRGT_VERSION=$(poetry run semantic-release print-version)
TRGT_VERSION=$(uv run --no-sync semantic-release print-version)
echo "TRGT_VERSION=${TRGT_VERSION}" >> "$GITHUB_OUTPUT"
echo "${TRGT_VERSION}"
- name: Check notes of potential release
run: poetry run semantic-release changelog --unreleased
run: uv run --no-sync semantic-release changelog --unreleased
release:
needs: [code-checks, pre-release-check]
if: needs.pre-release-check.outputs.TARGET_TAG_V != ''
@@ -39,7 +44,12 @@ jobs:
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0 # for fetching tags, required for semantic-release
- uses: ./.github/actions/setup-poetry
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install dependencies
run: uv sync --only-dev
- name: Run release script
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}

View File

@@ -20,7 +20,7 @@ jobs:
with:
publish: false
build_args: |
--build-arg CPU_ONLY=true
CPU_ONLY=true
ghcr_image_name: ds4sd/docling-serve-cpu
quay_image_name: ""
@@ -37,6 +37,7 @@ jobs:
with:
publish: false
build_args: |
--build-arg CPU_ONLY=false
CPU_ONLY=false
platforms: linux/amd64
ghcr_image_name: ds4sd/docling-serve
quay_image_name: ""

View File

@@ -34,7 +34,7 @@ jobs:
publish: true
environment: registry-creds
build_args: |
--build-arg CPU_ONLY=true
CPU_ONLY=true
ghcr_image_name: ds4sd/docling-serve-cpu
quay_image_name: ds4sd/docling-serve-cpu
@@ -53,7 +53,8 @@ jobs:
publish: true
environment: registry-creds
build_args: |
--build-arg CPU_ONLY=false
CPU_ONLY=false
platforms: linux/amd64
ghcr_image_name: ds4sd/docling-serve
quay_image_name: ds4sd/docling-serve

View File

@@ -11,11 +11,15 @@ jobs:
python-version: ['3.12']
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-poetry
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install dependencies
run: uv sync --all-extras --no-extra cu124
- name: Run styling check
run: poetry run pre-commit run --all-files
run: uv run --no-sync pre-commit run --all-files
markdown-lint:
runs-on: ubuntu-latest

View File

@@ -17,9 +17,14 @@ jobs:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-poetry
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install dependencies
run: uv sync --all-extras --no-extra cu124
- name: Build
run: poetry build
run: uv build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with: