mirror of
https://git.decapod.one/brethil/dotfiles
synced 2025-01-06 22:16:03 +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}... "
|
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"
|
if (( ${+commands[uv]} )); then
|
||||||
return 1
|
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
|
fi
|
||||||
|
|
||||||
if [[ -z ${source_venv} ]]; then
|
if [[ -z ${source_venv} ]]; then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user