Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git dependencies with pdm fail with error: attribute 'files' missing #1083

Open
rupurt opened this issue Dec 23, 2024 · 2 comments
Open

Git dependencies with pdm fail with error: attribute 'files' missing #1083

rupurt opened this issue Dec 23, 2024 · 2 comments

Comments

@rupurt
Copy link

rupurt commented Dec 23, 2024

When using the pdm module with git dependencies in pyproject.toml building the derivations fails.

# pyproject.toml
dependencies = [
    # "aioftp >=0.22.0",
    # patched version of aioftp to support custom subcommands
    "aioftp @ git+https://github.com/rupurt/aioftp.git@server-can-add-custom-commands-mapping",
]
error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:34:12:
           33|
           34|   strict = derivationStrict drvAttrs;
             |            ^
           35|

       … while evaluating derivation 'nix-shell'
         whose name attribute is located at /nix/store/7z8msq6a39p88nnfzagpzbykahiz1hrq-source/pkgs/stdenv/generic/make-derivation.nix:336:7while evaluating attribute 'buildInputs' of derivation 'nix-shell'
         at /nix/store/7z8msq6a39p88nnfzagpzbykahiz1hrq-source/pkgs/stdenv/generic/make-derivation.nix:383:7:
          382|       depsHostHost                = elemAt (elemAt dependencies 1) 0;
          383|       buildInputs                 = elemAt (elemAt dependencies 1) 1;
             |       ^
          384|       depsTargetTarget            = elemAt (elemAt dependencies 2) 0;while evaluating the option `groups.default.packages.aioftp."0.24.1".evaluated.public.outPath':

       … while evaluating definitions from `/nix/store/d858pcyym8hif6wbjqqpjdffgavi43qy-source/modules/dream2nix/package-func':

       … while evaluating the option `groups.default.packages.aioftp."0.24.1".evaluated.package-func.result':

       … while evaluating definitions from `/nix/store/d858pcyym8hif6wbjqqpjdffgavi43qy-source/modules/dream2nix/package-func':

       … while evaluating the option `groups.default.packages.aioftp."0.24.1".evaluated.package-func.args':

       … while evaluating definitions from `/nix/store/d858pcyym8hif6wbjqqpjdffgavi43qy-source/modules/dream2nix/mkDerivation':

       … while evaluating the option `groups.default.packages.aioftp."0.24.1".evaluated.mkDerivation.buildInputs':

       … while evaluating definitions from `/nix/store/d858pcyym8hif6wbjqqpjdffgavi43qy-source/modules/dream2nix/WIP-python-pdm, via option overrideType':

       … while evaluating the option `groups.default.packages.aioftp."0.24.1".evaluated.mkDerivation.src':

       … while evaluating definitions from `/nix/store/d858pcyym8hif6wbjqqpjdffgavi43qy-source/modules/dream2nix/WIP-python-pdm, via option groups.default.packages.aioftp."0.24.1".module':

       … while evaluating definitions from `/nix/store/d858pcyym8hif6wbjqqpjdffgavi43qy-source/modules/dream2nix/WIP-python-pdm':

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

       error: attribute 'files' missing
       at /nix/store/d858pcyym8hif6wbjqqpjdffgavi43qy-source/modules/dream2nix/WIP-python-pdm/lib.nix:177:30:
          176|   parsePackage = environ: item: let
          177|     sources = sourcesToAttrs item.files;
             |                              ^
          178|     compatibleSources =
@jess-sol
Copy link

This also occurs with local packages referenced in the pyproject.toml file:

depedencies = [
  "pkg @ file:///${PROJECT_ROOT}/contrib/pkg",
]

It may make sense to default to the path/uri after the @ sign if one is present, instead of looking for the files section in the lockfile.

@rupurt
Copy link
Author

rupurt commented Dec 27, 2024

@jess-sol yeah I ran into that also.

I managed to find a workaround for now by building the python packages manually in the overrides. However if it's a complicated dependency it becomes a lot more tricky...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants