From 85c4173a38f8a1d26cbc47abcf83d11f6a16049a Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Wed, 8 Jan 2025 19:09:53 +0100 Subject: [PATCH] also use recipe_path in _update_version_feedstock_dir_local --- conda_forge_tick/update_recipe/version.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/conda_forge_tick/update_recipe/version.py b/conda_forge_tick/update_recipe/version.py index 2ccc1e86f..d7345eb49 100644 --- a/conda_forge_tick/update_recipe/version.py +++ b/conda_forge_tick/update_recipe/version.py @@ -601,22 +601,24 @@ def _update_version_feedstock_dir_local( ) -> (bool, set): feedstock_path = Path(feedstock_dir) - recipe = feedstock_path / "recipe" / "meta.yaml" - if recipe.exists(): + recipe_path = None + recipe_path_v0 = feedstock_path / "recipe" / "meta.yaml" + recipe_path_v1 = feedstock_path / "recipe" / "recipe.yaml" + if recipe_path_v0.exists(): + recipe_path = recipe_path_v0 updated_meta_yaml, errors = update_version( recipe.read_text(), version, hash_type=hash_type ) + elif recipe_path_v1.exists(): + recipe_path = recipe_path_v1 + updated_meta_yaml, errors = update_version_v1( + feedstock_dir, version, hash_type + ) else: - recipe = feedstock_path / "recipe" / "recipe.yaml" - if recipe.exists(): - updated_meta_yaml, errors = update_version_v1( - feedstock_dir, version, hash_type - ) - else: - return False, {"no recipe found"} + return False, {"no recipe found"} if updated_meta_yaml is not None: - recipe.write_text(updated_meta_yaml) + recipe_path.write_text(updated_meta_yaml) return updated_meta_yaml is not None, errors