question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python 3.8: DeprecationWarning: Use inspect.signature() instead of inspect.getfullargspec()

See original GitHub issue

A lot of Fedora packages, when rebuilt with Python 3.8.0a4 fail to collect tests with pytest:

+ /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 ============================

Now I don’t know if treating this DeprecationWarning as error is the default pytest behavior or specific projects (mis)configuration, but the warning comes from pluggy. We still have 0.9.0, but I see getfullargspec() even in master.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
hroncokcommented, May 13, 2019

The discussion seems ongoing. I’d say that migrating to inspect.signature() is still a good way to go.

0reactions
hroncokcommented, May 13, 2019

@nicoddemus You’ve assigned this to yourself. I’ll try to test the above code and submit a PR if it works. Let me know if you are already in the middle of the same.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue 27172: Undeprecate inspect.getfullargspec()
Are you able to use inspect.getfullargspec() on Python 3 rather than inspect.getargspec()? While both are technically deprecated, ...
Read more >
inspect.getargspec() is deprecated since Python 3.0
Referring to the documents, I've found out that I have two ways to disable this warning: Passing -p no:warnings to the py.test in...
Read more >
[reportlab-users] deprecation warning - Google Groups
following deprecation warning on Python 3.8 > ... inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec().
Read more >
Tons of deprecation warnings in Plone 5.2 - Plone Community
... since Python 3.0, use inspect.signature() or inspect.getfullargspec() ... from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 ...
Read more >
1708004 – python-sqlalchemy fails to build with Python 3.8
... warnings.warn("Use inspect.signature() instead of inspect.getfullargspec()", INTERNALERROR> DeprecationWarning: Use inspect.signature() ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found