-
Notifications
You must be signed in to change notification settings - Fork 8
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
Unify spack command into separate function #95
Conversation
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.
Looks good!
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.
Looks good @chapman39
Suggestion for the future: Instead of calling the shell execute (sexe
) command with a first argument of self.spack_exe_path
would it make sense to have a function called spack_command
where we pass in the command and options more explicitly?
E.g. instead of
sexe('{0} find -p /{1}, self.spack_exe_path(), pkg_hash)
consider:
spack_command("find", "-p /{0}".format(pkg_hash))
This might make the code's intent more obvious to readers.
It might also work well with environments since we can add an optional third parameter that passes in the environment and/or uses the default one.
Note on this: There are cases when we capture output from spack command and cases where we simply run the spack command. So if we wrap these into a higher level function, we also need to make sure to wrap the Handling those cases was one reason why I didn't refactor that far when I took my pass at this, but this is a good idea to tackle in the future -- would simplify the code big time. |
In preparation for moving to spack environments mentioned in issue #93 and was originally from PR #75.
spack_exe_path()
show_info()
find_spack_pkg_path_from_hash()
find_spack_pkg_path()
find_spack_pkg_path_from_hash()