-
Notifications
You must be signed in to change notification settings - Fork 371
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
Use inspect.signature to enable Python 3 only features when defining tasks #373
Conversation
Locally all tests have passed when running "invoke test":
|
Linking this to #357. @jr-minnaar: a) thanks! b) if you can, please check the assertion made in #357 about how there might be even more to this than simple getargspec/getfullargspec - it'd be nice for this to degrade gracefully as much as possible, so if there's things even newer/"better" than getfullargspec, it'd be rad to use them if it makes sense. (So e.g. inspect.signature -> not there? getfullargspec -> also not there? getargspec) |
Thanks, I'll have a look at #357. Do I leave this pull request open while investigating or what is the protocol? |
Codecov Report
@@ Coverage Diff @@
## master #373 +/- ##
==========================================
- Coverage 92.83% 92.81% -0.03%
==========================================
Files 21 21
Lines 2149 2156 +7
Branches 379 382 +3
==========================================
+ Hits 1995 2001 +6
Misses 113 113
- Partials 41 42 +1
Continue to review full report at Codecov.
|
Leaving this open is fine, I assume you'd just push more commits once you finish looking into that stuff. Thanks! |
I've updated the pull request to now use inspect.signature instead of inspect.getargspec. I've also addressed one of the TODO's that related to the argspec method. Let me know if I should rather take that out of this pull request. |
If you have a sec can you write out a list of which Python versions have which of If "just" both of |
That indeed seems to be the case:
|
Awesomesauce, thanks! Also excellent use of emoji ❤️ |
872e535
to
a50329a
Compare
Hi @bitprophet I see you've moved this pull request to the 0.16 milestone. I've rebased and rerun tests. Also removed some extra changes not related to this issue. Looking forward to the next release :-) |
Use inspect.signature instead of inspect.getargspect when using Python 3 to allow function annotations to be used in tasks. Also fix missing context in Collection test. Fixes pyinvoke#357 Make Travis CI flake8 exit with 0 Revert adding custom exception
I'm sad to see this wasn't fixed for the 1.0.0 release that just came out. |
There's actually an easier way than the PR for this commit gives, since
You can see it working here, I did it to use type-annotations for an invoke extension I worked on. |
Please 🙏 |
@bitprophet does anything stop this PR from being merged? @rsxm are you using some other workaround for that issue? |
This is a priority for me, I can review or advocate or whatever we need to do to finish this? |
@bryzgaloff hi, I still use my patched branch with this fix. I don't update this dependency much, so haven't looked at this in a long time. |
I can attest to this patch fixing my encounter with #357, at least. |
@bitprophet I noticed that you've been committing again recently. Would you mind reviewing this PR once again and merging? |
Fix #372