Skip to content

<pkg>.overridePythonAttrs doesn't work together with <pkg>.overrideAttrs #267293

@ShamrockLee

Description

@ShamrockLee

Describe the bug

Python packages supports <pkg>.overrideAttrs as stated in the comment block of makeOverridablePythonPackage inside pkgs/development/interpreters/python/python-packages-base.nix. However, makeOverridablePythonPackage doesn't update the overrideAttrs attribute. Applying <pkg>.overridePythonAttrs after <pkg>.overrideAttrs causes the effect of <pkg>.overrideAttrs to get lost.

Steps To Reproduce

Steps to reproduce the behavior:

((pkgs.python3Packages.six.overrideAttrs { ans = 42; }).overridePythonAttrs { }).ans
# => error: attribute 'ans' missingans

Expected behavior

<pkg>.overrideAttrs can be used together with <pkg>.overridePythonAttrs in arbitrary orders.

((pkgs.python3Packages.six.overrideAttrs { ans = 42; }).overridePythonAttrs { }).ans
# => 42

Additional context

Add any other context about the problem here.

Notify maintainers

@FRidh

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.55, NixOS, 23.05 (Stoat), 23.05.20231007.5a237ae`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.15.2`
 - nixpkgs: `/nix/store/3fdrwsy2yi8rwxqylpd6vi2asraxq1nv-source`

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions