Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in get-frozen when using version=latest #442

Merged
merged 3 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading