title: Activate a virtualenv via fabric as deploy user
body: <p>I want to run my fabric script locally, which will in turn, log into my server, switch user to deploy, activate the projects .virtualenv, which will change dir to the project and issue a git pull.</p>
  
  <pre><code>def git_pull():
      sudo('su deploy')
      # here i need to switch to the virtualenv
      run('git pull')
  </code></pre>
  
  <p>I typically use the workon command from virtualenvwrapper which sources the activate file and the postactivate file will put me in the project folder. In this case, it seems that because fabric runs from within shell, control is give over to fabric, so I can't use bash's source built-in to '$source ~/.virtualenv/myvenv/bin/activate'</p>
  
  <p>Anybody have an example and explanation of how they have done this?</p>