diff --git a/.config/direnv/direnvrc b/.config/direnv/direnvrc index 707a840..febd17c 100644 --- a/.config/direnv/direnvrc +++ b/.config/direnv/direnvrc @@ -5,7 +5,13 @@ layout_uv() { if [[ -z $VIRTUAL_ENV || ! -d $VIRTUAL_ENV ]]; then log_status "No virtual environment exists. Executing \`uv venv\` to create one." - uv venv + if [[ -z $PYTHON_VERSION ]]; then + # No Python version specified, just create a virtualenv + uv venv + else + # Specific Python version requested, use that; will download if needed + uv venv --python $PYTHON_VERSION + fi VIRTUAL_ENV="$(pwd)/.venv" fi