Skip to content

pyenv-virtualenv breaks after_uninstall hooks #320

@aiguofer

Description

@aiguofer

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions