Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard committed Oct 18, 2023
1 parent bada3b1 commit 0a52fd0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions conda_build/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Copyright (C) 2014 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations

import contextlib
import fnmatch
import hashlib
Expand Down Expand Up @@ -68,6 +70,9 @@

from conda.api import PackageCacheData # noqa
from conda.base.constants import KNOWN_SUBDIRS
from conda.core.prefix_data import PrefixData
from conda.models.dist import Dist
from conda.models.records import PackageRecord

# NOQA because it is not used in this file.
from conda_build.conda_interface import rm_rf as _rm_rf # noqa
Expand Down Expand Up @@ -2153,14 +2158,14 @@ def download_channeldata(channel_url):
return data


def linked_data_no_multichannels(prefix):
def linked_data_no_multichannels(
prefix: str | os.PathLike | Path,
) -> dict[Dist, PackageRecord]:
"""
Return a dictionary of the linked packages in prefix, with correct channels, hopefully.
cc @kalefranz.
"""
from conda.core.prefix_data import PrefixData
from conda.models.dist import Dist

prefix = Path(prefix)
return {
Dist.from_string(prec.fn, channel_override=prec.channel.name): prec
for prec in PrefixData(prefix)._prefix_records.values()
Expand Down

0 comments on commit 0a52fd0

Please sign in to comment.