Skip to content

fix(dev): set an explicit path for uv project env#318

Closed
miketheman wants to merge 1 commit into
Pylons:mainfrom
miketheman:dev-nixos-split-venvs
Closed

fix(dev): set an explicit path for uv project env#318
miketheman wants to merge 1 commit into
Pylons:mainfrom
miketheman:dev-nixos-split-venvs

Conversation

@miketheman

Copy link
Copy Markdown
Collaborator

If unset and a .venv directory exists, the interpreter appears broken. This isolates the in-nixOS uv-based virtualenv from the external one.

@miketheman miketheman marked this pull request as ready for review July 3, 2026 18:59
@miketheman miketheman requested a review from zupo July 3, 2026 18:59
@miketheman

Copy link
Copy Markdown
Collaborator Author

Test failures appear to be ty-related

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>
@miketheman miketheman force-pushed the dev-nixos-split-venvs branch from 824a476 to 190d735 Compare July 3, 2026 20:39
Comment thread shell.nix
# the project directory is bind-mounted into a NixOS VM (e.g. OrbStack): the
# host's .venv is still visible there, but built for a different OS/interpreter,
# so reusing it breaks `uv sync`/`uv run`.
UV_PROJECT_ENVIRONMENT = ".venv-nix";

@zupo zupo Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, this breaks my personal workflow. I always use .venv and have scripts/muscle memory that rely on it.

Is there another way to address the problem this is trying to solve?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably! This was my "simple hack" that worked for me.
I mostly don't work in nix-shell, so I figure when I drop in there from my host-based workflow, I can probably remove the .venv and have it recreated instead.

I'll go ahead and close this for now, and keep thinking aobut good ways to make these coexist.

@miketheman miketheman closed this Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants