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

Support for keyword arguments in rez-python #492

Closed
ghost opened this issue Mar 2, 2018 · 5 comments
Closed

Support for keyword arguments in rez-python #492

ghost opened this issue Mar 2, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented Mar 2, 2018

Looking at how rez-python is implemented, this looks like a difficult request, but I'll ask it anyway.

Right now rez-python only supports positional arguments- no flags or kwargs.

So, rez-python ./scriptname /path/to/file/1 /path/to/file2 works, but rez-python ./scriptname -i --sequence baz --shot 100 will not, because rez tries to eat the flags and kwargs, then errors out when it doesn't understand them.

I feel like it'd be a neat addition, because it would allow people to place #!/usr/bin/env rez-python as a script shebang line, and have it behave exactly as if you called the script with rez-env rez -c "{sys.argv}", which is how I initially expected rez-python to behave.

@bpabel
Copy link
Contributor

bpabel commented Mar 2, 2018

I think it would be possible to update the command to handle that without breaking backwards compatibility. Right now, it's ignoring arguments from the other argument groups (seperated by --), but really, those should just be passed to python unprocessed.

rez-python [REZ ARGS] -- /path/to/script.py arg1 arg2 --keywords -f --debug

@nerdvegas
Copy link
Contributor

nerdvegas commented Mar 15, 2018 via email

@ghost
Copy link
Author

ghost commented Mar 15, 2018

I was actually hoping for rez-python to not even take default rez arguments- for it to pass given arguments and flags straight to the script it's calling- that way I can place it in shebang lines.

I can write my own script for that though. My use cases might not match up with the normal use case for rez-python.

@nerdvegas
Copy link
Contributor

@swallitsch I think I can support passthru args here, looking into it shortly.

@nerdvegas
Copy link
Contributor

Addressed by #523

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

No branches or pull requests

2 participants