Skip to content

Commit

Permalink
MAINT: Dont import for version (#382)
Browse files Browse the repository at this point in the history
* MAINT: Dont import for version

* FIX: Sp

* FIX: Add

* STY: PEP
  • Loading branch information
larsoner committed Apr 14, 2022
1 parent 4aea3d2 commit 9eb6f9b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
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

0 comments on commit 9eb6f9b

Please sign in to comment.