Skip to content

buildPython*: Document arguments unable to reference directly from finalAttrs #477007

@Sigmanificient

Description

@Sigmanificient

While migrating my python packages to the new finalAttrs pattern, i encountering the following issue:

buildPythonPackage (finalAttrs: {
  pname = "aerosandbox";
  version = "4.2.8";
  format = "wheel";

  src = fetchPypi {
    pname = "AeroSandbox";
    inherit (finalAttrs) version format;

    python = "py3";
    dist = "py3";
    hash = "sha256-+rrZzaBWyc9a20bUlsB0iDqYkn+ldlKT0lFfCy2yeXk=";
  };

 # ...
})

fails to biuld:

       error: attribute 'format' missing
       at /home/sigmanificient/repos/nixpkgs/pkgs/development/python-modules/aerosandbox/default.nix:24:34:
           23|     pname = "AeroSandbox";
           24|     inherit (finalAttrs) version format;
             |                                  ^
           25|

This seems to be related to the attributes listed in excludeDrvArgNames, because i have a similar issue with shiny and optional-dependencies.

Edit:

This affects attributes such as format or optional-dpenendencies
I seems that it might be something different than excludeDrvArgNames

Are attributes listed as string in excludeDrvArgNames not accessible using finalAttrs.${attr-name}?

For theses attributes should i use:

  • (finalAttrs: rec { ... })
  • finalAttrs.finalPackages.${attr}
  • wait for a fix?

@ShamrockLee

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken0.kind: questionRequests for a specific question to be answered6.topic: pythonPython is a high-level, general-purpose programming language.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions