Skip to content

[FR] Ability to dynamically specify "build wheel" dependencies #4806

Open
@mgorny

Description

@mgorny

What's the problem this feature will solve?

Some projects have specific dynamic dependencies for build* commands such as cmake. Currently, such dependencies either have to be specified a. as build-system.requires, or b. via setup_requires. The former method only permits static dependencies, so we can't express "[cmake] only if no system CMake is available", the latter is deprecated — and both of them apply to source distributions, whereas we need it only for wheel builds.

Describe the solution you'd like

I'd like a non-deprecated option to pass wheel building requirements to setup() function, so they'd be returned by the backend's get_requires_for_build_wheel() method.

Alternative Solutions

The alternative is for every such package to use a custom backend based on setuptools', and have the backend override get_requires_for_build_wheel(). However, it seems a bit of an overkill.

Additional context

No response

Code of Conduct

  • I agree to follow the PSF Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TriageIssues that need to be evaluated for severity and status.enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions