From 434d505a11ddda5f2f02bb0d1d1353d842086b4c Mon Sep 17 00:00:00 2001 From: Sam Duke Date: Tue, 31 Oct 2023 08:58:58 +0000 Subject: [PATCH 1/3] Update repos.py Return from match_lib_with_mpy when checking out 'latest' --- src/stubber/utils/repos.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stubber/utils/repos.py b/src/stubber/utils/repos.py index c0800727..73a3d5e3 100644 --- a/src/stubber/utils/repos.py +++ b/src/stubber/utils/repos.py @@ -68,12 +68,12 @@ def read_micropython_lib_commits(filename: str = "data/micropython_tags.csv"): return version_commit -def match_lib_with_mpy(version_tag: str, lib_path: Path): +def match_lib_with_mpy(version_tag: str, lib_path: Path) -> Bool: micropython_lib_commits = read_micropython_lib_commits() # Make sure that the correct micropython-lib release is checked out # check if micropython-lib has matching tags if version_tag == "latest": - git.checkout_commit("master", lib_path) + return git.checkout_commit("master", lib_path) elif Version(version_tag) >= Version("v1.20.0"): # TODO:if version is v1.12.0 or newer # then use submodules to checkout the correct version of micropython-lib From 04b0943e055e22241fab649645821e9846734149 Mon Sep 17 00:00:00 2001 From: Sam Duke Date: Tue, 31 Oct 2023 09:05:00 +0000 Subject: [PATCH 2/3] Add error code get_frozen_cmd.py --- src/stubber/commands/get_frozen_cmd.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/stubber/commands/get_frozen_cmd.py b/src/stubber/commands/get_frozen_cmd.py index ef569a0f..e7405611 100644 --- a/src/stubber/commands/get_frozen_cmd.py +++ b/src/stubber/commands/get_frozen_cmd.py @@ -47,6 +47,7 @@ def cli_get_frozen( if version: result = fetch_repos(version, CONFIG.mpy_path, CONFIG.mpy_lib_path) if not result: + log.error("Failed to fetch repos for version: {} for micropython folder: {} and micropython-lib folder: {}".format(version, CONFIG.mpy_path.as_posix(), CONFIG.mpy_lib_path.as_posix())) return -1 else: version = utils.clean_version(git.get_local_tag(CONFIG.mpy_path.as_posix()) or "0.0") From 1707c699dcda44f968ea0d89b9454b6d7fd5e82c Mon Sep 17 00:00:00 2001 From: Sam Duke Date: Wed, 1 Nov 2023 15:19:11 +0000 Subject: [PATCH 3/3] Update repos.py --- src/stubber/utils/repos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stubber/utils/repos.py b/src/stubber/utils/repos.py index 73a3d5e3..4076663b 100644 --- a/src/stubber/utils/repos.py +++ b/src/stubber/utils/repos.py @@ -68,7 +68,7 @@ def read_micropython_lib_commits(filename: str = "data/micropython_tags.csv"): return version_commit -def match_lib_with_mpy(version_tag: str, lib_path: Path) -> Bool: +def match_lib_with_mpy(version_tag: str, lib_path: Path) -> bool: micropython_lib_commits = read_micropython_lib_commits() # Make sure that the correct micropython-lib release is checked out # check if micropython-lib has matching tags