-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Make sys.argspec handle functions with annotations #61080
Conversation
- always use inspect.signature in salt.utils.args.get_function_argspec() (no more getfullargspec) - add a test refs saltstack#48735
Might also fix #55499 |
@xeacott - can I get a review please? |
Lint failed for some reason on this... I'm not too familiar with the change itself however the code looks good, test looks good and changelog is there. If you feel that an integration test or another unit test would be helpful here, maybe to test a negative outcome or ensure that pytest doesn't raise a ValueError, that would be valuable. |
@xeacott - I already added a test to cover the previously failing case. Is there something else I should be testing? I know lint has passed on this PR before. I'll update from |
@msteed Oh thought that test file was inside pytest. Would you be able to covert it? Previously that's been an ask for smaller files (to convert an older test file to pytest) from the core team. |
Converted ✔️ |
re-run full all |
Failing checks seem unrelated to these changes (failing to create VMs) |
@msteed We are all waiting for the amazon and windows tests to work, SRE looking into it |
What does this PR do?
Makes sys.argspec not die on functions that use annotations
What issues does this PR fix or reference?
Fixes: #48735
Previous Behavior
Calling
sys.argspec
on a salt function that used annotations failed withNew Behavior
Calling
sys.argspec
on a salt function with annotations works (annotations are ignored)Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
Yes
Please review Salt's Contributing Guide for best practices.
See GitHub's page on GPG signing for more information about signing commits with GPG.