Skip to content

Make version available to Python without dependencies; and to Sphinx metadata #126

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

Merged
merged 4 commits into from
Nov 1, 2017
Merged
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
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 @@ -140,7 +141,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