Skip to content

Commit

Permalink
pdm: Makes uv resolver optional
Browse files Browse the repository at this point in the history
  • Loading branch information
purepani committed Dec 25, 2024
1 parent 98c1c2e commit eb334fa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
4 changes: 4 additions & 0 deletions modules/dream2nix/WIP-python-pdm/interface.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ in {
pyproject = l.mkOption {
type = t.path;
};
useUvResolver = l.mkOption {
type = t.bool;
default = false;
};

sourceSelector = import ./sourceSelectorOption.nix {inherit lib;};
};
Expand Down
20 changes: 13 additions & 7 deletions modules/dream2nix/WIP-python-pdm/lock.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
}: let
pdmConfig = config.deps.writeText "pdm-config.toml" ''
check_update = false
use_uv = true
use_uv = ${
if (config.pdm.useUvResolver)
then "true"
else "false"
}
[python]
use_venv = false
'';
Expand All @@ -15,12 +19,14 @@
#!${config.deps.bash}/bin/bash
set -Eeuo pipefail
export PATH="$PATH:${lib.makeBinPath [
config.deps.coreutils
config.deps.pdm
config.deps.yq
config.deps.uv
]}"
export PATH="$PATH:${lib.makeBinPath ([
config.deps.coreutils
config.deps.pdm
config.deps.yq
]
++ lib.optionals config.pdm.useUvResolver [
config.deps.uv
])}"
export TMPDIR=$(${config.deps.coreutils}/bin/mktemp -d)
trap "${config.deps.coreutils}/bin/chmod -R +w '$TMPDIR'; ${config.deps.coreutils}/bin/rm -rf '$TMPDIR'" EXIT
Expand Down

0 comments on commit eb334fa

Please sign in to comment.