Skip to content

Commit 5e66cfb

Browse files
committed
envrc: .venv/bin ahead of bazel_env/bin in PATH
Otherwise the bazel wrappers take over. This is most apparent when using editor integration for .envrc together with pylsp; the LSP will pass arguments to the wrapper scripts that they don't expect and will end up failing to run e.g. mypy. Change-Id: I4e93e2ab4cc1b605affbf98689811ce2d97ea64c
1 parent b651a5a commit 5e66cfb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.envrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ layout_cmk_uv() {
1010
export VIRTUAL_ENV
1111
}
1212

13-
layout cmk_uv
14-
1513
watch_file bazel-out/bazel_env-opt/bin/bazel/tools/bazel_env/bin
1614
PATH_add bazel-out/bazel_env-opt/bin/bazel/tools/bazel_env/bin
1715
if [[ ! -d bazel-out/bazel_env-opt/bin/bazel/tools/bazel_env/bin ]]; then
1816
bazel run //bazel/tools:bazel_env 3>&-
1917
fi
18+
19+
# Last because PATH_add *prepends* and we want the .venv bins *first*
20+
# for things like pylsp to be happy when an editor applies envrc
21+
layout cmk_uv

0 commit comments

Comments
 (0)