Skip to content

Commit 4b835f7

Browse files
committed
Use GIT_DESCRIBE_TAG and GIT_DESCRIBE_NUMBER in recipe.
1 parent d47fa2f commit 4b835f7

2 files changed

Lines changed: 2 additions & 22 deletions

File tree

actions/update_recipe.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,6 @@ def run_cmd(cmd):
3939

4040
gitdir = os.path.join(srcdir, ".git")
4141

42-
# Get the Sire version. (Latest tag.)
43-
sire_version = run_cmd(f"git --git-dir={gitdir} --work-tree={srcdir} describe --tags --abbrev=0")
44-
print(sire_version)
45-
46-
# Return a list of commits messages since the most recent tag.
47-
sire_build = run_cmd(f"git --git-dir={gitdir} --work-tree={srcdir} log --oneline {sire_version}..").split("\n")
48-
# Get the build number. (Number of commits since last tag.)
49-
# If there are no commits, then we'll get a single item list containing an
50-
# empty string. The logic below makes sure the build number is zero indexed.
51-
if len(sire_build) == 1:
52-
if sire_build[0]:
53-
sire_build = 1
54-
else:
55-
sire_build = 0
56-
else:
57-
sire_build = len(sire_build)
58-
print(sire_build)
59-
6042
# Get the Sire branch.
6143
sire_branch = run_cmd(f"git --git-dir={gitdir} --work-tree={srcdir} rev-parse --abbrev-ref HEAD")
6244
print(sire_branch)
@@ -87,8 +69,6 @@ def dep_lines(deps):
8769
elif line.find("SIRE_BSS_REQUIREMENTS") != -1:
8870
line = bss_reqs
8971
else:
90-
line = line.replace("SIRE_VERSION", sire_version)
91-
line = line.replace("SIRE_BUILD", str(sire_build))
9272
line = line.replace("SIRE_BRANCH", sire_branch)
9373

9474
FILE.write(line)

recipes/sire/template.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
package:
44
name: {{ name }}
5-
version: SIRE_VERSION
5+
version: {{ GIT_DESCRIBE_TAG }}
66

77
source:
88
git_url: https://github.com/michellab/Sire.git
99
git_tag: SIRE_BRANCH
1010

1111
build:
12-
number: SIRE_BUILD
12+
number: {{ GIT_DESCRIBE_NUMBER }}
1313

1414
requirements:
1515
build:

0 commit comments

Comments
 (0)