Open iphan opened 2 months ago
Since the comparison is happening in Python, that could be doable, however, this would deviate from rules_uv
because it is not dropping comments.
However, the fact that your requirements.txt
has different comments suggests that you are trying to reuse a requirements.txt
generated on a different OS/Arch. For proper handling of such cases, consider using rules_uv
that has support for this.
Can you say more about how to use rules_uv
for this case?
Thank you
🚀 feature request
Relevant Rules
compile_pip_requirements rule
Description
compile_pip_requirements
rule adds arequirements_test
, which we use in our CI to validate the generated files: it runs the requirements.update bazel command and compares its output to the requirements.txt file stored in our repo. We hit a strange issue with pip-compile where the files generated on our local vs. CI differs only in the comments, causing the test to fail only on CI. For example, file generated on local only haswhereas file generated on CI includes
Describe the solution you'd like
Would it be possible to skip the comments when
requirements_test
is comparing the generated requirements.txt files?Describe alternatives you've considered
add
--no-annotate
as an extra-arg, so pip-compile does not to write comments. But ideally we'd like to keep this information as it is still useful to understand where each dependency comes from.