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

Fix #81: Stop using 'inspect.getargspec()' #94

Merged
merged 2 commits into from
Nov 24, 2017

Conversation

stephenfin
Copy link
Contributor

This function is deprecated and raises the warning.

DeprecationWarning: inspect.getargspec() is deprecated, use
inspect.signature() instead

While this suggests we use 'inspect.signature()', there's no reason to
use this instead of the 'inspect.getfullargspec()', which has almost
identical semantics to 'inspect.getargspec()' but handles kwargs-only
functions. For what we want though, this is a drop-in replacement.

Note that because 'inspect.getfullargspec()' isn't provided in Python
2.7, we may see slightly different behavior between Python 2 and 3 (e.g.
for the kwargs-only case above). There's nothing we can do about this
without vendoring the entire function.

This function is deprecated and raises the warning.

  DeprecationWarning: inspect.getargspec() is deprecated, use
  inspect.signature() instead

While this suggests we use 'inspect.signature()', there's no reason to
use this instead of the 'inspect.getfullargspec()', which has almost
identical semantics to 'inspect.getargspec()' but handles kwargs-only
functions. For what we want though, this is a drop-in replacement.

Note that because 'inspect.getfullargspec()' isn't provided in Python
2.7, we may see slightly different behavior between Python 2 and 3 (e.g.
for the kwargs-only case above).  There's nothing we can do about this
without vendoring the entire function.

Signed-off-by: Stephen Finucane <stephen@that.guru>
@RonnyPfannschmidt
Copy link
Member

pytest already uses funcsigs on the features branch i propose doing the same to get the signature api in all cases (as it will also be more correct in all cases)

@nicoddemus
Copy link
Member

Merged with latest master.

@nicoddemus
Copy link
Member

I think we should merge and release 0.6.1 so we fix pytest-dev/pytest#2946 and are able to release pytest-3.3.

@goodboy
Copy link
Contributor

goodboy commented Nov 23, 2017

@nicoddemus since when are we at minor version 0.6.x?

@nicoddemus
Copy link
Member

Oh sorry you are right, we didn't release 0.6 yet. 😛

Merge and release 0.6 then?

@nicoddemus
Copy link
Member

@RonnyPfannschmidt gentle ping. 😁

@RonnyPfannschmidt RonnyPfannschmidt merged commit 817170d into pytest-dev:master Nov 24, 2017
@goodboy
Copy link
Contributor

goodboy commented Nov 24, 2017

@nicoddemus I was going to say I I feel like we just need a patch release since the only things that have been added since 0.5.2 are bug fixes or small compatibility fixes for py3.6. But then I realized we dropped py2.6/3.3 support so I guess that warrants it.

I'll whip something up.

@nicoddemus
Copy link
Member

I'll whip something up.

If you can ship 0.6 it would be great as it would allow @The-Compiler to test the pytest features branch again. 😉

If all goes well I intend to release pytest-3.3 tonight. 👍

@goodboy
Copy link
Contributor

goodboy commented Nov 24, 2017

@nicoddemus sounds good!

@nicoddemus
Copy link
Member

Cool. Let me know when that's done so I can update pytest's requirements for pluggy in setup.py. 👍

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

Successfully merging this pull request may close these issues.

4 participants