stamp the version with the current git hash

This commit is contained in:
Paul Gauthier 2024-08-30 11:47:55 -07:00
parent 8887af5635
commit 9a24b3c6d0
2 changed files with 15 additions and 12 deletions

View file

@ -1,22 +1,21 @@
__version__ = "0.54.8-dev"
"""
[[[cog
"""[[[cog
import subprocess
try:
git_hash = subprocess.check_output(['git', 'rev-parse', '--short=7', 'HEAD'], universal_newlines=True).strip()
git_hash = subprocess.check_output(
['git', 'rev-parse', '--short=7', 'HEAD'],
universal_newlines=True,
).strip()
except subprocess.CalledProcessError:
git_hash = ""
git_hash = None
print(f'git_hash = "{git_hash}"')
]]]
"""
git_hash = "deadbee" # This line will be replaced by cog
"""
[[[end]]]
"""
cog.out(f'git_hash = "{git_hash}"')
]]]"""
git_hash = "3fcb9e2"
"""[[[end]]]"""
if '-dev' in __version__:
if "-dev" in __version__ and git_hash:
xyz = __version__.split("-")[0]
__version__ = xyz + "-dev+" + git_hash

View file

@ -21,3 +21,7 @@ cog $ARG \
aider/website/docs/config/aider_conf.md \
aider/website/docs/leaderboards/index.md \
aider/website/docs/llms/other.md
cog -r aider/__init__.py && git add aider/__init__.py && git commit -m "updating version hash"