Open zmeir opened 2 weeks ago
You might want to use uv tree
to debug your dependency install failures instead?
Cool, thanks!
That still means I have to log into the environment that failed and run the command there to debug, instead of just looking up the requirements.txt
file from the output. In my team we have a handful of developers working on many projects, so sometimes the person debugging a failure doesn't have the project cloned and set up with a working environment when starting to debug, so pulling the failed version to get the current uv.lock
file and then running uv tree
can take a while longer (especially for the less experienced folks).
The alternative of just looking at the build log and seeing which package failed, and then looking where that package came from in the requirements.txt
file (from GitHub or the CI logs/artifacts), is still simpler I think. But I understand this might be a very niche use-case...
I should also note that in certain cases we don't even keep the uv.lock
file, for example when exporting requirements.txt
with --resolution lowest
to test that our app works with the lowest versions of our dependencies. It is done ad-hoc by the CI and we don't keep the uv.lock
file for that resolution because we don't want it to override the on with the default --resolution highest
.
Anyway, this is certainly not a big deal, just want to share this idea.
I have a project I'm developing with
uv
. I useuv lock
to lock my dependency versions for my app, anduv sync --frozen
to install my development and test environments.The framework I use to deploy my app uses a
requirements.txt
file to install the application's dependencies.Previously I used
uv pip compile
to generate therequirements.txt
file, but I figured since I already have theuv.lock
file, I can save the extra resolution step and just useuv export --frozen
. And it works perfectly!However, there is one small thing - the
uv pip compile
output is more verbose and adds comments under each package to show its dependency trace. Conversely,uv export
does not, and only shows the package versions (likepip freeze
).Here is an example for the
pyproject.toml
This is how the output of
uv pip compile pyproject.toml
looks:And this is the output from
uv export --frozen --no-hashes
(after having previous ranuv lock
):Is it possible to add the same dependency trace comments for the
uv export
output?This is not a real issue when the consumer of the
requirements.txt
file is an automated system, but I found theuv pip compile
output can be helpful when trying to debug the root cause of deployment failures due to unsuccessful dependency installations.Of course this is not a very pressing issue, since you can always trace the origin of a dependency through the
uv.lock
file, but I thought since the information is already there whenuv export
generates its output, then maybe it can be done without much effort. Or maybe even this option already exists I just couldn't find how to enable it...