Skip to content

Commit

Permalink
Use GIT_DESCRIBE_TAG and GIT_DESCRIBE_NUMBER in recipe.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Jul 21, 2022
1 parent d47fa2f commit 4b835f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
20 changes: 0 additions & 20 deletions actions/update_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,6 @@ def run_cmd(cmd):

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

# Get the Sire version. (Latest tag.)
sire_version = run_cmd(f"git --git-dir={gitdir} --work-tree={srcdir} describe --tags --abbrev=0")
print(sire_version)

# Return a list of commits messages since the most recent tag.
sire_build = run_cmd(f"git --git-dir={gitdir} --work-tree={srcdir} log --oneline {sire_version}..").split("\n")
# Get the build number. (Number of commits since last tag.)
# If there are no commits, then we'll get a single item list containing an
# empty string. The logic below makes sure the build number is zero indexed.
if len(sire_build) == 1:
if sire_build[0]:
sire_build = 1
else:
sire_build = 0
else:
sire_build = len(sire_build)
print(sire_build)

# Get the Sire branch.
sire_branch = run_cmd(f"git --git-dir={gitdir} --work-tree={srcdir} rev-parse --abbrev-ref HEAD")
print(sire_branch)
Expand Down Expand Up @@ -87,8 +69,6 @@ def dep_lines(deps):
elif line.find("SIRE_BSS_REQUIREMENTS") != -1:
line = bss_reqs
else:
line = line.replace("SIRE_VERSION", sire_version)
line = line.replace("SIRE_BUILD", str(sire_build))
line = line.replace("SIRE_BRANCH", sire_branch)

FILE.write(line)
4 changes: 2 additions & 2 deletions recipes/sire/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

package:
name: {{ name }}
version: SIRE_VERSION
version: {{ GIT_DESCRIBE_TAG }}

source:
git_url: https://github.com/michellab/Sire.git
git_tag: SIRE_BRANCH

build:
number: SIRE_BUILD
number: {{ GIT_DESCRIBE_NUMBER }}

requirements:
build:
Expand Down

0 comments on commit 4b835f7

Please sign in to comment.