Skip to content

Commit ea12281

Browse files
EliEli
authored andcommitted
Switch "dirty" version to conda-compatible number.
1 parent 472af9c commit ea12281

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/python-package-conda.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ jobs:
3535
git fetch --force --tags
3636
echo "Describe: $(git describe --tags --dirty --always || true)"
3737
38-
PKG_VERSION=$(python -m setuptools_scm | sed 's/+/-/g')
39-
echo "Building version: $PKG_VERSION"
38+
RAW_VERSION=$(python -m setuptools_scm)
39+
echo "Raw setuptools_scm version: $RAW_VERSION"
40+
41+
PKG_VERSION=$(echo "$RAW_VERSION" | sed -E 's/\+g([0-9a-f]+)/.g\1/; s/-g([0-9a-f]+)/.g\1/')
42+
echo "Conda-safe version: $PKG_VERSION"
4043
4144
if [ -z "$PKG_VERSION" ] || [ "$PKG_VERSION" = "0.0.0" ] || [ "$PKG_VERSION" = "None" ]; then
4245
echo "ERROR: Bad PKG_VERSION='$PKG_VERSION'"

0 commit comments

Comments
 (0)