From ffbd043971700d08f34ee2d1441c63483385dfa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=BDubom=C3=ADr=20Ku=C4=8Dera?= Date: Wed, 10 May 2023 20:00:27 +0200 Subject: [PATCH] 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 --- bin/cdist-build-helper | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/cdist-build-helper b/bin/cdist-build-helper index cadddae7..0a4b710a 100755 --- a/bin/cdist-build-helper +++ b/bin/cdist-build-helper @@ -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)