nix-community / dream2nix

Simplified nix packaging for various programming language ecosystems [maintainer=@DavHau]
https://dream2nix.dev
MIT License
972 stars 122 forks source link

pdm: not supporting editable dependencies #996

Open yajo opened 2 months ago

yajo commented 2 months ago

When your project has editable dev dependencies, you can't build it with d2n:

pdm init # respond
pdm add --dev -e ./sub-dep
nix build .#my-package.config.groups.dev.sub-dep.1 # asuming you already set up correctly pdm backend on d2n flake

error:
       … while evaluating the attribute 'value'

         at /nix/store/m5i890m2g4pnyflpn48d1dpzzmwp5q4p-source/lib/modules.nix:809:9:

          808|     in warnDeprecation opt //
          809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          810|         inherit (res.defsFinal') highestPrio;

       … while calling the 'addErrorContext' builtin

         at /nix/store/m5i890m2g4pnyflpn48d1dpzzmwp5q4p-source/lib/modules.nix:809:17:

          808|     in warnDeprecation opt //
          809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |                 ^
          810|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: attribute 'files' missing

       at /nix/store/bqxm2fdm454rbx21zryqc2idnivaq5hp-source/modules/dream2nix/WIP-python-pdm/lib.nix:177:30:

          176|   parsePackage = environ: item: let
          177|     sources = sourcesToAttrs item.files;
             |                              ^
          178|     compatibleSources =
«derivation 

@moduon MT-1075

purepani commented 2 months ago

Have you tried manually refreshing the lock file(with pdm lock --refresh and not nix run .#default.lock) after adding the dev dependency? It might be an instance of this: https://github.com/nix-community/dream2nix/issues/999