build.sh: fix python package version
This commit is contained in:
parent
e38e5b10a7
commit
71a49f7b2f
1 changed files with 12 additions and 2 deletions
14
build.sh
14
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
|
||||
|
|
Loading…
Reference in a new issue