Skip to content

Commit

Permalink
Add packaging requirement and properly compare scipy version (johannf…
Browse files Browse the repository at this point in the history
  • Loading branch information
johannfaouzi authored Feb 7, 2023
1 parent 2434592 commit 5a66eb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions doc/pytsdtwdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
import inspect
import textwrap
import warnings

from packaging.version import parse

from numpydoc.numpydoc import mangle_docstrings
from docutils.statemachine import ViewList
from sphinx.domains.python import PythonDomain

import scipy
SCIPY_VERSION = scipy.__version__
if SCIPY_VERSION < '1.5':
if parse(SCIPY_VERSION) < parse('1.5'):
from scipy._lib._util import getargspec_no_self
else:
from scipy._lib._util import getfullargspec_no_self
Expand Down Expand Up @@ -85,7 +85,7 @@ def run(self):
# Interface function
name = self.arguments[0].strip()
obj = _import_object(name)
if SCIPY_VERSION < '1.5':
if parse(SCIPY_VERSION) < parse('1.5'):
args, varargs, keywords, defaults = getargspec_no_self(obj)
else:
(args, varargs, keywords,
Expand All @@ -94,7 +94,7 @@ def run(self):
# Implementation function
impl_name = self.options['impl']
impl_obj = _import_object(impl_name)
if SCIPY_VERSION < '1.5':
if parse(SCIPY_VERSION) < parse('1.5'):
impl_args, impl_varargs, impl_keywords, impl_defaults = (
getargspec_no_self(impl_obj))
else:
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
'sphinx==1.8.5',
'sphinx-gallery',
'numpydoc',
'matplotlib'
'matplotlib',
'packaging'
]
}
PACKAGE_DATA = {
Expand Down

0 comments on commit 5a66eb0

Please sign in to comment.