mirror of
https://github.com/docling-project/docling-serve.git
synced 2026-04-26 19:26:05 +00:00
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:
19
.github/actions/setup-poetry/action.yml
vendored
19
.github/actions/setup-poetry/action.yml
vendored
@@ -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
|
||||
4
.github/scripts/release.sh
vendored
4
.github/scripts/release.sh
vendored
@@ -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)
|
||||
|
||||
18
.github/workflows/cd.yml
vendored
18
.github/workflows/cd.yml
vendored
@@ -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 }}
|
||||
|
||||
5
.github/workflows/ci-images-dryrun.yml
vendored
5
.github/workflows/ci-images-dryrun.yml
vendored
@@ -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: ""
|
||||
|
||||
5
.github/workflows/images.yml
vendored
5
.github/workflows/images.yml
vendored
@@ -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
|
||||
|
||||
|
||||
8
.github/workflows/job-checks.yml
vendored
8
.github/workflows/job-checks.yml
vendored
@@ -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
|
||||
|
||||
9
.github/workflows/pypi.yml
vendored
9
.github/workflows/pypi.yml
vendored
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user