pixi icon indicating copy to clipboard operation
pixi copied to clipboard

feat: List outdated packages

Open abkfenris opened this issue 1 year ago • 7 comments

This is a very rough attempt at being able to show outdated packages (similar to pip list --outdated), but I wanted to get it out there to see if there is interest in developing it further.

Currently it only works for Conda packages, and I don't believe it should have any awareness of which package came from which channel, but it works in a few test cases.

image

abkfenris avatar Apr 13 '24 01:04 abkfenris

This looks great!

wolfv avatar Apr 13 '24 08:04 wolfv

Yeah love the idea! Please continue. Would be awesome to color it yellow if the new version is within the requirements range.

ruben-arts avatar Apr 15 '24 09:04 ruben-arts

Would be awesome to color it yellow if the new version is within the requirements range.

Are you thinking just for direct dependencies, or for all?

Is there a reasonable way to search for the latest PyPI dependencies as well, or should I throw a warning if there are any PyPI dependencies for now? I was largely cribbing from cli/add.rs and `cli/search.rs https://github.com/prefix-dev/pixi/blob/82e20a8e039fa14217a07d90fe696055077aba57/src/cli/add.rs#L229-L230 I tried poking around UV's source, but I'm not quite sure where I should start looking.

abkfenris avatar Apr 15 '24 13:04 abkfenris

@abkfenris For uv you can construct a DefaultResolverProvider that takes in some uv specific variables.

This how they construct it in the resolver:

        let provider = DefaultResolverProvider::new(
            client,
            DistributionDatabase::new(build_context.cache(), tags, client, build_context),
            flat_index,
            tags,
            PythonRequirement::new(interpreter, markers),
            AllowedYanks::from_manifest(&manifest, markers),
            options.exclude_newer,
            build_context.no_binary(),
            build_context.no_build(),
        );

Needs quite some variables, some of which can be taken from the UvResolutionContext that can be constructed from the project. That struct has a method called get_package_versions. Which should be what you are looking for I think.

tdejager avatar Apr 15 '24 14:04 tdejager

Are you thinking just for direct dependencies, or for all?

This would only work for the direct once I guess

ruben-arts avatar Apr 16 '24 07:04 ruben-arts

I'm unlikely to be able to dig back into this for another couple weeks if someone wants to run with it.

abkfenris avatar Apr 23 '24 19:04 abkfenris

Awesome! I've wanted something like this for quite a while. It would be very useful to be able to see which packages aren't the latest versions due to constraints in the environment.

dhirschfeld avatar Apr 26 '24 00:04 dhirschfeld