Merge pull request #1821 from nmeum/prefer-version-file

get_version.py: Prefer VERSIONFILE over git-describe(1)
This commit is contained in:
Kodi Arfer 2019-09-23 15:56:09 -04:00 committed by GitHub
commit 32a734cedc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 12 deletions

View File

@ -92,3 +92,4 @@
* Brandon T. Willard <brandonwillard@gmail.com> * Brandon T. Willard <brandonwillard@gmail.com>
* Andrew R. M. <nixy@nixy.moe> * Andrew R. M. <nixy@nixy.moe>
* Tristan de Cacqueray <tdecacqu@redhat.com> * Tristan de Cacqueray <tdecacqu@redhat.com>
* Sören Tempel <soeren@soeren-tempel.net>

View File

@ -5,6 +5,9 @@ import os, subprocess, runpy
os.chdir(os.path.split(os.path.abspath(__file__))[0]) os.chdir(os.path.split(os.path.abspath(__file__))[0])
VERSIONFILE = os.path.join("hy", "version.py") VERSIONFILE = os.path.join("hy", "version.py")
if "HY_VERSION" in os.environ:
__version__ = os.environ["HY_VERSION"]
else:
try: try:
__version__ = (subprocess.check_output __version__ = (subprocess.check_output
(["git", "describe", "--tags", "--dirty"]) (["git", "describe", "--tags", "--dirty"])