Merge pull request #918 from hercules-ci/set-package-pos-to-lock-file

feat: Show lock location in package errors
This commit is contained in:
adisbladis 2023-01-07 04:12:16 +13:00 committed by GitHub
commit 388e3ffed8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -137,6 +137,7 @@ lib.makeScope pkgs.newScope (self: {
{ projectDir ? null { projectDir ? null
, pyproject ? projectDir + "/pyproject.toml" , pyproject ? projectDir + "/pyproject.toml"
, poetrylock ? projectDir + "/poetry.lock" , poetrylock ? projectDir + "/poetry.lock"
, poetrylockPos ? { file = toString poetrylock; line = 0; column = 0; }
, overrides ? self.defaultPoetryOverrides , overrides ? self.defaultPoetryOverrides
, python ? pkgs.python3 , python ? pkgs.python3
, pwd ? projectDir , pwd ? projectDir
@ -207,6 +208,7 @@ lib.makeScope pkgs.newScope (self: {
value = self.mkPoetryDep ( value = self.mkPoetryDep (
pkgMeta // { pkgMeta // {
inherit pwd preferWheels; inherit pwd preferWheels;
pos = poetrylockPos;
source = pkgMeta.source or null; source = pkgMeta.source or null;
# Default to files from lock file version 2.0 and fall back to 1.1 # Default to files from lock file version 2.0 and fall back to 1.1
files = pkgMeta.files or lockFiles.${normalizedName}; files = pkgMeta.files or lockFiles.${normalizedName};

View file

@ -7,6 +7,7 @@
}: }:
{ name { name
, version , version
, pos ? __curPos
, files , files
, source , source
, dependencies ? { } , dependencies ? { }
@ -147,6 +148,8 @@ pythonPackages.callPackage
in in
builtins.map (n: pythonPackages.${normalizePackageName n}) depAttrs; builtins.map (n: pythonPackages.${normalizePackageName n}) depAttrs;
inherit pos;
meta = { meta = {
broken = ! isCompatible (poetryLib.getPythonVersion python) python-versions; broken = ! isCompatible (poetryLib.getPythonVersion python) python-versions;
license = [ ]; license = [ ];