Skip to content

Commit

Permalink
pep621: don't fail on missing extra attribute paths
Browse files Browse the repository at this point in the history
These paths should be considered, but not a hard fail when they don't exist.
Otherwise calling project loaders dynamically would become unergonomic.
  • Loading branch information
adisbladis committed Nov 9, 2023
1 parent 3c2590f commit d59144a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/pep621.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let
inherit (lib) isString filterAttrs fix;

splitAttrPath = path: filter isString (split "\\." path);
getAttrPath = path: lib.getAttrFromPath (splitAttrPath path);
getAttrPath = path: lib.attrByPath (splitAttrPath path) { };

in
fix (self: {
Expand Down
21 changes: 19 additions & 2 deletions lib/test_project.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, fixtures
, renderers
, mocks
, lib
, ...
}:
let
Expand All @@ -11,8 +12,24 @@ let
getPkgs = set: pnames: map (pname: set.pkgs.${pname}) pnames;

in
{
lib.fix (self: {

loadPyproject = {
testPandasMissingExtrasAttrPaths = {
expr =
let
project = loadPyproject {
pyproject = fixtures."pandas.toml";
extrasAttrPaths = [ "noway" ];
};
in
renderers.buildPythonPackage {
inherit project;
python = mocks.cpythonLinux38;
};
inherit (self.loadPyproject.testPandas) expected;
};

testPandas = {
expr =
let
Expand Down Expand Up @@ -218,4 +235,4 @@ in
};
};
};
}
})

0 comments on commit d59144a

Please sign in to comment.