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 323390d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 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;
};
uv_resolver = l.mkOption {
type = t.bool;
default = false;
};

sourceSelector = import ./sourceSelectorOption.nix {inherit lib;};
};
Expand Down
7 changes: 4 additions & 3 deletions modules/dream2nix/WIP-python-pdm/lock.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}: let
pdmConfig = config.deps.writeText "pdm-config.toml" ''
check_update = false
use_uv = true
use_uv = ${if (config.pdm.uv_resolver) then "true" else "false"}
[python]
use_venv = false
'';
Expand All @@ -15,12 +15,13 @@
#!${config.deps.bash}/bin/bash
set -Eeuo pipefail
export PATH="$PATH:${lib.makeBinPath [
export PATH="$PATH:${lib.makeBinPath ([
config.deps.coreutils
config.deps.pdm
config.deps.yq
] ++ lib.optionals config.pdm.uv_resolver [
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 323390d

Please sign in to comment.