Skip to content

Commit

Permalink
[build] Allow fabrication outside git repository
Browse files Browse the repository at this point in the history
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
  • Loading branch information
olafmersmann committed Feb 13, 2024
1 parent 9c97288 commit 3d42bcd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/fabricate
Expand Up @@ -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:
Expand Down

0 comments on commit 3d42bcd

Please sign in to comment.