Skip to content

Commit

Permalink
Add uv direnv configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-checkmk committed Dec 24, 2024
1 parent 6eb5941 commit b889dc2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- mode: sh -*-

layout_python() {
if [[ -d ".venv" ]]; then
VIRTUAL_ENV="$(pwd)/.venv"
fi

if [[ -z $VIRTUAL_ENV || ! -d $VIRTUAL_ENV ]]; then
log_status "No virtual environment exists. Creating it."
uv venv
uv pip install -r requirements.txt
VIRTUAL_ENV="$(pwd)/.venv"
fi

# Activate the virtual environment
. $VIRTUAL_ENV/bin/activate
}

layout python

0 comments on commit b889dc2

Please sign in to comment.