From 379b53f0f21ba3b7134e2b722173d127100f9603 Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Sat, 16 Mar 2024 17:32:05 +0100 Subject: [PATCH] Stop using conda_build.conda_interface conda_build.conda_interface.get_index (which is conda.exports.get_index) is using the conda.models.Dist -> conda.models.records.PackageRecord mapping. Dist class is legacy code that's being phased out, so avoid it. refs: - https://github.com/conda/conda-build/pull/5152 - https://github.com/conda/conda-build/pull/5222 Signed-off-by: Marcel Bargull --- build_cdt_recipes.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/build_cdt_recipes.py b/build_cdt_recipes.py index d6f59b53..52d6ba21 100644 --- a/build_cdt_recipes.py +++ b/build_cdt_recipes.py @@ -12,7 +12,7 @@ import click from ruamel.yaml import YAML -from conda_build.conda_interface import get_index +from conda.core.index import get_index from cdt_config import ( LEGACY_CDT_PATH, @@ -95,15 +95,14 @@ def _get_recipe_attrs(recipe, channel_index): def _build_cdt_meta(recipes, dist_arch_slug): print("getting conda-forge/label/main channel index...", flush=True) channel_url = '/'.join(['conda-forge', 'label', 'main']) - dist_index = get_index( - [channel_url], - prepend=False, - use_cache=False - ) channel_index = { - c.to_filename(): a - for c, a in dist_index.items() - if a['subdir'] == 'noarch' + prec.fn: prec + for prec in get_index( + [channel_url], + prepend=False, + use_cache=False, + ) + if prec.subdir == 'noarch' } cdt_meta = {}