From eb30835f63c7058eb951ba9f538532aa18b731cb Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Fri, 11 Oct 2024 12:27:39 +0200 Subject: [PATCH] enable arch migrators for v1 recipes --- conda_forge_tick/migrators/arch.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/conda_forge_tick/migrators/arch.py b/conda_forge_tick/migrators/arch.py index d811af004..edcf98b45 100644 --- a/conda_forge_tick/migrators/arch.py +++ b/conda_forge_tick/migrators/arch.py @@ -1,5 +1,6 @@ import os import typing +from pathlib import Path from textwrap import dedent from typing import Any, Optional, Sequence @@ -91,6 +92,7 @@ class ArchRebuild(GraphMigrator): rerender = True # We purposefully don't want to bump build number for this migrator bump_number = 0 + allowed_schema_versions = [0, 1] ignored_packages = { "make", "perl", @@ -202,8 +204,15 @@ def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool: def migrate( self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any ) -> "MigrationUidTypedDict": + recipe_dir_path = Path(recipe_dir) with pushd(recipe_dir + "/.."): - self.set_build_number("recipe/meta.yaml") + if (recipe_dir_path / "recipe/meta.yaml").exists(): + self.set_build_number("recipe/meta.yaml") + elif (recipe_dir_path / "recipe/recipe.yaml").exists(): + self.set_build_number("recipe/recipe.yaml") + else: + raise FileNotFoundError("No meta.yaml or recipe.yaml found") + with open("conda-forge.yml") as f: y = yaml_safe_load(f) if "provider" not in y: @@ -247,6 +256,7 @@ class OSXArm(GraphMigrator): rerender = True # We purposefully don't want to bump build number for this migrator bump_number = 0 + allowed_schema_versions = [0, 1] ignored_packages = set() excluded_dependencies = set() @@ -375,8 +385,15 @@ def filter(self, attrs: "AttrsTypedDict", not_bad_str_start: str = "") -> bool: def migrate( self, recipe_dir: str, attrs: "AttrsTypedDict", **kwargs: Any ) -> "MigrationUidTypedDict": + recipe_dir_path = Path(recipe_dir) with pushd(recipe_dir + "/.."): - self.set_build_number("recipe/meta.yaml") + if (recipe_dir_path / "recipe/meta.yaml").exists(): + self.set_build_number("recipe/meta.yaml") + elif (recipe_dir_path / "recipe/recipe.yaml").exists(): + self.set_build_number("recipe/recipe.yaml") + else: + raise FileNotFoundError("No meta.yaml or recipe.yaml found") + with open("conda-forge.yml") as f: y = yaml_safe_load(f) # we should do this recursively but the cf yaml is usually