Skip to content

Commit

Permalink
lock1: Guard against non-existing version field
Browse files Browse the repository at this point in the history
Uv (annoyingly) just changed this behaviour: astral-sh/uv#10622
  • Loading branch information
adisbladis committed Jan 16, 2025
1 parent 0ef637b commit 4da0581
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/build.nix
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ in
stdenv.mkDerivation (
attrs
// {
# Take potentially dynamic fields from uv.lock package
inherit (package) version;
version = "0.0.0";

buildInputs =
(attrs.buildInputs or [ ])
Expand All @@ -184,6 +183,10 @@ in
dependency-groups = mapAttrs (_: mkSpec) package.dev-dependencies;
};
}
// optionalAttrs (package ? version) {
# Take potentially dynamic fields from uv.lock package
inherit (package) version;
}
);

/*
Expand Down Expand Up @@ -357,7 +360,8 @@ in
stdenv.mkDerivation (
{
pname = package.name;
inherit (package) version;
version = "0.0.0";

inherit src;

passthru = {
Expand All @@ -373,6 +377,10 @@ in
++ optional (format == "wheel") pyprojectWheelHook
++ optional (format == "wheel" && stdenv.isLinux) autoPatchelfHook;
}
// optionalAttrs (package ? version) {
# Take potentially dynamic fields from uv.lock package
inherit (package) version;
}
// optionalAttrs (format == "wheel") {
# Don't strip prebuilt wheels
dontStrip = true;
Expand Down

0 comments on commit 4da0581

Please sign in to comment.