Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdm: Makes uv resolver optional #1084

Merged
merged 1 commit into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading