Skip to content

Commit a0dee0d

Browse files
committed
Add workaround to calculate package version for docs
1 parent ff5bddc commit a0dee0d

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

.idea/bootstrap-python-package.iml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/docs-version.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
# DEALINGS IN THE SOFTWARE. =
2525
#===============================================================================
2626

27-
VERSION=$(uv version --short)
27+
# uv doesn't yet support reading dynamic version: https://github.com/astral-sh/uv/issues/14137
28+
#VERSION=$(uv version --short)
29+
VERSION=$(uv run scripts/version_from_git.py)
2830
SEMVER=( ${VERSION//./ } )
2931
echo "${SEMVER[0]}.${SEMVER[1]}"

scripts/version_from_git.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# ==============================================================================
2+
# Copyright (c) 2025 Federico Busetti =
3+
4+
# =
5+
# Permission is hereby granted, free of charge, to any person obtaining a =
6+
# copy of this software and associated documentation files (the "Software"), =
7+
# to deal in the Software without restriction, including without limitation =
8+
# the rights to use, copy, modify, merge, publish, distribute, sublicense, =
9+
# and/or sell copies of the Software, and to permit persons to whom the =
10+
# Software is furnished to do so, subject to the following conditions: =
11+
# =
12+
# The above copyright notice and this permission notice shall be included in =
13+
# all copies or substantial portions of the Software. =
14+
# =
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR =
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, =
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL =
18+
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER =
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING =
20+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER =
21+
# DEALINGS IN THE SOFTWARE. =
22+
# ==============================================================================
23+
from dunamai import Version
24+
25+
version = Version.from_git().serialize()
26+
print(version)

0 commit comments

Comments
 (0)