Better support of projects that use `uv` + `requirements.in`
fpgmaas opened this issue · 0 comments
uv
is getting a lot of attention, and seems to be quite popular. It has a similar feature as pip-compile
, where it generates a requirements.txt
file with all direct and transitive dependencies locked to a specific version. Both uv
and pip-compile
suggest storing the list of direct dependencies in a requirements.in
file.
In projects like this, the default deptry .
command will raise likely many incorrect errors: It will point out that many of the dependencies listed in requirements.txt
are unused. In these projects, users can configure deptry to work correctly as follows:
deptry --requirements-txt requirements.in .
This is a bit confusing. I suggest we make the following change to improve support of these projects:
- Renaming the arguments
requirements-txt
andrequirements-txt-dev
torequirements-file
andrequirements-file-dev
respectively.
Additionally, this change would also be great for these kind of projects:
- Checking if both a
requirements.in
and arequirements.txt
file are present in the project. If so, use therequirements.in
file.
However (2) is a bit more complicated, I don't see a clean solution for this directly. Currently we allow a user to pass multiple requirement files, and then requirements are read from all specified files. This would somehow need a feature where by default a list is provided (requirements.in
, requirements.txt
), and only the first one that exists is used. This requires some more thought.