diff --git a/build.sh b/build.sh index 6fe36a5..c910396 100755 --- a/build.sh +++ b/build.sh @@ -18,8 +18,18 @@ fi echo "Detect version using git describe..." VERSION="$( git describe --tags|sed 's/^[^0-9]*//' )" -echo "Set version=$VERSION in setup.py using sed..." -sed -i "s/^version *=.*$/version = '$VERSION'/" setup.py +echo "Computing python version..." +if [ $( echo "$VERSION"|grep -c "-" ) -gt 0 ] +then + echo "Development version detected ($VERSION), compute custom python dev version" + PY_VERSION="$( echo "$VERSION"|sed 's/-\([0-9]\)\+-.*$/.dev\1/' )" +else + echo "Clean tagged version detected, use it" + PY_VERSION="$VERSION" +fi + +echo "Set version=$PY_VERSION in setup.py using sed..." +sed -i "s/^version *=.*$/version = '$PY_VERSION'/" setup.py if [ -d venv ] then