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: topological sort of PackageRecords #218

Merged
merged 2 commits into from
Jun 16, 2023

Conversation

baszalmstra
Copy link
Collaborator

Adds topological sorting of PackageRecords from rattler-server. This implementation differs slightly in that it allows any Vec of something that resembles a PackageRecord to be sorted. This includes RepoDataRecord and PrefixRecord.

@baszalmstra baszalmstra requested a review from wolfv June 16, 2023 08:42
}

/// Retrieves the names of the packages that form the roots of the graph
fn get_graph_roots<T: AsRef<PackageRecord>>(records: &[T]) -> Vec<String> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this function might fall apart if we have multiple package records with the same name in the vector, right?

Since version 0 might be at the root, but if version 1 adds some dependencies it might not be at the root anymore.

We might want to clarify that this works only for lists of unique package names.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one, I added this to the docs.

@wolfv wolfv merged commit b510e0d into conda:main Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants