[doc] Version no longer gets spellchecked

This commit is contained in:
Jonathan Rubenstein
2021-12-26 07:00:49 +02:00
committed by Geoffrey McRae
parent 02ec25b008
commit 6ef3fea05e
3 changed files with 36 additions and 20 deletions

17
doc/lgrelease.py Normal file
View File

@@ -0,0 +1,17 @@
# -- 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