rez
rez copied to clipboard
Add shell argument to get_environment and apply
Motivation
On windows, get_environ and apply methods on the ResolvedContext class take a very long time when resolving a powershell environment before the cached method.
Explanation
This is because append_system_paths method on the Python interpreter creates a new shell from the config defaults. This method trickles up to the _execute method in the ResolvedContext class. Which is then called by apply and get_environ.
Additional Motivation
There are other methods on the ResolvedContext class that allows for using shells within the resolved context and would be nice to be able to carry this functionality over.
Proposed Solutions
- Add a default shell on the
Pythoninterpreter class that can be used for Python shell environments when instantiating the executor. - Add a argument
shellin theappend_system_pathsand the_executefunctions to be passed down as default or override.
Current Workaround
config = create_config()
config.override("default_shell", "cmd")
context.get_environ()