pyblish-base icon indicating copy to clipboard operation
pyblish-base copied to clipboard

Added fix for inspect.getargspec in Py3

Open munkybutt opened this issue 3 years ago • 4 comments

This PR adds Py3 specific import for inspect.getfullargspec as inspect.getargspec is depreciated since Py3.0. More info here: https://docs.python.org/3/library/inspect.html#inspect.getargspec

This also removes warnings output from Pyblish upon plugin discovery which prints the following 3 times per plugin discovered: "DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec(), at line 350, in "...\pyblish\plugin.py"". This has a noticeable impact on startup performance for projects with a large number of plugins.

Py2: functionality remains unchanged Py3: tested in Py37 + Py39

munkybutt avatar Oct 19 '22 13:10 munkybutt

just hit the same issue, wanted to open PR for it and voila - its already here! Thanks

antirotor avatar Oct 21 '22 13:10 antirotor

Looks good to me. 🍻

I just did a quick codebase search and I found out that in here in pyblish/compat.py also uses deprecated inspect.getargspec. Should we also update that one?

The other appearance is in pyblish/vendor/mock.py, but it's for testing and it's a vendored module so maybe other PR when needed.

davidlatwe avatar Oct 21 '22 17:10 davidlatwe

Really good point - I will fix those up too

munkybutt avatar Oct 22 '22 12:10 munkybutt

looks like vendor/mock already has this handled: https://github.com/pyblish/pyblish-base/blob/master/pyblish/vendor/mock.py#L170

munkybutt avatar Oct 22 '22 12:10 munkybutt

inspect.getargspec has been removed from Python 3.11 so it's no longer just a matter of depreciation warnings and slower startup times. Pyblish currently will not run on the latest stable Python release because of this bug so it would be great to get this PR merged.

jedfrechette avatar Dec 24 '22 05:12 jedfrechette

Bump - any chance of proceeding with a merge, especially as it is making Pyblish nonfunctional on Python 3.11

munkybutt avatar Dec 29 '22 08:12 munkybutt

Marcus is on vacation at the moment, should be back in a couple weeks. :)

davidlatwe avatar Dec 29 '22 09:12 davidlatwe

Hey - any progress on getting this merged?

munkybutt avatar Feb 04 '23 13:02 munkybutt

@mottosso @davidlatwe What's needed to get this merged?

BigRoy avatar Feb 23 '23 07:02 BigRoy

Hi everyone, sorry this slipped under my radar. Feel free to @mottosso me like the above to make it appear on my list of things todo.

As for the PR, this looks solid to me - short and sweet - and all tests still pass. Merging this!

mottosso avatar Feb 23 '23 07:02 mottosso