Skip to content

Commit 824a476

Browse files
committed
fix(dev): set an explicit path for uv project env
If unset and a `.venv` directory exists, the interpreter appears broken. This isolates the in-nixOS uv-based virtualenv from the external one. Signed-off-by: Mike Fiedler <miketheman@gmail.com>
1 parent 600e4a4 commit 824a476

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ celerybeat-schedule
8686
# Environments
8787
.env
8888
.venv
89+
.venv-nix
8990
env/
9091
venv/
9192
ENV/

shell.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,10 @@ pkgs.mkShell {
3838
# Use the Nix-provided interpreters instead of uv-managed downloads, which do
3939
# not run on NixOS without extra patching.
4040
UV_PYTHON_DOWNLOADS = "never";
41+
42+
# Keep this shell's venv separate from a host-created .venv. This matters when
43+
# the project directory is bind-mounted into a NixOS VM (e.g. OrbStack): the
44+
# host's .venv is still visible there, but built for a different OS/interpreter,
45+
# so reusing it breaks `uv sync`/`uv run`.
46+
UV_PROJECT_ENVIRONMENT = ".venv-nix";
4147
}

0 commit comments

Comments
 (0)