Running in Virtualenv
svartkanin opened this issue · 6 comments
When yapf
is installed in a virtualenv only then it's quite cumbersome to change the execution path all the time. Would be great if there's a way of automatically picking yapf
installed in the current virutalenv of the file to be formatted.
If you run sublime from the virtualenv it should work (but that's cumbersome, too). Would you know of a better way of picking up the virtualenv for a given file?
You can also override the path to yapf on a per-project basis.
I've tried putting the custom command as execution (which doesn't require to be in a virtualenv):
{
"yapf_command": "pipenv run yapf"
}
But that gives me the error
OSError: [Error 2] No such file or directory: 'pipenv run yapf'
this is what I am thinking: #44
Seems to do the trick for me (linux, sublime 3), will try on osx, merge and cut a new release tomorrow-ish unless either of you see a problem I am missing.
Great I'll try it out as soon as it's released!
Okay, should be addressed in v0.14.1. Please post again if it does work (or to confirm it does). It will be a few hours before the new code shows up in sublime Package Control.