From 0e0b2fc8165abbdca63fbc9ac0d5f943aa47eeec Mon Sep 17 00:00:00 2001 From: Daniel Ching Date: Mon, 25 Nov 2024 12:36:12 -0600 Subject: [PATCH] CI: Add new lint for multi-output recipes --- .github/workflows/scripts/linter.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/scripts/linter.py b/.github/workflows/scripts/linter.py index b7c66da293dba..6d83057c9c35a 100644 --- a/.github/workflows/scripts/linter.py +++ b/.github/workflows/scripts/linter.py @@ -91,6 +91,9 @@ def _lint_recipes(gh, pr): sources_section = get_section( meta, "source", lints, recipe_version=recipe_version ) + outputs_section = get_section( + meta, "outputs", lints, recipe_version=recipe_version + ) extra_section = get_section( meta, "extra", lints, recipe_version=recipe_version ) @@ -101,6 +104,8 @@ def _lint_recipes(gh, pr): else: recipe_name = package_section.get("name", "").strip() + recipe_name = extra_section.get("feedstock-name", recipe_name) + # 4. Check for existing feedstocks in conda-forge or bioconda if recipe_name: cf = gh.get_user("conda-forge") @@ -214,6 +219,15 @@ def _lint_recipes(gh, pr): 'correct format. Please use "org/team" format.' ) + # 7. Check that feedstock-name is defined if recipe is multi-output + if outputs_section and ("feedstock-name" not in extra_section): + hints[fname].append( + "It looks like you are submitting a multi-output recipe. " + "In these cases, the correct name for the feedstock is ambiguous, " + "and our infrastructure defaults to the top-level `package.name` field. " + "Please add a `feedstock-name` entry in the `extra` section." + ) + return dict(lints), dict(hints), extra_edits