pyvenv
pyvenv copied to clipboard
call add2virtualenv as hook after pyvenv-workon
is there a way to do a similar thing like pyvenv-run-virtualenvwrapper-hook does but with a custom file?
what i'd like to achieve is that all elpy dependencies like e.g. jedi are installed into a virtualenv and this one gets added to whatever virtualenv i'm currently working on (with e.g. add2virtualenv), but only in emacs.
this way i could avoid adding a global post_activate hook to virtualenvwrapper.
cheers, grafoo
You can use pyvenv-post-activate-hooks to run a custom function after activation, and run whatever code you like there. I'm not sure if that solves your problem?
yes, pyvenv-post-activate-hooks is the right place to store the function but i had a look at the add2virtualenv implementation and it actually doesn't provide the functionality i'd like to achieve.
after calling pyvenv-workon i'd like to modify sys.path of the python interpreter elpy is communicating with and insert the site-packages directory of the dedicated - different virtualenv pyvenv-workon was called with - where only elpy dependencies are installed.
i guess this isn't related to pyvenv after all, but can you give me a pointer on what function i need to call from elpy to modify the interpreters path?
Does python-shell-send-string-no-output do what you want?