Make development version strings PEP 440 compliant

With current pip (23.1.2) and setuptools (67.7.2) versions, installation
from Git was failing with "Invalid version: '7.0.0-17-ge57cf1e7'"
message. The issue can be reproduced by running the following command
with the latest pip and setuptools installed:

  $ pip install git+https://code.ungleich.ch/ungleich-public/cdist.git@e57cf1e70a3818180b3f54e1e0364ff3b6bbd9cc#egg=cdist
This commit is contained in:
lubo 2023-05-10 20:00:27 +02:00
parent e57cf1e70a
commit ffbd043971
Signed by untrusted user: lubo
GPG key ID: CAEDE3D60E2B4E43

View file

@ -534,7 +534,8 @@ eof
;;
version)
printf "VERSION = \"%s\"\n" "$(git describe)" > cdist/version.py
target_version="$(git describe | sed 's/-/.dev/' | sed 's/-/+/g')"
printf "VERSION = \"%s\"\n" "${target_version}" > cdist/version.py
;;
target-version)