Skip to content
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

virtualenvwrapper plugin disregards hooks #3744

Closed
kitmonisit opened this issue Apr 3, 2015 · 2 comments
Closed

virtualenvwrapper plugin disregards hooks #3744

kitmonisit opened this issue Apr 3, 2015 · 2 comments

Comments

@kitmonisit
Copy link

kitmonisit commented Apr 3, 2015

Summary

I edited the global postactivate hook for my virtual environments, found by default in $WORKON_HOME. However, if I use the virtualenvwrapper plugin, as written in my .zshrc:

plugins=(git virtualenvwrapper)

the hooks do not execute.

To illustrate

I have a virtualenv named engg, and my postactivate hook has the following line:

echo 'Hello from postactivate'

Case 1. No virtualenvwrapper plugin

$ workon engg
Hello from postactivate
(engg) $

All well and good.

Case 2. Using the virtualenvwrapper plugin

$ workon engg
(engg) $

Me sad :(

A snippet from my .zshrc

It might help with debugging if you know the order of relevant commands in my .zshrc

plugins=(git virtualenvwrapper)

# zsh customizations
autoload -U colors && colors
source $ZSH/oh-my-zsh.sh
zstyle ':completion:*' accept-exact-dirs true

# Python
export WORKON_HOME=$HOME/UNIX/virtualenvs
export PROJECT_HOME=$HOME/UNIX/dev
source /usr/local/bin/virtualenvwrapper.sh
#workon engg
@hanpeter
Copy link
Contributor

@kitmonisit Did you find a solution or a work around for this? I am running into the exact same issue.

Also, I spent some time debugging this. If I manually source /usr/local/bin/virtualenvwrapper.sh in my .zshrc file, the hooks work correctly. If I manually source ~/oh-my-zsh/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh, the hooks work correctly. Is it possible that the hooks are being removed if the plugin is executed?

@mcornella
Copy link
Member

Is this still happening? If so, reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants