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 1313# import os
1414# import sys
1515# 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." )
1735
1836# -- Project information -----------------------------------------------------
1937
2240author = 'Aaron Pulver'
2341
2442# The full version, including alpha/beta/rc tags
25- release = allagash . __version__
43+ release = find_version ( r"../src/ allagash" , "__init__.py" )
2644
2745
2846# -- General configuration ---------------------------------------------------
You can’t perform that action at this time.
0 commit comments