Commit 77f25554 authored by Tim 'mithro' Ansell's avatar Tim 'mithro' Ansell Committed by Sébastien Bourdeauducq
Browse files

doc: Fixing the version info.

parent b008f1d3
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
# documentation root, use os.path.abspath to make it absolute, like shown here. # documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.')) #sys.path.insert(0, os.path.abspath('.'))
import re
import sphinx_rtd_theme import sphinx_rtd_theme
# -- General configuration ----------------------------------------------------- # -- General configuration -----------------------------------------------------
...@@ -53,10 +55,14 @@ copyright = u'2011-2015, M-Labs Limited' ...@@ -53,10 +55,14 @@ copyright = u'2011-2015, M-Labs Limited'
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
# built documents. # built documents.
# #
import pkg_resources
migen_version = pkg_resources.require("migen")[0].version
# The short X.Y version. # The short X.Y version.
version = '1.0' version = re.sub(r'(\d+\.\d+)(\..*)', r'\1', migen_version)
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '1.0' release = migen_version
print("%s %s" % (version, release))
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
...@@ -227,6 +233,7 @@ man_pages = [ ...@@ -227,6 +233,7 @@ man_pages = [
# -- Options for links to the code --------------------------------------------- # -- Options for links to the code ---------------------------------------------
# Taken from numpy - https://github.com/numpy/numpy/blob/master/doc/source/conf.py#L273 # Taken from numpy - https://github.com/numpy/numpy/blob/master/doc/source/conf.py#L273
import migen
import inspect import inspect
from os.path import relpath, dirname from os.path import relpath, dirname
...@@ -279,11 +286,11 @@ def linkcode_resolve(domain, info): ...@@ -279,11 +286,11 @@ def linkcode_resolve(domain, info):
else: else:
linespec = "" linespec = ""
fn = relpath(fn, start=dirname(numpy.__file__)) fn = relpath(fn, start=dirname(migen.__file__))
if 'dev' in numpy.__version__: if 'dev' in migen_version:
return "http://github.com/m-labs/migen/blob/master/migen/%s%s" % ( return "http://github.com/m-labs/migen/blob/master/migen/%s%s" % (
fn, linespec) fn, linespec)
else: else:
return "http://github.com/m-labs/migen/blob/v%s/migen/%s%s" % ( return "http://github.com/m-labs/migen/blob/v%s/migen/%s%s" % (
numpy.__version__, fn, linespec) migen.__version__, fn, linespec)
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