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

pyenv-virtualenv breaks after_uninstall hooks #320

Closed
aiguofer opened this issue Jul 21, 2019 · 0 comments · Fixed by #321
Closed

pyenv-virtualenv breaks after_uninstall hooks #320

aiguofer opened this issue Jul 21, 2019 · 0 comments · Fixed by #321

Comments

@aiguofer
Copy link
Contributor

Hi, I'm currently trying to create an extension to create a jupyter kernel from newly installed versions and virtualenvs. I've got the hooks working on install, and I'd like to remove the kernel on uninstall. I tried the following in my uninstall hook:

#!/usr/bin/env bash

if declare -Ff after_uninstall >/dev/null; then
    after_uninstall 'rm -rf $(jupyter --data-dir)/kernels/${VERSION_NAME}'
else
    echo "pyenv: pyenv-jupyter-kernel plugin requires pyenv v0.1.0 or later" >&2
fi

which works great when I uninstall a regular python version, but not when I uninstall a virtualenv. When I run PYENV_DEBUG=true pyenv uninstall test it looks like pyenv-virtualenv/etc/pyenv.d/uninstall/envs.bash takes over while loading the hooks and never returns back to pyenv-uninstall to run its before and after hooks.

Should I be doing something different, or is there a way that pyenv-virtualenv could return back control to pyenv-uninstall?

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

Successfully merging a pull request may close this issue.

1 participant