-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support references between requirements files #58
Comments
Just realized that accepting data dependencies might also be necessary to support requirements files that use |
This ruleset aims to be a drop-in replacement for https://rules-python.readthedocs.io/en/stable/api/pip.html#compile-pip-requirements — is that what you’re presently using/could you share an example of your configuration? |
rules_python's An example that should be fairly quick to reproduce would be to clone https://github.com/jab/shorty and make the following 1-line change: diff --git a/requirements.test.in b/requirements.test.in
index b998a06..a5eb409 100644
--- a/requirements.test.in
+++ b/requirements.test.in
@@ -1 +1,2 @@
+-c ./requirements.base.txt
absl-py This allows the dependency resolution for the test environment to take into account the already-resolved dependencies of the base environment (so the test deps can be smoothly layered on top). If you try to compile this with rules_uv, it currently fails:
Of course, if you directly invoke
|
Fixed in #63 |
Thanks for fixing this! Looking forward to picking it up in the next release. (Also, just corrected the first sentence in my previous comment - rules_python's |
requirements files support referring to other requirements (or constraints) files (by beginning a line with
-r
or-c
). Composing requirements files thus is required to support correct, DRY, layered requirements (e.g. test dependencies should be constrained by runtime dependencies).I tried using a requirements.in file that uses
-c
with rules_uv'spip_compile
rule, but didn't see any way to specify the other requirements files that it references e.g. as data dependencies, so unsurprisingly it failed when I ran thepip_compile
target. Would it make sense to add support for this?Thanks for maintaining rules_uv! <3
The text was updated successfully, but these errors were encountered: