Skip to content

Commit 29d62f5

Browse files
authored
chore: switch to uv (#135)
Signed-off-by: rmdg88 <[email protected]>
1 parent 74b9f97 commit 29d62f5

23 files changed

+2584
-3006
lines changed

.github/actions/setup-poetry/action.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/scripts/build_rhel.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
set -e # trigger failure on error - do not remove!
44
set -x # display command on output
55

6-
# Build the Python package with Poetry
7-
poetry build -f sdist
6+
# Build the Python package with uv
7+
uv build --sdist
88

99
sudo -E XDG_RUNTIME_DIR= podman build --progress=plain \
1010
--build-arg USE_SYSTEM_DEPS="$USE_SYSTEM_DEPS" \
@@ -35,7 +35,8 @@ sudo -E XDG_RUNTIME_DIR= podman build --progress=plain \
3535
# pre-install build requirements + wheel for "--no-build-isolation"
3636
# build docling-parse wheel in an isolated network namespace (unshare -rn)
3737
# install the wheel and its dependencies
38-
RUN pip3.11 install poetry-core pybind11 wheel \
38+
RUN pip3.11 install --upgrade pip \
39+
&& pip3.11 install --upgrade --ignore-installed "setuptools>=77.0.3" "wheel>=0.43.0,<1.0.0" "pybind11>=2.13.6" \
3940
&& unshare -rn pip3.11 wheel \
4041
--no-deps --no-build-isolation -w /dist/ \
4142
/src/docling_parse*.tar.gz \
@@ -46,4 +47,4 @@ sudo -E XDG_RUNTIME_DIR= podman build --progress=plain \
4647
4748
RUN pip3.11 install pytest \
4849
&& pytest
49-
EOF
50+
EOF

.github/scripts/release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ fi
1010
CHGLOG_FILE="${CHGLOG_FILE:-CHANGELOG.md}"
1111

1212
# update package version
13-
poetry version "${TARGET_VERSION}"
13+
uv version "${TARGET_VERSION}"
1414

1515
# collect release notes
1616
REL_NOTES=$(mktemp)
17-
poetry run semantic-release changelog --unreleased >> "${REL_NOTES}"
17+
uv run semantic-release changelog --unreleased >> "${REL_NOTES}"
1818

1919
# update changelog
2020
TMP_CHGLOG=$(mktemp)

.github/workflows/cd.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,28 @@ jobs:
1111
code-checks:
1212
uses: ./.github/workflows/checks.yml
1313
pre-release-check:
14-
runs-on: ubuntu-22.04
14+
runs-on: ubuntu-24.04
1515
outputs:
1616
TARGET_TAG_V: ${{ steps.version_check.outputs.TRGT_VERSION }}
1717
steps:
1818
- uses: actions/checkout@v4
1919
with:
2020
fetch-depth: 0 # for fetching tags, required for semantic-release
21-
- uses: ./.github/actions/setup-poetry
21+
- name: Install uv and set the python version
22+
uses: ./.astral-sh/setup-uv@v5
2223
- name: Check version of potential release
2324
id: version_check
2425
run: |
25-
TRGT_VERSION=$(poetry run semantic-release print-version)
26+
TRGT_VERSION=$(uv run semantic-release print-version)
2627
echo "TRGT_VERSION=${TRGT_VERSION}" >> $GITHUB_OUTPUT
2728
echo "${TRGT_VERSION}"
2829
- name: Check notes of potential release
29-
run: poetry run semantic-release changelog --unreleased
30+
run: uv run semantic-release changelog --unreleased
3031
release:
3132
needs: [code-checks, pre-release-check]
3233
if: needs.pre-release-check.outputs.TARGET_TAG_V != ''
3334
environment: auto-release
34-
runs-on: ubuntu-22.04
35+
runs-on: ubuntu-24.04
3536
concurrency: release
3637
steps:
3738
- uses: actions/create-github-app-token@v1
@@ -43,7 +44,8 @@ jobs:
4344
with:
4445
token: ${{ steps.app-token.outputs.token }}
4546
fetch-depth: 0 # for fetching tags, required for semantic-release
46-
- uses: ./.github/actions/setup-poetry
47+
- name: Install uv and set the python version
48+
uses: ./.astral-sh/setup-uv@v5
4749
- name: Run release script
4850
env:
4951
GH_TOKEN: ${{ steps.app-token.outputs.token }}

.github/workflows/checks.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,26 @@ env:
66

77
jobs:
88
run-checks:
9-
runs-on: ubuntu-22.04
9+
runs-on: ubuntu-24.04
1010
strategy:
1111
matrix:
1212
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
1313
steps:
1414
- uses: actions/checkout@v4
15-
- uses: ./.github/actions/setup-poetry
15+
- name: Install uv and set the python version
16+
uses: astral-sh/setup-uv@v5
1617
with:
1718
python-version: ${{ matrix.python-version }}
18-
- name: Run styling check
19-
run: poetry run pre-commit run --all-files
20-
- name: Install with poetry
19+
- name: Sync and install with uv
2120
run: |
22-
poetry install --all-extras
21+
uv sync --frozen --all-extras
2322
ls -l
2423
ls -l docling_parse
24+
- name: Run styling check
25+
run: |
26+
uv run pre-commit run --all-files
2527
- name: Testing
2628
run: |
27-
poetry run pytest -v tests
28-
- name: Build with poetry
29-
run: poetry build
29+
uv run pytest -v tests
30+
- name: Build with uv
31+
run: uv build

.github/workflows/rhel.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
on:
22
workflow_call:
33

4+
# jobs:
5+
# run-checks:
6+
# runs-on: ubuntu-latest
7+
# steps:
8+
# - uses: actions/checkout@v4
9+
# - name: Install uv and python
10+
# uses: astral-sh/setup-uv@v5
11+
# - name: Install podman
12+
# run: sudo apt-get update && sudo apt-get install -y podman
13+
# - name: Run build in docker
14+
# run: ./.github/scripts/build_rhel.sh
15+
# shell: bash
16+
417
jobs:
518
run-checks:
6-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-24.04
720
steps:
821
- uses: actions/checkout@v4
9-
- uses: ./.github/actions/setup-poetry
22+
- name: Setup uv with python 3.11
23+
uses: astral-sh/setup-uv@v5
24+
with:
25+
python-version: 3.11
1026
- name: Install podman
1127
run: sudo apt-get update && sudo apt-get install -y podman
1228
- name: Run build in docker

0 commit comments

Comments
 (0)