-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add pip list --outdated
#2150
Comments
@zanieb @charliermarsh I was wondering if there were any plans for adding this feature in the coming releases? This is one of the last pieces of the puzzle for our full transition to |
We don't have any immediate plans to implement this although it seems like it wouldn't be particularly challenging (we have all the components needed for this). Can you share more about your use-case? I'd be happy to review a contribution adding support for this. |
Thanks for the reply. We have a somewhat complicated dependency management process which precludes us from using tools like renovate or dependabot on our repo. As such we use From that point of view this is more of a "nice to have" rather than a show-stopper, but for our team this functionality gives us a big quality of life improvement in our DX. I'm happy to take a swing at the implementation if all the pieces are there 🤞 |
(And while I have you, many thanks for embarking on this project. |
Thanks for all the kind words :) that's an interesting use-case but it makes some sense to me. I imagine it'd make sense to have a future workflow that does not depend on listing the installed packages and can just give you metadata directly from a lockfile... but we can think more about that separately. Feel free to give it a try. I'm happy to provide any guidance. I'd look at the |
Sounds good, I'll try to chip away at this over the coming days and see where I get to. So far I've got a build going and added the CLI arg, so I now I just need to fill in: if outdated {
...
} Simple :-) Just getting familiar with the resolver structs and how all the pieces fit together. I'll reach out with any questions and ship a draft PR for feedback when I have something to look at. |
i am writing autotests, and one of them is checking for oudated dependencies i use and it is sooo slow i hope uv will be much faster waiting for the pull request to be accepted |
FWIW I think that the lack of |
How can one upgrade all packages in a venv without this command (or |
@mralusw You can keep track of the packages in requirements+lock files, upgrade those, then sync. $ uv pip compile -U requirements.in -o requirements.txt
$ uv pip sync requirements.txt Or without any locking or syncing, just listing top level pkgs, this may do: $ uv pip install -Ur requirements.in Otherwise you might collect the names from $ uv pip list --format json then |
Just an opinion at here: Also, fwiw I opened a enhancement request for |
hello, is there any progress with implementing this? |
While there are work-arounds, note that For example, when writing a package manager, it's a natural workflow to
Only the last step might need admin privileges, and only the last two need an interactive environment. Also, it's a waste to have a resolution mechanism and not expose it (especially when there's a clear API, already exposed by an equivalent tool — as in this case). |
I think this is a really good question and illustrates your team's desire to provide good interfaces. For me, I use this in a few places:
Thus, I don't really need
|
Just curious, is there a technical reason why the results of the package resolution process might be difficult to expose? I'm writing a package manager that sits on top of |
I don't think it's hard to expose the package resolution results per-say, it's just a good bit of work and we're not prioritizing adding output formats right now. See #3199 which is a bit more focused on the goal of machine readable output. |
In case it helps someone, this is how I've been simulating
Obviously not in the same format, but it serves to show held back packages. Performance is simply dumbfounding on a raspberry pi 2w:
|
I also encountered this issue, so for the time being, I decided to run I hope this will be helpful to someone. |
Another use case: I use |
@zanieb For example, every time I work with a PR, I can just run one command to check the status of all the used packages. If I see that quite a few packages that could be updated, I would start looking into this. I do it like this using Poetry and it works very good with keeping things up to date. The alternative would be to leave this to random chance (check when you remember to do it) or set up something like a quartely calendar event to check it. It would also be a neater way to automate this with for example a Github Action (which is possible with the script from @ziddey, but would be better with a an official solution). This is the one feature holding me back from migrating to UV for all our packages. |
Wouldn't this be better as |
I don't know about a tree output, which may be nice, but FWIW regarding output format: I currently wrap |
My point wasn't that the output format. My point was that the use case suggested above should be showing the packages that can be updated given the lock rather than simply the outdated packages. |
This seems sensible - coming from pip, |
Sorry, I think we're talking past each other. As I said in my last comment, this has nothing to do with format. (It also has nothing to do with direct dependencies.) My point was that the use case suggested above should be showing the packages that can be updated given the [project file] rather than simply the outdated packages. Consider, for example that you have dependencies:
And you have jaxlib==0.4.31 and numpy==2.0.0 installed. Suppose that jaxlib 0.5.0 and numpy 2.1.0 are available. What should be displayed? pip list --outdated naively says: jaxlib 0.5.0 and numpy 2.1.0 That's because it doesn't see your pyproject.toml file. I think it's more useful (considering the use cases mentioned in this thread, which are project use cases) to show only that numpy is outdated. This is because This is what Of course, when it comes to packaging there are more use cases than I can imagine. Perhaps other people are more interested in the pip-like behavior. I'm not sure. |
no it isn't. poetry shows all packages for which newer versions are available even if fwiw I find this behaviour more useful than telling me which packages it would upgrade if I re-locked. (I can whereas telling me that I have an upper bound that I might want to relax is something I want to know. |
Ah, my mistake. For some reason I thought it was doing the dry run essentially.
For me, I get a lot of noise from downstream package limits that I can't relax holding things back. That's why I'd rather just see what I can control. Maybe it would be nice to show at least two sections:
This would still hide some outdated packages if they are blocked by dependencies within dependencies. Maybe those should be shown in a third section so that you can ping their maintainers. WDYT? |
Sounds sensible, those are three use cases. The last one would be the least useful to me, but the first two I use very regularly. |
Looks like there are different features being discussed here. I propose we use this thread to only discuss what seems to be the original feature, which is what |
(Apologies for continuing this thread for the not directly FYI - not great but functional work around: Current work around (not ideal):
I'm not happy with this (I'm sure there are many complexities being missed here), but it works-ish Goes with saying - thank you to the Astral team for all the incredible work y'all are doing in this space - huge strides! |
I would love for this to be a thing. I mostly use In that ecosystem, my favourite and most commonly used commands are |
Not sure what the command is supposed to do but with this in project.dependencies: "boltons>=24.1.0", it doesn't show that boltons is outdated (25.0.0 available) |
AFAIU, like pip, it's reporting on the actually installed version vs the newest release, disregarding stated requirements. |
Yeah this is a
|
Originally posted by @ismail in #1401 (comment)
Creating a separate issue for visibility, as the issue for creating the
uv pip list
command has now been closed as complete. Apologies if I missed an issue that already requested this - feel free to close this as a duplicate if that's the case.I use
pip list --outdated
all the time (more than any other form ofpip list
, probably). It would be really useful to have inuv
as well.The text was updated successfully, but these errors were encountered: