We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2fed762 commit 160c24aCopy full SHA for 160c24a
.envrc
@@ -1,2 +1,18 @@
1
-export VIRTUAL_ENV=.venv
2
-layout python3
+# https://github.com/direnv/direnv/wiki/Python#uv
+layout_uv() {
3
+ if [[ -d ".venv" ]]; then
4
+ VIRTUAL_ENV="$(pwd)/.venv"
5
+ fi
6
+
7
+ if [[ -z $VIRTUAL_ENV || ! -d $VIRTUAL_ENV ]]; then
8
+ log_status "No virtual environment exists. Executing \`uv venv\` to create one."
9
+ uv venv
10
11
12
13
+ PATH_add "$VIRTUAL_ENV/bin"
14
+ export UV_ACTIVE=1 # or VENV_ACTIVE=1
15
+ export VIRTUAL_ENV
16
+}
17
18
+layout_uv
0 commit comments