Skip to content

Make estension version available from sphinx #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions numpydoc/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-

__version__ = '0.6.0'
6 changes: 4 additions & 2 deletions numpydoc/numpydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

from .docscrape_sphinx import get_doc_object, SphinxDocString
from sphinx.util.compat import Directive
from ._version import __version__

if sys.version_info[0] >= 3:
sixu = lambda s: s
Expand Down Expand Up @@ -133,8 +134,9 @@ def setup(app, get_doc_object_=get_doc_object):
# Extra mangling domains
app.add_domain(NumpyPythonDomain)
app.add_domain(NumpyCDomain)

metadata = {'parallel_read_safe': True}

metadata = {'version': __version__,
'parallel_read_safe': True}
return metadata

# ------------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import division, print_function

import sys
import re

from distutils.command.sdist import sdist
import setuptools
Expand All @@ -9,7 +10,9 @@
if sys.version_info[:2] < (2, 6) or (3, 0) <= sys.version_info[0:2] < (3, 3):
raise RuntimeError("Python version 2.6, 2.7 or >= 3.3 required.")

version = "0.6.0"
versionsrc = open('numpydoc/_version.py', "rt").read()
version = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
versionsrc, re.M).group(1)

setup(
name="numpydoc",
Expand Down