From 05d4b0195f7a4a05d955ff221e07ff58624e4b54 Mon Sep 17 00:00:00 2001 From: jaseg Date: Thu, 23 May 2024 10:34:43 +0200 Subject: Make tox tests run --- setup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index d1998a4..e548f2e 100755 --- a/setup.py +++ b/setup.py @@ -10,8 +10,11 @@ from pathlib import Path import re def get_tag(): - res = subprocess.run(['git', 'describe', '--tags', '--match', 'v*'], capture_output=True, check=True, text=True) - return res.stdout.strip() + try: + res = subprocess.run(['git', '--git-dir', str(Path(__file__).with_name('.git')), 'describe', '--tags', '--match', 'v*'], capture_output=True, check=True, text=True) + return res.stdout.strip() + except subprocess.CalledProcessError as e: + return 'v0.0.0-dev' def get_version(): version, _, _rest = get_tag()[1:].partition('-') -- cgit