Skip to content

Commit 7758212

Browse files
committed
fix(pypi): actually fall back to the workspace version in Resolve version
08853a3 documented the version chain (input -> tag -> workspace root Cargo.toml, like npm-publish.yml) but only updated the comments - the Resolve version step still kept pyproject.toml's committed version on blank-input runs, which is a local-build fallback release.sh never bumps. That is how the v0.35.0 release shipped crates at 0.35.0 while a default-input pypi run built 0.34.0 again. Implement the chain for real: blank version + blank tag now reads the workspace version from the root Cargo.toml and always patches [project].version before the sdist build. Also sync the committed local-build fallbacks in docling-py's Cargo.toml/pyproject.toml to 0.35.0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EY5KAiquN4YpVf2PXEQkVT Signed-off-by: artiz <artem.kustikov@gmail.com>
1 parent 7ab3946 commit 7758212

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

.github/workflows/pypi-publish.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,23 @@ jobs:
5858
with:
5959
ref: ${{ inputs.tag || github.ref }}
6060

61-
# Version override: patch [project].version in pyproject.toml before the
62-
# sdist is built so every wheel (built from the sdist) inherits it. No
63-
# override → keep the version already declared in the file.
61+
# Version resolution mirrors npm-publish.yml: explicit `version` input,
62+
# else the release `tag`, else the workspace version from the root
63+
# Cargo.toml (NOT pyproject.toml — the version committed there is a
64+
# local-build fallback that release.sh never bumps). The resolved version
65+
# is always patched into [project].version before the sdist is built so
66+
# every wheel (built from the sdist) inherits it.
6467
- name: Resolve version
6568
shell: bash
6669
working-directory: crates/docling-py
6770
run: |
6871
v="${{ inputs.version }}"
6972
if [ -z "$v" ] && [ -n "${{ inputs.tag }}" ]; then v="${{ inputs.tag }}"; v="${v#v}"; fi
70-
if [ -n "$v" ]; then
71-
sed -i.bak -E "0,/^version = \".*\"/s//version = \"$v\"/" pyproject.toml && rm -f pyproject.toml.bak
72-
echo "Building docling-rs $v"
73-
else
74-
echo "Building docling-rs $(grep -m1 '^version = ' pyproject.toml | sed -E 's/.*"([^"]+)".*/\1/') (from pyproject.toml)"
73+
if [ -z "$v" ]; then
74+
v="$(grep -m1 '^version = ' ../../Cargo.toml | sed -E 's/.*"([^"]+)".*/\1/')"
7575
fi
76+
sed -i.bak -E "0,/^version = \".*\"/s//version = \"$v\"/" pyproject.toml && rm -f pyproject.toml.bak
77+
echo "Building docling-rs $v"
7678
7779
- uses: actions/setup-python@v5
7880
with:

crates/docling-py/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ name = "docling-py"
1313
# Fallback for local builds only — pyproject.toml's [project].version is what
1414
# maturin ships, and CI (pypi-publish.yml) patches that from the workspace
1515
# version at publish time.
16-
version = "0.34.0"
16+
version = "0.35.0"
1717
edition = "2021"
1818
license = "MIT"
1919
repository = "https://github.com/docling-project/docling.rs"

crates/docling-py/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ build-backend = "maturin"
1010
name = "docling-rs"
1111
# Fallback for local maturin builds — pypi-publish.yml overwrites this with the
1212
# workspace version (root Cargo.toml) on every release.
13-
version = "0.34.0"
13+
version = "0.35.0"
1414
description = "Rust port of docling (docling.rs): convert PDF/DOCX/HTML/... to Markdown or docling JSON. Python bindings."
1515
readme = "README.md"
1616
license = { text = "MIT" }

0 commit comments

Comments
 (0)