You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Considering that this is "drop-in replacement" for pip-tools, you could try to match their behavior. The hook they have: https://github.com/jazzband/pip-tools/blob/main/.pre-commit-hooks.yaml, when ran the same way you tried it (with try-repo), generates the requirements.txt file. However, this is not because arguments were used, but rather that there is default behavior for pip-compile. So, should uv pip compile have a default behavior? Or is it wiser to mimic that behavior in the args of this hook?
In principle, I agree that the hook should not fail on default. However, uv has different behaviors from pip-tools. Primarily, if you run just pip-compile : Error: Invalid value: If you do not specify an input file, the default is one of: requirements.in, setup.py, pyproject.toml, setup.cfg. So, it checks for multiple files as the thing to compile. Even so, the pre-commit is set to only trigger if there are changes to either requirements.txt or requirements.in. And so, we could always assume that the requirements.in file exists and add a default arg of args: ["requirements.in"]. Because in both tools, you would still need to change the default behavior for any other setup. (pip-compile checks multiple file types, but the hook is setup to only check the requirments file)
All of this to say; Let the end user configure the tools provided to work for them. And just make it clear how it works in the README. And the default config should not error in default situations. So, the default "out of the box" configure should have the args: ["requirements.in"].
Right now, we do not provide default arguments so the default behavior is a failure (see #2).
We could provide something else and probably should have it working "out of the box". This is a tracking issue to discuss what would be best.
The text was updated successfully, but these errors were encountered: