From d0f7f9c15abb052268a2b18701364bfab7c800ed Mon Sep 17 00:00:00 2001 From: Ben Mares Date: Sat, 28 Sep 2024 12:40:34 +0200 Subject: [PATCH] Improve error message for missing conda-recipe-manager --- grayskull/utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/grayskull/utils.py b/grayskull/utils.py index 2c9a998a8..507196881 100644 --- a/grayskull/utils.py +++ b/grayskull/utils.py @@ -244,7 +244,15 @@ def upgrade_v0_recipe_to_v1(recipe_path: Path) -> None: JINJA plugin. :param recipe_path: Path to that contains the original recipe file to modify. """ - from conda_recipe_manager.parser.recipe_parser_convert import RecipeParserConvert + try: + from conda_recipe_manager.parser.recipe_parser_convert import ( + RecipeParserConvert, + ) + except ImportError as e: + raise ImportError( + "Please install conda-recipe-manager from conda-forge to enable " + "support for the V1 format." + ) from e recipe_content: Final[str] = RecipeParserConvert.pre_process_recipe_text( recipe_path.read_text()