-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change register-kernel to manual registration
* Why: Automatic registration has an incorrect assumption that jupyter must be installed globally * Remove batch script for adding jupyter kernels * Remove after_install hook because it is redundant now
- Loading branch information
1 parent
4066bff
commit c272470
Showing
5 changed files
with
45 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,23 @@ | ||
#!/usr/bin/env bash | ||
env_name=$1 | ||
|
||
if declare -Ff after_uninstall >/dev/null; then | ||
after_uninstall 'rm -rf $(jupyter --data-dir)/kernels/${VERSION_NAME}' | ||
check_python_package_installed() { | ||
local package=$1 | ||
PYENV_VERSION=$env_name pyenv exec pip list --disable-pip-version-check | grep -F "$package" > /dev/null | ||
if [ $? -eq 0 ]; then | ||
return 0 | ||
else | ||
return 1 | ||
fi | ||
} | ||
|
||
if declare -Ff before_uninstall >/dev/null; then | ||
if check_python_package_installed "jupyter"; then | ||
jupyter_data_dir=$(PYENV_VERSION=$env_name pyenv exec jupyter --data-dir) | ||
before_uninstall 'rm -rf ${jupyter_data_dir}/kernels/pyenv_${env_name}' | ||
else | ||
echo "Jupyter is not installed in the pyenv environment '${env_name}'." | ||
fi | ||
else | ||
echo "pyenv: pyenv-jupyter-kernel plugin requires pyenv v0.1.0 or later" >&2 | ||
fi |
This file was deleted.
Oops, something went wrong.