Replies: 4 comments 1 reply
-
After a quick inspection of the https://github.com/pyenv/pyenv-virtualenv repo it seems that there is no Makefile in that repo. |
Beta Was this translation helpful? Give feedback.
-
Thanks for looking into it! Exactly, this repo is a simple plugin for pyenv. There is no configure nor make to be run. I used the ICE I searched for an ICE noconfigure, but I did not find one. I have many other custom zinit lines (perhaps about 20-30) in my zshrc and these plugins for pyenv are the only ones showing this warning. Many of my other zinit lines do not require configure/make either. |
Beta Was this translation helpful? Give feedback.
-
I deleted the answer as it was not complete. I post the complete answer below. |
Beta Was this translation helpful? Give feedback.
-
Amazing fast support. Thanks a lot. It was dummy of me of not noticing After putting For the benefit of others, this is the final working configuration, which I am sourcing: # https://github.com/pyenv/pyenv
# Pyenv manager
zinit wait depth=1 light-mode lucid as'null' nocompletions nocompile for \
id-as:'pyenv/doctor' pyenv/pyenv-doctor \
id-as:'pyenv/update' pyenv/pyenv-update \
id-as:'pyenv/pip-migrate' pyenv/pyenv-pip-migrate \
id-as:'pyenv/virtualenv' pyenv/pyenv-virtualenv \
id-as:'pyenv/ccache' pyenv/pyenv-ccache
zinit wait depth=1 light-mode lucid as'null' nocompletions nocompile for \
id-as:'pyenv/virtualenv' configure'' pyenv/pyenv-virtualenv
# Pyenv manager
zinit ice wait depth=1 light-mode lucid as'command' \
pick'$ZPFX/bin/pyenv' \
atinit'export PYENV_ROOT="$HOME/.pyenv"' \
atclone"source '${${(%):-%x}:h}/__pyenv_atclone_hook.zsh'" \
atpull"%atclone" \
completions \
cp'man/man1/pyenv.1 -> $ZPFX/man/man1' \
sbin'bin/pyenv -> pyenv' \
src"zi_pyenv_init.zsh" \
compile:'zi_pyenv_init.zsh' nocompile'!'
zinit light @pyenv/pyenv In addition, I also have in the same folder these two files: # Andrea Alberti, 2024
function __pyenv_atclone_hook() {
# We do not need `pyenv virtualenv-init -` even though it is recommended
# in the official instructions. It is only needed if we want to modify the prompt
# to recognize the virtual environment. Typically, recognition of the venv is
# already done by shell prompt like oh-my-zsh prompts or powerlevel10k.
local PYENV_ROOT="$HOME/.pyenv" &&
rm -rf $PYENV_ROOT/plugins &&
mkdir -p $PYENV_ROOT/plugins &&
ln -s $ZINIT[PLUGINS_DIR]/pyenv---doctor $PYENV_ROOT/plugins/pyenv-doctor &&
ln -s $ZINIT[PLUGINS_DIR]/pyenv---update $PYENV_ROOT/plugins/pyenv-update &&
ln -s $ZINIT[PLUGINS_DIR]/pyenv---pip-migrate $PYENV_ROOT/plugins/pyenv-pip-migrate &&
ln -s $ZINIT[PLUGINS_DIR]/pyenv---virtualenv $PYENV_ROOT/plugins/pyenv-virtualenv &&
ln -s $ZINIT[PLUGINS_DIR]/pyenv---ccache $PYENV_ROOT/plugins/pyenv-ccache &&
env PYENV_ROOT=$PYENV_ROOT ./libexec/pyenv init - > zi_pyenv_init.zsh &&
cp -vf $DOTFILES_DIR/zinit/src/pyenv/_pyenv .
}
_safe_one_off_load __pyenv_atclone_hook # _pyenv completion script
_pyenv () {
local words completions
read -cA words
if [ "${#words}" -eq 2 ]; then
completions="$(pyenv commands)"
else
completions="$(pyenv completions ${words[2,-2]})"
fi
reply=(${(ps:\n:)completions})
}
# Define the completion for pyenv
compdef _pyenv pyenv
function _safe_one_off_load() {
emulate -LR zsh
local func=$1
shift # Remove the function name from the arguments
local retval
# Save the original state of ERR_EXIT
local original_err_exit=${options[ERR_EXIT]}
set -e # Enable ERR_EXIT for this function
"$func" "$@" # Call the function with remaining arguments
retval=$?
# Restore the original state of ERR_EXIT
if [[ $original_err_exit == off ]]; then
set +e
fi
unfunction "$func"
if [[ $retval -ne 0 ]]; then
+zi-log "{error}Function '$func' exited with error code: $retval{rst}"
fi
return $retval
} |
Beta Was this translation helpful? Give feedback.
-
I tried the following installation:
I also tried omitting
configure''
. In any case, at some point in the code,${+ICE[configure]}
becomes 1. This is not desirable because then the code∞zinit-configure-base-hook ()
is fully executed instead of exiting immediately withThe final result is the error message:
How can I force zinit to yield 0 after
+ICE[configure]
? Early enough in the code, this is the case, but something changes its flag to 1.Beta Was this translation helpful? Give feedback.
All reactions