Skip to content

Commit 1195e39

Browse files
committed
docs: Read release version from changelog
fixes #1157
1 parent 69b6552 commit 1195e39

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

docs/conf.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1+
import re
12
import sys
23

34
sys.path.append('.')
45

5-
VERSION = '0.3.9'
6+
7+
def changelog_version(path, encoding='utf-8'):
8+
version_pattern = re.compile(
9+
r'^v(?P<version>[0-9]+\.[0-9]+\.[0-9]+)',
10+
re.MULTILINE,
11+
)
12+
13+
with open(path, encoding=encoding) as f:
14+
match = version_pattern.search(f.read())
15+
return match.group('version')
16+
17+
18+
VERSION = changelog_version('changelog.rst')
619

720
author = u'Network Genomics'
821
copyright = u'2021, the Mitogen authors'

0 commit comments

Comments
 (0)