rules_py icon indicating copy to clipboard operation
rules_py copied to clipboard

[FR]: Setting transitive dependencies as `virtual`

Open bd-jahn opened this issue 1 year ago • 1 comments

What is the current behavior?

Let's say I have a library foo that depends on bar and baz, and I want to replace bar and baz with my custom packages.
The current behavior doesn’t completely replace bar and baz with my custom packages; instead, it appends them to the transitively introduced bar and baz.

py_library(
    name = "libfoo",
    srcs = [...],
    deps = [requirement("foo")],
    virtual_deps = [
        "bar",
        "baz",
    ],
)

py_binary(
    name = "main",
    srcs = ["main.py"],
    resolutions = foo_resolutions.override({
        "bar": "<path_to_bar_wheel>",
        "baz": "<path_to_baz_wheel>",
    }),
    deps = [":libfoo"],
)

Describe the feature

In the above example, I want to create a venv with foo, but using my custom bar and baz.

bd-jahn avatar Nov 16 '24 01:11 bd-jahn

@mattem you know this feature the best, do you have an idea of whether this is feasible?

alexeagle avatar Nov 20 '24 14:11 alexeagle