Skip to content

Commit 1897df0

Browse files
committed
Retrieve the version number correctly for the docs.
1 parent 813905b commit 1897df0

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

docs/conf.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,13 @@
5151
# built documents.
5252
#
5353
# The short X.Y version.
54-
from intercom import VERSION
55-
version = VERSION
54+
55+
import re
56+
with file(os.path.join(path_dir, 'intercom', 'intercom.py')) as init:
57+
source = init.read()
58+
m = re.search("__version__ = '(\d+\.\d+\.\d+)'", source, re.M)
59+
version = m.groups()[0]
60+
5661
# The full version, including alpha/beta/rc tags.
5762
release = version
5863

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
# http://jkeyes.mit-license.org/
55
#
66

7+
import os
78
import re
89

910
from setuptools import find_packages
1011
from setuptools import setup
1112

12-
with file('intercom/intercom.py') as init:
13+
with file(os.path.join('intercom', 'intercom.py')) as init:
1314
source = init.read()
1415
m = re.search("__version__ = '(\d+\.\d+\.\d+)'", source, re.M)
1516
__version__ = m.groups()[0]

0 commit comments

Comments
 (0)