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

View file

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