Prevent editable package from being built when in nix-shell environment

They are not useful and will will fail to build in some cases, like the case where they depend on another package also being added as an editable source.
This commit is contained in:
adisbladis 2022-01-05 08:06:47 +00:00
parent 85bb626d83
commit 3a9ac250e2

View file

@ -272,9 +272,14 @@ lib.makeScope pkgs.newScope (self: {
};
inherit (poetryPython) poetryPackages;
inherit (lib) elem;
# Don't add editable sources to the environment since they will sometimes fail to build and are not useful in the development env
editableAttrs = lib.attrNames editablePackageSources;
envPkgs = builtins.filter (drv: ! lib.elem (drv.pname or drv.name or "") editableAttrs) poetryPackages;
in
poetryPython.python.withPackages (ps: poetryPackages ++ (extraPackages ps));
poetryPython.python.withPackages (ps: envPkgs ++ (extraPackages ps));
/* Creates a Python application from pyproject.toml and poetry.lock