Skip to content
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

Python 3.8.0a4: ERROR collecting test session: DeprecationWarning: Use inspect.signature() instead of inspect.getfullargspec() #13514

Closed
hroncok opened this issue May 9, 2019 · 13 comments

Comments

@hroncok
Copy link
Contributor

hroncok commented May 9, 2019

When I try to rebuild the Fedora numpy package (numpy 1.16.3) with Python 3.8.0a4, I get this:

+ /usr/bin/python3 -m pytest -v --pyargs numpy -k 'not big_arrays and not large_archive and not test_highest_available_pickle_protocol and not test_binomial and not test_hypergeometric and not test_scalar_exception_propagation'
============================= test session starts ==============================
platform linux -- Python 3.8.0a4, pytest-4.4.1, py-1.8.0, pluggy-0.9.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /builddir/build/BUILD/numpy-1.16.3, inifile: pytest.ini
collecting ... collected 0 items / 1 errors

==================================== ERRORS ====================================
________________________ ERROR collecting test session _________________________
/usr/lib/python3.8/site-packages/_pytest/config/__init__.py:435: in _importconftest
    return self._conftestpath2mod[conftestpath]
E   KeyError: local('/builddir/build/BUILDROOT/numpy-1.16.3-2.fc31.x86_64/usr/lib64/python3.8/site-packages/numpy/conftest.py')

During handling of the above exception, another exception occurred:
/usr/lib/python3.8/site-packages/pluggy/manager.py:95: in register
    hookimpl = HookImpl(plugin, plugin_name, method, hookimpl_opts)
/usr/lib/python3.8/site-packages/pluggy/hooks.py:344: in __init__
    self.argnames, self.kwargnames = varnames(self.function)
/usr/lib/python3.8/site-packages/pluggy/hooks.py:167: in varnames
    spec = _getargspec(func)
/usr/lib/python3.8/site-packages/pluggy/hooks.py:130: in _getargspec
    return inspect.getfullargspec(func)
/usr/lib64/python3.8/inspect.py:1114: in getfullargspec
    warnings.warn("Use inspect.signature() instead of inspect.getfullargspec()",
E   DeprecationWarning: Use inspect.signature() instead of inspect.getfullargspec()
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 1 error in 0.26 seconds ============================

The deprecation warning is new in a4, however I don't understand why it errors.

@hroncok
Copy link
Contributor Author

hroncok commented May 9, 2019

Opened also pytest-dev/pluggy#209

@hroncok
Copy link
Contributor Author

hroncok commented May 17, 2019

Even when this warning is reverted in CPython, I now get this form nose:

==================================== ERRORS ====================================
______________ ERROR collecting testing/tests/test_decorators.py _______________
/usr/lib/python3.8/site-packages/_pytest/python.py:511: in _importtestmodule
    mod = self.fspath.pyimport(ensuresyspath=importmode)
/usr/lib/python3.8/site-packages/py/_path/local.py:701: in pyimport
    __import__(modname)
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:655: in _load_unlocked
    ???
<frozen importlib._bootstrap>:618: in _load_backward_compatible
    ???
/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:299: in load_module
    six.exec_(co, mod.__dict__)
../../../BUILDROOT/numpy-1.16.3-3.fc31.x86_64/usr/lib64/python3.8/site-packages/numpy/testing/tests/test_decorators.py:16: in <module>
    import nose  # noqa: F401
/usr/lib/python3.8/site-packages/nose/__init__.py:1: in <module>
    from nose.core import collector, main, run, run_exit, runmodule
/usr/lib/python3.8/site-packages/nose/core.py:11: in <module>
    from nose.config import Config, all_config_files
E     File "/usr/lib/python3.8/site-packages/nose/config.py", line 142
E       """nose configuration.
E       ^
E   SyntaxError: invalid escape sequence \.
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
==================== 9 deselected, 1 error in 11.01 seconds ====================

I think numpy should not treat such warnings from the testing frameworks as error.

@charris
Copy link
Member

charris commented May 17, 2019

@hroncok Last I checked, nose was no longer compatible with latest Python 3. That is one of the reasons we switched to pytest for NumPy testing, we only keep the nose framework for those who depend on it.

@charris
Copy link
Member

charris commented May 17, 2019

The deprecation warning is new in a4, however I don't understand why it errors.

For development testing, NumPy turns most warnings into errors.

@hroncok
Copy link
Contributor Author

hroncok commented May 17, 2019

Last I checked, nose was no longer compatible with latest Python 3. That is one of the reasons we switched to pytest for NumPy testing, we only keep the nose framework for those who depend on it.

I see that test_decorators only do nose tests if nose is present. I will remove it form the build dependencies of our numpy package and see if it helps.

@hroncok
Copy link
Contributor Author

hroncok commented May 17, 2019

For development testing, NumPy turns most warnings into errors.

I'd argue that it should not turn warnings from test dependencies into errors.

@charris
Copy link
Member

charris commented May 17, 2019

Note that the required nose fixes were pretty easy. I don't know if Fedora has been maintaining nose with its own patches.

@hroncok
Copy link
Contributor Author

hroncok commented May 17, 2019

We do: https://src.fedoraproject.org/rpms/python-nose/tree/master

@bicici
Copy link

bicici commented Jun 24, 2020

Similar code fix appear necessary in cpython to progress:
bicici/cpython@8eec967
which might also be intentionally planted.

@eric-wieser
Copy link
Member

@bicici: Did you mean to comment that somewhere else?

@bicici
Copy link

bicici commented Jun 27, 2020

Ja, I already commented about this to cython as I come across the similar fixture. The path to the fixture appears similar while you can end up at this error.

@eric-wieser
Copy link
Member

Is this still an issue?

@bsipocz
Copy link
Member

bsipocz commented May 21, 2022

As numpy has switched away from using nose, this is not an issue anymore. Please reopen if you think otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants