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
RST-3172 Check that requirements file is locked #62
Conversation
56abf99
to
ee9903a
Compare
e3b94ae
to
3997b66
Compare
299ad4c
to
1ed764a
Compare
@@ -1,4 +1,4 @@ | |||
#!/usr/bin/env python | |||
#!/usr/bin/env python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really got tired of the python2 subprocess module. Onward!
|
||
args = parser.parse_args() | ||
|
||
extra_pip_args = args.extra_pip_args[1:-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's weird that args.extra_pip_args
includes the wrapping ""
. Somewhere along the line extra quotes are being inserted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it was some weird mess with passing args from cmake list->shell->python, where some of those args are prefixed with -
but shouldn't be processed by argparse...
I won't pretend this is the best way - I mostly got there via trial and error until something worked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe args.extra_pip_args.strip("\"\'")
would be more robust if some of this pipeline changes.
catkin_virtualenv/scripts/venv_check
Outdated
parser.add_argument( | ||
'--requirements', required=True, help="Requirements to check.") | ||
parser.add_argument( | ||
'--extra-pip-args', default="\"\"", type=str, help="Extra pip args for install.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This any different from '""'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think black will complain about '""'
:(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh. Dunno why I didn't think of that earlier, works for me.
From discussion with @abencz, we probably don't want to blindly recommend INPUT_REQUIREMENTS, and instead just ensure that requirements are actually locked.
This actually satisfies the spirit of the RST-3172 better, since we can detect any insufficiently locked requirements.
Sneaks in a python3 port of catkin_virtualenv proper.