Skip to content

MAINT: Dont import for version #382

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
Apr 14, 2022
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
2 changes: 1 addition & 1 deletion numpydoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This package provides the numpydoc Sphinx extension for handling docstrings
formatted according to the NumPy documentation format.
"""
__version__ = '1.2.2.dev0'
from ._version import __version__


def _verify_sphinx_jinja():
Expand Down
1 change: 1 addition & 0 deletions numpydoc/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '1.2.2.dev0'
10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@

from setuptools import setup

from numpydoc import __version__ as version
# Adapted from MNE-Python (BSD)
version = None
with open(os.path.join('numpydoc', '_version.py')) as fid:
for line in (line.strip() for line in fid):
if line.startswith('__version__'):
version = line.split('=')[1].strip().strip('\'')
break
if version is None:
raise RuntimeError('Could not determine version')

if sys.version_info < (3, 7):
raise RuntimeError("Python version >= 3.7 required.")
Expand Down