Skip to content

Commit 701fc3d

Browse files
authored
Merge pull request #76 from jschueller/version
Add __version__ attribute
2 parents 5084f79 + 86d88bb commit 701fc3d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

numpydoc/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
from __future__ import division, absolute_import, print_function
22

3+
__version__ = '0.6.0'
4+
35
from .numpydoc import setup

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
if sys.version_info[:2] < (2, 6) or (3, 0) <= sys.version_info[0:2] < (3, 3):
1010
raise RuntimeError("Python version 2.6, 2.7 or >= 3.3 required.")
1111

12-
version = "0.6.0"
12+
with open('numpydoc/__init__.py') as fid:
13+
for line in fid:
14+
if line.startswith('__version__'):
15+
version = line.strip().split()[-1][1:-1]
16+
break
1317

1418
setup(
1519
name="numpydoc",

0 commit comments

Comments
 (0)