-
Notifications
You must be signed in to change notification settings - Fork 423
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
Refactor which_package & which_prefix #5041
Conversation
if avoid_canonical_channel_name: | ||
fn = linked_data_no_multichannels | ||
else: | ||
fn = linked_data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linked_data_no_multichannels
and linked_data
do the following:
from conda.core.prefix_data import PrefixData
from conda.models.dist import Dist
def linked_data_no_multichannels(prefix):
return {
Dist.from_string(prec.fn, channel_override=prec.channel.name): prec
for prec in PrefixData(prefix).iter_records()
}
def linked_data(prefix):
return {
Dist(prec): prec
for prec in PrefixData(prefix).iter_records()
}
since this PR eliminates the poor PrefixRecord
→ Dist
translation I don't believe there's a need to distinguish between avoid_canonical_channel_name
anymore (not that I'm entirely sure what that means in the first place)
Description
Consolidate
which_package
implementations and replaces legacyconda.models.dist.Dist
usage with modernconda.models.records.PrefixRecords
.Discovered while working to remove usage of the following:
linked_data_no_multichannels
linked_data
linked
is_linked
Depends on #5055
Checklist - did you ...
news
directory (using the template) for the next release's release notes?Add / update necessary tests?Add / update outdated documentation?