stubber.utils.repos

Module Contents

Functions

switch(tag, *, mpy_path, mpy_lib_path)

Switch to a specific version of the micropython repos.

read_micropython_lib_commits([filename])

Read a csv with the micropython version and matchin micropython-lib commit-hashes

match_lib_with_mpy(version_tag, lib_path)

stubber.utils.repos.switch(tag: str, *, mpy_path: pathlib.Path, mpy_lib_path: pathlib.Path)

Switch to a specific version of the micropython repos.

Specify the version with –tag or –version to specify the version tag of the MicroPython repo. The Micropython-lib repo will be checked out to a commit that corresponds in time to that version tag, in order to allow non-current versions to be stubbed correctly.

The repros must be cloned already

Parameters
stubber.utils.repos.read_micropython_lib_commits(filename='data/micropython_tags.csv')

Read a csv with the micropython version and matchin micropython-lib commit-hashes these can be used to make sure that the correct micropython-lib version is checked out.

filename is relative to the ‘stubber’ package

TODO: it would be nice if micropython-lib had matching commit-tags

git for-each-ref –sort=creatordate –format ‘%(refname) %(creatordate)’ refs/tags

stubber.utils.repos.match_lib_with_mpy(version_tag: str, lib_path: pathlib.Path)
Parameters