mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 00:28:20 +00:00
18 lines
539 B
Python
18 lines
539 B
Python
# -- Path setup --------------------------------------------------------------
|
|
from pathlib import Path
|
|
|
|
release = None
|
|
|
|
try:
|
|
with open(Path(__file__).parent.parent / 'VERSION') as f:
|
|
release = f.read().strip()
|
|
except IOError:
|
|
import subprocess
|
|
try:
|
|
release = subprocess.check_output([
|
|
'git', 'describe', '--always', '--abbrev=10', '--dirty=+', '--tags'
|
|
]).decode('utf-8').strip()
|
|
except (subprocess.CalledProcessError, OSError):
|
|
release = '(unknown version)'
|
|
del subprocess
|