Commit cf35cdf9 authored by Stefan Behnel's avatar Stefan Behnel

let sphinx docs build read Cython version from Cython/__init__.py

--HG--
extra : transplant_source : %C7%85%EE%A9%08%C7%25%E4%87%9D1%8E%C6%E4%96%C2%D7%CA%05%3C
parent 35560407
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
# serve to show the default value. # serve to show the default value.
import sys import sys
import re
import os.path
# If your extensions are in another directory, add it here. # If your extensions are in another directory, add it here.
sys.path.append('sphinxext') sys.path.append('sphinxext')
...@@ -49,10 +51,20 @@ copyright = '2011, Stefan Behnel, Robert Bradshaw, Dag Sverre Seljebotn, Greg Ew ...@@ -49,10 +51,20 @@ copyright = '2011, Stefan Behnel, Robert Bradshaw, Dag Sverre Seljebotn, Greg Ew
# The default replacements for |version| and |release|, also used in various # The default replacements for |version| and |release|, also used in various
# other places throughout the built documents. # other places throughout the built documents.
# #
# The short X.Y version.
version = '0.15'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '0.15' release = '0.15'
try:
_match_version = re.compile(r'^\s*_*version\s*_*\s*=\s*["\']([^"\']+)["\'].*').match
with open(os.path.join(os.path.dirname(__file__), '..', 'Cython', '__init__.py')) as _f:
for line in _f:
_m = _match_version(line)
if _m:
release = _m.group(1)
break
except:
pass
# The short X.Y version.
version = re.sub('^([0-9]+[.][0-9]+).*', '\g<1>', release)
# There are two options for replacing |today|: either, you set today to some # There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used: # non-false value, then it is used:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment