From 99940de33fbcc14c994f2057366a4d835cfb0a4a Mon Sep 17 00:00:00 2001 From: Tim de Jager Date: Thu, 18 Jul 2024 15:20:46 +0200 Subject: [PATCH] fix: logic error in url retrieval --- .gitignore | 1 + .../recipe_sources.py | 2 +- tests/data/outputs_source.yaml | 23 +++++++++++-------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 0fb1fde..78e7d8d 100644 --- a/.gitignore +++ b/.gitignore @@ -165,3 +165,4 @@ mapping/*# pixi environments .pixi .vscode/ +.DS_store diff --git a/src/rattler_build_conda_compat/recipe_sources.py b/src/rattler_build_conda_compat/recipe_sources.py index 6485c33..441eaf5 100644 --- a/src/rattler_build_conda_compat/recipe_sources.py +++ b/src/rattler_build_conda_compat/recipe_sources.py @@ -43,7 +43,7 @@ def get_all_url_sources(recipe: Mapping[Any, Any]) -> Iterator[str]: sources = output.get("source", None) sources = typing.cast(ConditionalList[Source], sources) if sources is None: - return + continue sources = visit_conditional_list(sources, None) for source in sources: if "url" in source: diff --git a/tests/data/outputs_source.yaml b/tests/data/outputs_source.yaml index 717c4c8..7559a01 100644 --- a/tests/data/outputs_source.yaml +++ b/tests/data/outputs_source.yaml @@ -1,11 +1,14 @@ outputs: - source: - - if: foo - then: - - url: https://foo.com - - if: bla - then: - - url: https://bar.com - else: - - url: https://baz.com - - url: https://qux.com + - package: + name: foo + version: 1.0.0 + - source: + - if: foo + then: + - url: https://foo.com + - if: bla + then: + - url: https://bar.com + else: + - url: https://baz.com + - url: https://qux.com