Skip to content

Support adding patch_cmds in pip.overrideΒ #3512

@Ryang20718

Description

@Ryang20718

πŸš€ feature request

Description

Currently, the following exists for patching targets. However, for certain targets like pytorch, we have custom commands that patch the rpath of shared object libraries in our current workspace. However, this isn't doable with pip.override as we can't quite generate a patch for rpath differences. We can't patch the wheel beforehand because we're using pip torch relies on an rpath that is variable to change depending on the sha256sum of the wheel so we have to patch after the wheel is built as we can't know the sha256sum of the wheel before it's built

pip.override(
    file = "<your python wheel>.whl",
    patch_strip = 1,
    patches = [
        "<patch target>",
    ],
)

Describe the solution you'd like

ideally if pip.override has a patch_cmds optional argument that would be great

pip.override(
    file = "<your python wheel>.whl",
    patch_strip = 1,
    patches = [
        "<patch target>",
    ],
    patch_cmds = [
     ]
)

Describe alternatives you've considered

We've tried patching before the wheel is built, but like the description above says, it's currently a chicken and egg problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions