From 568f245f446a3ad6a3a56d4bdd6c03ef17e5fa0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tja=C5=BE=20Vra=C4=8Dko?= Date: Wed, 2 Oct 2024 13:56:15 +0200 Subject: [PATCH] fix: Parsing of west.yml when determening NCS version --- CHANGELOG.md | 4 ++++ src/east/helper_functions.py | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89e1d38..36109df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ## [Unreleased] +### Fixed + +- Parsing of `west.yml` when a project within the yaml does not contain the `repo-path` key. + ## [0.23.0] - 2024-09-24 ### Added diff --git a/src/east/helper_functions.py b/src/east/helper_functions.py index 571064b..fba6473 100644 --- a/src/east/helper_functions.py +++ b/src/east/helper_functions.py @@ -174,10 +174,11 @@ def get_ncs_and_project_dir(west_dir_path: str) -> Tuple[str, str]: try: ncs = list( filter( - lambda project: project["repo-path"] == "sdk-nrf", manifest["projects"] + lambda project: project.get("repo-path", "") == "sdk-nrf", + manifest["projects"], ) ) - except KeyError: + except KeyError as e: # This can happen in the case where there is no sdk-nrf repo in the west yaml # file, project is probably using ordinary Zephyr. return None, project_path