From cf8a95af5071806a8d3920c75776b4fbad81ca7c Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 7 Apr 2023 10:36:48 +0200 Subject: [PATCH] setup.py: produce PEP440 compatible version when repositoty is dirty --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 88055b6..7408b16 100644 --- a/setup.py +++ b/setup.py @@ -98,6 +98,8 @@ def get_version(): if '-' in result: # not a tagged version real_number, commit_count, commit_hash = result.split('-', 2) version = '%s.post%s+%s' % (real_number, commit_count, commit_hash) + elif result.endswith('.dirty'): + version = result[:-6] + '+dirty' else: version = result return version