File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change 1313
1414import sys , os
1515
16+
17+ # Read Roundup version by importing it from parent directory,
18+ # this ensures that 'unkown version' is inserted even if
19+ # `roundup` is importable from other location in sys.path
20+ SYSSAVE = sys .path
21+ DOCROOT = os .path .abspath (os .path .dirname (__file__ ))
22+ sys .path = [os .path .dirname (DOCROOT )]
1623try :
17- sys .path .insert (0 , os .pardir )
18- from roundup import __version__ as roundupversion
19- sys .path .pop (0 )
24+ from roundup import __version__ as VERSION
25+ SHORTVER = '.' .join (VERSION .split ('.' , 2 )[:2 ])
2026except ImportError :
21- roundupversion = '(unknown version)'
27+ VERSION = SHORTVER = '(unknown version)'
28+ finally :
29+ sys .path = SYSSAVE
30+
2231
2332# If your extensions are in another directory, add it here. If the directory
2433# is relative to the documentation root, use os.path.abspath to make it
5362# built documents.
5463#
5564# The short X.Y version.
56- version = '.' . join ( roundupversion . split ( '.' , 2 )[: 2 ])
65+ version = SHORTVER
5766# The full version, including alpha/beta/rc tags.
58- release = roundupversion
67+ release = VERSION
5968
6069# The language for content autogenerated by Sphinx. Refer to documentation
6170# for a list of supported languages.
You can’t perform that action at this time.
0 commit comments