Mercurial > repos > dcouvin > resfinder4
comparison resfinder/git_test.py @ 0:55051a9bc58d draft default tip
Uploaded
| author | dcouvin |
|---|---|
| date | Mon, 10 Jan 2022 20:06:07 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:55051a9bc58d |
|---|---|
| 1 #!/usr/bin/env python3 | |
| 2 import os.path | |
| 3 | |
| 4 from cge.out.util.generator import Generator | |
| 5 | |
| 6 from git import Repo | |
| 7 | |
| 8 | |
| 9 # git_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) | |
| 10 git_path = os.path.abspath(os.path.dirname(__file__)) | |
| 11 print("Git path: {}".format(git_path)) | |
| 12 repo = Repo(git_path) | |
| 13 commit = repo.commit() | |
| 14 | |
| 15 com2tag = {} | |
| 16 for tag in repo.tags: | |
| 17 com2tag[tag.commit.hexsha] = str(tag) | |
| 18 | |
| 19 version = com2tag.get(repo.commit().hexsha, repo.commit().hexsha[:7]) | |
| 20 print("Version: {}".format(version)) | |
| 21 | |
| 22 git_path = os.path.abspath(os.path.dirname(__file__)) | |
| 23 result = Generator.init_software_result(name="ResFinder", gitdir=git_path) | |
| 24 print(str(result)) |
