mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 16:51:40 -05:00
Merge pull request #765 from nix-community/lock-file-version-2_0
Add forwards compatibility with Poetry lock version 2.0
This commit is contained in:
commit
643a57637b
1 changed files with 5 additions and 1 deletions
|
@ -159,11 +159,14 @@ lib.makeScope pkgs.newScope (self: {
|
|||
};
|
||||
|
||||
poetryLock = readTOML poetrylock;
|
||||
|
||||
# Lock file version 1.1 files
|
||||
lockFiles =
|
||||
let
|
||||
lockfiles = lib.getAttrFromPath [ "metadata" "files" ] poetryLock;
|
||||
in
|
||||
lib.listToAttrs (lib.mapAttrsToList (n: v: { name = normalizePackageName n; value = v; }) lockfiles);
|
||||
|
||||
evalPep508 = mkEvalPep508 python;
|
||||
|
||||
# Filter packages by their PEP508 markers & pyproject interpreter version
|
||||
|
@ -192,7 +195,8 @@ lib.makeScope pkgs.newScope (self: {
|
|||
pkgMeta // {
|
||||
inherit pwd preferWheels;
|
||||
source = pkgMeta.source or null;
|
||||
files = lockFiles.${normalizedName};
|
||||
# Default to files from lock file version 2.0 and fall back to 1.1
|
||||
files = pkgMeta.files or lockFiles.${normalizedName};
|
||||
pythonPackages = self;
|
||||
|
||||
sourceSpec = (
|
||||
|
|
Loading…
Add table
Reference in a new issue