Skip to content
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

feat: List outdated packages #1185

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

abkfenris
Copy link
Contributor

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

This is a very rough attempt at being able to show outdated packages (similar to `pip list --outdated`). Currently it only works for Conda packages, and I'm pretty sure it doesn't have much awareness of channels, but it works in a few test cases.
@wolfv
Copy link
Member

wolfv commented Apr 13, 2024

This looks great!

@ruben-arts
Copy link
Contributor

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

@abkfenris
Copy link
Contributor Author

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

pixi/src/cli/add.rs

Lines 229 to 230 in 82e20a8

// TODO: Get best version
// Add the dependency to the project

I tried poking around UV's source, but I'm not quite sure where I should start looking.

@tdejager
Copy link
Contributor

@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.

@ruben-arts
Copy link
Contributor

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

This would only work for the direct once I guess

@abkfenris
Copy link
Contributor Author

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

@ruben-arts ruben-arts added the help wanted Extra attention is needed label Apr 25, 2024
@dhirschfeld
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants