Skip to content

Commit

Permalink
Merge pull request #126 from jnothman/version-lite
Browse files Browse the repository at this point in the history
Make version available to Python without dependencies; and to Sphinx metadata
  • Loading branch information
pv committed Nov 1, 2017
2 parents c5178bd + ccfc138 commit 04c9d99
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
5 changes: 4 additions & 1 deletion numpydoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

__version__ = '0.8.0.dev0'

from .numpydoc import setup

def setup(app, *args, **kwargs):
from .numpydoc import setup
return setup(app, *args, **kwargs)
4 changes: 3 additions & 1 deletion numpydoc/numpydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
raise RuntimeError("Sphinx 1.0.1 or newer is required")

from .docscrape_sphinx import get_doc_object, SphinxDocString
from . import __version__

if sys.version_info[0] >= 3:
sixu = lambda s: s
Expand Down Expand Up @@ -150,7 +151,8 @@ def setup(app, get_doc_object_=get_doc_object):
app.add_domain(NumpyPythonDomain)
app.add_domain(NumpyCDomain)

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

# ------------------------------------------------------------------------------
Expand Down
9 changes: 3 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@
import sys
import os

import setuptools # may monkeypatch distutils in some versions. # noqa
from distutils.command.sdist import sdist
import setuptools
from distutils.core import setup

from numpydoc import __version__ as version

if sys.version_info[:2] < (2, 7) or (3, 0) <= sys.version_info[0:2] < (3, 4):
raise RuntimeError("Python version 2.7 or >= 3.4 required.")

with open('numpydoc/__init__.py') as fid:
for line in fid:
if line.startswith('__version__'):
version = line.strip().split()[-1][1:-1]
break

def read(fname):
"""Utility function to get README.rst into long_description.
Expand Down

0 comments on commit 04c9d99

Please sign in to comment.