Coder Social home page Coder Social logo

Comments (9)

mdmintz avatar mdmintz commented on September 26, 2024

@adiroiban Thanks for reporting this. I found a workaround: pyinvoke/invoke#833 (comment)

I'll be shipping a new release with the fix very soon.

from pynose.

adiroiban avatar adiroiban commented on September 26, 2024

This is the way I am patching it for nose

inspect.getargspec = lambda func: inspect.getfullargspec(func)[:4]

from pynose.

mdmintz avatar mdmintz commented on September 26, 2024

@adiroiban If you use:

if not hasattr(inspect, 'getargspec'):
    inspect.getargspec = inspect.getfullargspec

does that work for you? That seems to be the solution that many people liked.

from pynose.

adiroiban avatar adiroiban commented on September 26, 2024

As far as I remember, no. It doesn't work.

See the docs https://docs.python.org/3/library/inspect.html#inspect.getfullargspec

getfullargspec returns FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations)

nose usage is args, varargs, varkw, defaults = inspect.getargspec(func)

but nose is only using the args from the return value.


Wouldn't it be better to have everything in the pynose namespace ?

That is, instead of patching the vanilla nose, why not continue the development as a separate project?

from pynose.

mdmintz avatar mdmintz commented on September 26, 2024

@adiroiban I'll start with the quick patches, and then make more changes as needed.

I'll use the following after importing inspect:

inspect.getargspec = lambda func: inspect.getfullargspec(func)[:4]

If you say that solves your current issue, I can make the necessary changes quickly and push a release within an hour.

from pynose.

adiroiban avatar adiroiban commented on September 26, 2024

I don't think that we need to rush.
I already have this working on my fork ... and for practical and security reasons I will always use a fork from a private PyPI server :)

I think is best to update the automated tests to reveal this issue and then push a fix.

Let me give this a try. I will push a PR and I will give you access to the branch.

from pynose.

mdmintz avatar mdmintz commented on September 26, 2024

@adiroiban If the only change is:

if not hasattr(inspect, "getargspec"):
    inspect.getargspec = lambda func: inspect.getfullargspec(func)[:4]

I can push that change quickly.

from pynose.

adiroiban avatar adiroiban commented on September 26, 2024

I am not sure that is the only change.

But most probably it is.

It would have been nice to have the full nose test available and run those tests, rather than reinventing tests for pynose

Let's check the changes in the PR.

I first would like to see the CI failing and then fix the issue :)

And also add a NEWS.md or some release notes file to keep track of latest changes in the repo :p

from pynose.

mdmintz avatar mdmintz commented on September 26, 2024

Resolved in 1.4.5 - https://github.com/mdmintz/pynose/releases/tag/v1.4.5

from pynose.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.