Skip to content

Commit

Permalink
packaging: allow installing without git (#4306)
Browse files Browse the repository at this point in the history
Fixes #4145
  • Loading branch information
branchvincent authored Aug 7, 2023
1 parent 91a18b3 commit f3ee96a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import fileinput
import os
import pathlib
import subprocess
import sys
Expand All @@ -32,13 +33,15 @@ def determine_version():
desc = (
subprocess.run(
["git", "describe", "--always", "--long"],
check=True,
stdout=subprocess.PIPE,
)
.stdout.decode()
.strip()
)

if not desc:
return os.environ.get("SNAP_VERSION", "0.0.0+devel")

split_desc = desc.split("-")
assert (
len(split_desc) == 3
Expand Down

0 comments on commit f3ee96a

Please sign in to comment.