painterjd / stoplight

Stoplight -- An Input Validation Framework for Python
Apache License 2.0
15 stars 5 forks source link

DeprecationWarning on Python 3.6 + pytest 4.1.1 #19

Closed drewbrew closed 5 years ago

drewbrew commented 5 years ago

Snipped pytest output when trying to validate rules:

/path/to/my/venv/lib/python3.6/site-packages/stoplight/decorators.py:101: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() or inspect.getfullargspec()
    funcparams = inspect.getargspec(f)

and

/path/to/my/venv/lib/python3.6/site-packages/stoplight/rule.py:47: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() or inspect.getfullargspec()
    if inspect.getargspec(self.errfunc).args == []:

Per the Python 3.6 docs:

Deprecated since version 3.0: Use getfullargspec() for an updated API that is usually a drop-in replacement, but also correctly handles function annotations and keyword-only parameters.