theoremlp / rules_uv

Bazel rules for running uv
Apache License 2.0
31 stars 14 forks source link

pip-compile: args #46

Closed hugocarr closed 4 months ago

hugocarr commented 4 months ago

Summary

We would like to make the arguments into pip compile configurable for rules_uv. Specifically:

Description of changes

Risks

There doesn't seem to be a lot of automated testing available using bazel test, so there may be edge cases I've missed. Particularly with the changes to the bash scripts.

Testing

Tested locally by extending the repo BUILD file with

load("//uv:pip.bzl", "pip_compile")

pip_compile(
    name = "generate_requirements_txt",
    generate_hashes = True,
    emit_index_url = False,
    no_strip_extras = False,
    custom_compile_command = "./bin/run_pip_compile",
)

and running bazel run //:generate_requirements_txt

Tested in a much larger private codebase using

git_override(
    module_name = "rules_uv",
    remote = "https://github.com/hugocarr/rules_uv",
    commit = "c479c2dcb9819ef8cfc4501a0660c993ad8ab4ec",
)

and it works as expected for our usecase.

mark-thm commented 4 months ago

Landed configurability in https://github.com/theoremlp/rules_uv/pull/55