File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change 13
13
# import os
14
14
# import sys
15
15
# sys.path.insert(0, os.path.abspath('.'))
16
- import allagash
16
+ import codecs
17
+ import os
18
+ import re
19
+
20
+ here = os .path .abspath (os .path .dirname (__file__ ))
21
+
22
+
23
+ def read (* parts ):
24
+ with codecs .open (os .path .join (here , * parts ), 'r' ) as fp :
25
+ return fp .read ()
26
+
27
+
28
+ def find_version (* file_paths ):
29
+ version_file = read (* file_paths )
30
+ version_match = re .search (r"^__version__ = ['\"]([^'\"]*)['\"]" ,
31
+ version_file , re .M )
32
+ if version_match :
33
+ return version_match .group (1 )
34
+ raise RuntimeError ("Unable to find version string." )
17
35
18
36
# -- Project information -----------------------------------------------------
19
37
22
40
author = 'Aaron Pulver'
23
41
24
42
# The full version, including alpha/beta/rc tags
25
- release = allagash . __version__
43
+ release = find_version ( r"../src/ allagash" , "__init__.py" )
26
44
27
45
28
46
# -- General configuration ---------------------------------------------------
You can’t perform that action at this time.
0 commit comments