Skip to content

Commit 8ce6284

Browse files
authored
Merge pull request nix-community#1084 from purepani/push-ksmymlqlvpns
pdm: Makes uv resolver optional
2 parents 98c1c2e + eb334fa commit 8ce6284

2 files changed

Lines changed: 17 additions & 7 deletions

File tree

modules/dream2nix/WIP-python-pdm/interface.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ in {
2020
pyproject = l.mkOption {
2121
type = t.path;
2222
};
23+
useUvResolver = l.mkOption {
24+
type = t.bool;
25+
default = false;
26+
};
2327

2428
sourceSelector = import ./sourceSelectorOption.nix {inherit lib;};
2529
};

modules/dream2nix/WIP-python-pdm/lock.nix

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
}: let
77
pdmConfig = config.deps.writeText "pdm-config.toml" ''
88
check_update = false
9-
use_uv = true
9+
use_uv = ${
10+
if (config.pdm.useUvResolver)
11+
then "true"
12+
else "false"
13+
}
1014
[python]
1115
use_venv = false
1216
'';
@@ -15,12 +19,14 @@
1519
#!${config.deps.bash}/bin/bash
1620
set -Eeuo pipefail
1721
18-
export PATH="$PATH:${lib.makeBinPath [
19-
config.deps.coreutils
20-
config.deps.pdm
21-
config.deps.yq
22-
config.deps.uv
23-
]}"
22+
export PATH="$PATH:${lib.makeBinPath ([
23+
config.deps.coreutils
24+
config.deps.pdm
25+
config.deps.yq
26+
]
27+
++ lib.optionals config.pdm.useUvResolver [
28+
config.deps.uv
29+
])}"
2430
export TMPDIR=$(${config.deps.coreutils}/bin/mktemp -d)
2531
trap "${config.deps.coreutils}/bin/chmod -R +w '$TMPDIR'; ${config.deps.coreutils}/bin/rm -rf '$TMPDIR'" EXIT
2632

0 commit comments

Comments
 (0)