Skip to content

Python: common method for overriding of libraries #24154

@FRidh

Description

@FRidh

Issue description

Most Python library expressions are in python-packages.nix and some are called using callPackage.
We applied makeOverridable to buildPythonPackage so we can override the Python packages. However, callPackage = pkgs.newScope self; also sets a override attribute which is applied later thus taking precedence. We should provide a common method for overriding Python libraries.

Possible methods I can think of:

  • Define callPackage without providing a override attribute. The override attribute should now correspond to the one added to buildPythonPackage by makeOverridable.
  • Add a buildPythonPackage.overridePythonPackage method.

I suppose the first would be easiest and the second the most robust.


It would by the way be nice if makeOverridable would allow you to set the attribute used for overriding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: enhancementAdd something new or improve an existing system.6.topic: pythonPython is a high-level, general-purpose programming language.9.needs: community feedbackThis needs feedback from more community members.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions