Skip to content

Commit

Permalink
Merge pull request #442 from samskiter/patch-1
Browse files Browse the repository at this point in the history
Fix bug in get-frozen when using version=latest
  • Loading branch information
Josverl authored Nov 4, 2023
2 parents 0bbf847 + 1707c69 commit 7fab7c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/stubber/commands/get_frozen_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions src/stubber/utils/repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7fab7c0

Please sign in to comment.