Skip to content

python: fix checkInputs leakage into runtime dependencies #118452

@DavHau

Description

@DavHau

Currently, when doCheck is disabled globally for all python packages, many python packages fail to build.
The root cause seems to be that mk-python-derivation doesn't enforce runtime dependencies to be specified via propagatedBuildInputs. Instead, runtime deps are often specified inside checkInputs. If doCheck is disabled, then these deps will be missing.

My personal motivation for fixing that is to improve the usability of mach-nix, which currently fails in some cases due to missing dependencies.

My idea would be to modify the pip-install-hook, so that it doesn't see the checkInputs inside the PYTHONPATH during installation.
This in turn would force maintainers to properly specify all deps via propagatedBuildInputs.

The problem is that I cannot find the place, where checkInputs is added to the PYTHONPATH.

If you guys could give me a hint, or have any better ideas on how to solve that problem, I'd highly appreciate it.

@FRidh @jonringer

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: pythonPython is a high-level, general-purpose programming language.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions