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 1/2] 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) -- 2.40.1 From 853aac03da264d2a8b562bbb6bf96ab0bafc634c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=BDubom=C3=ADr=20Ku=C4=8Dera?= Date: Sun, 4 Jun 2023 14:37:34 +0200 Subject: [PATCH 2/2] Merge sed commands --- bin/cdist-build-helper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-build-helper b/bin/cdist-build-helper index 0a4b710a..6f514ef5 100755 --- a/bin/cdist-build-helper +++ b/bin/cdist-build-helper @@ -534,7 +534,7 @@ eof ;; version) - target_version="$(git describe | sed 's/-/.dev/' | sed 's/-/+/g')" + target_version="$(git describe | sed 's/-/.dev/; s/-/+/g')" printf "VERSION = \"%s\"\n" "${target_version}" > cdist/version.py ;; -- 2.40.1