mirror of
https://git.decapod.one/brethil/dotfiles
synced 2025-01-04 21:36:04 +01:00
zsh: functions: add uv support in mkvenv
This commit is contained in:
parent
5dc6cf06f4
commit
da0a64ccbd
|
@ -32,9 +32,16 @@ mkvenv(){
|
|||
|
||||
info "Creating virtualenv ${venv_name}... "
|
||||
|
||||
if ! python -m virtualenv $@ ${venv_name} ; then
|
||||
error "Failed to create virtualenv. Is virtualenv installed? Try:\n $ pip install virtualenv"
|
||||
return 1
|
||||
|
||||
if (( ${+commands[uv]} )); then
|
||||
info "Creating venv using uv"
|
||||
uv venv $@ ${venv_name}
|
||||
else
|
||||
warning "uv is not available, falling back to virtualenv module"
|
||||
if ! python -m virtualenv $@ ${venv_name} ; then
|
||||
warning "virtualenv module is not available, virtualenv creation will be slow. Install uv or virtualenv."
|
||||
python -m venv $@ ${venv_name}
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z ${source_venv} ]]; then
|
||||
|
|
Loading…
Reference in New Issue
Block a user