Skip to content

Why does get_requires_for_build_wheel return the runtime requirements? #354

@mwchase

Description

@mwchase

I'm attempting a somewhat elaborate repository layout, in which some dependencies are only available locally via constraints files, and it's failing because pip is attempting to install the runtime dependencies in an isolated environment, without reference to the constraint files.

It looks like this is down to the implementation of get_requires_for_build_wheel, which in the other PEP 517 build systems I've looked at (Poetry and Enscons) just returns an empty list. In flit, it returns the contents of tools.flit.metadata.requires, which I understand to be the runtime requirements, and I don't think I need them to build the packages. Without the ability to install something, pip fails after logging "Installing backend dependencies". (The "something" doesn't have to be remotely what's intended. My initial testing was confounded because I was specifying a local package that shared a name with an unrelated package in pypi. So, the pypi package got installed in the isolated environment, and the local package got installed in the virtualenv where pip was.)

I worked around this by disabling build isolation and explicitly installing flit in the target environment, but I'd like to better understand the intents and tradeoffs here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions