-
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 getfullargspec if available #458
Conversation
FWIW the vendored |
It would be nice if we could merge in one of the PRs to make |
@neighthan rather than patching your installs of invoke, just |
@bitprophet hi, thanks for all the hard work on this project! This PR seems like a simple solution to using typing in Python3 -- are there any blockers for merging it? Thanks!!! As a temporary workaround, adding quotes around the type seems to work in Python 3.7+, and an explicit variable declaration might work everywhere. from invoke import task, Context
@task
def mytask(c: 'Context'): # python3.7+
...
@task
def mytask(c):
c: Context # python3.5+ (?)
... |
Any movement on getting this small PR merged in? |
I'd love to see this merged (and released) too 🙏🏻 |
Hi 👋 The messaging for the roadmap can be found here: Key items that are putting back pressure are:
The latter task is the more important task which will make future type annotation support easier. Given this PR has a high number of 👍 votes on it I'll take that as community feedback it has good ROI for me to investigate. We do appreciate everyone's patience as we have limited volunteering time and cognitive bandwidth. |
This also duplicates work in PR #606 |
I'd argue on the contrary that #606 duplicated this work, given the timeframe 🙂 |
With the recent Python 3.11 Release. the So as of now, Is there anything I could do to support? |
Invoke doesn't work with Python 3.11 so far. pyinvoke/invoke#833 (comment) pyinvoke/invoke#458 pyinvoke/invoke#606
this fixes #891 |
@bitprophet i can also verify this patch addresses python 3.11. would be super cool if it could be merged. |
2.0.0 will be out soon & is now using |
I like using annotations in Python as it allows my IDE to provide completions:
inspect.getargspec
is deprecated since Python 3. It is still available on 3.6, however it throws an error when one uses function annotations:The new api
inspect.getfullargspecs
is a drop-in replacement according to the stdlib authors:This PR tries to use
getfullargspecs
and if that's not available, falls back togetargspecs
.