Skip to content

Commit

Permalink
uv: fix test and don't override VIRTUAL_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Oct 7, 2024
1 parent 30b43aa commit d51860c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/modules/languages/python.nix
Original file line number Diff line number Diff line change
Expand Up @@ -464,13 +464,15 @@ in
"devenv:python:poetry" = lib.mkIf cfg.poetry.install.enable {
description = "Initialize Poetry";
exec = initPoetryScript;
exports = [ "PATH" "VIRTUAL_ENV" ];
exports = [ "PATH" ] ++ lib.optional cfg.poetry.activate.enable "VIRTUAL_ENV";
after = lib.optional cfg.venv.enable "devenv:python:virtualenv";
};

"devenv:python:uv" = lib.mkIf cfg.uv.sync.enable {
description = "Initialize uv sync";
exec = initUvScript;
exports = [ "PATH" "VIRTUAL_ENV" ];
exports = [ "PATH" ];
after = lib.optional cfg.venv.enable "devenv:python:virtualenv";
};

"devenv:enterShell".after = lib.optional cfg.venv.enable "devenv:python:virtualenv"
Expand Down
1 change: 1 addition & 0 deletions tests/python-uv-sync/devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ in
languages.python = {
enable = true;
directory = "./directory";
venv.enable = true;
uv = {
enable = true;
package = pkgs-unstable.uv;
Expand Down

0 comments on commit d51860c

Please sign in to comment.