theoremlp / rules_uv

Bazel rules for running uv
Apache License 2.0
32 stars 16 forks source link

Add `pip_compile` arg for `--override` file #128

Open mattlgy opened 1 month ago

mattlgy commented 1 month ago

To provide an overrides file I have to do something like this:

pip_compile(
    name = "generate_requirements_txt",
    requirements_in = "//:requirements.in",
    requirements_txt = "//:requirements.txt",
    data = ["//:overrides.txt"],
    args = [
        // preserving the defaults, but won't stay up-to-date if they change.
        "--generate-hashes",
        "--emit-index-url",
        "--no-strip-extras",
        "--override=overrides.txt"
    ],
)

I think the following API would be a bit more succinct:

pip_compile(
    name = "generate_requirements_txt",
    requirements_in = "//:requirements.in",
    requirements_txt = "//:requirements.txt",
    overrides = "//:overrides.txt",
)

I'm happy to implement this, if it's a good idea.