-
Notifications
You must be signed in to change notification settings - Fork 533
Expand file tree
/
Copy path.envrc
More file actions
29 lines (25 loc) · 966 Bytes
/
.envrc
File metadata and controls
29 lines (25 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# -*- mode: sh -*-
layout_cmk_uv() {
VIRTUAL_ENV="$(pwd)/.venv"
if [[ -z $VIRTUAL_ENV || ! -d $VIRTUAL_ENV ]]; then
make .venv
fi
PATH_add "$VIRTUAL_ENV/bin"
export UV_ACTIVE=1 # or VENV_ACTIVE=1
export VIRTUAL_ENV
}
watch_file bazel-out/bazel_env-opt/bin/bazel/tools/bazel_env/bin
PATH_add bazel-out/bazel_env-opt/bin/bazel/tools/bazel_env/bin
if [[ ! -d bazel-out/bazel_env-opt/bin/bazel/tools/bazel_env/bin ]]; then
bazel run //bazel/tools:bazel_env 3>&-
fi
# Last because PATH_add *prepends* and we want the .venv bins *first*
# for things like pylsp to be happy when an editor applies envrc
layout cmk_uv
# .envrc.local is gitignored. It provides some flexibility to include things like this:
#
# export MYPYPATH="$(find packages non-free/packages -maxdepth 2 -name pyproject.toml -printf '%h:' 2>/dev/null)"
#
# ... for people whose setups depend on such things.
watch_file .envrc.local
source_env_if_exists .envrc.local