From 3d42bcd2c7a666d43274b3718e9249f817b16a74 Mon Sep 17 00:00:00 2001 From: Olaf Mersmann Date: Tue, 13 Feb 2024 02:38:28 +0100 Subject: [PATCH] [build] Allow fabrication outside git repository Currently fabricate expects to be run from inside a git checkout so that it can derive the version number from the git tags. This breaks building cocopp / cocoex from a ZIP file download from GitHub. Instead of erring out, this commit uses a default version number of '99.0.1' for the build. Fixes #2259 --- scripts/fabricate | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/fabricate b/scripts/fabricate index e721d3b11..3eb06c708 100755 --- a/scripts/fabricate +++ b/scripts/fabricate @@ -137,7 +137,10 @@ def git_version(format="pep440"): '0.1-6015-ga0a3769' if not pep440 else '0.1.6015' """ - res = git(['describe', '--tags']).lstrip("v").split("-") + try: + res = git(['describe', '--tags']).lstrip("v").split("-") + except subprocess.CalledProcessError: + res = ("99.0.0", "0", "0") if len(res) == 1: # Clean tagged release return res[0] # Strip leading v else: