stubber.utils.repos
¶
utility functions to handle to cloned repos needed for stubbing.
Module Contents¶
Functions¶
|
Switch to a specific version of the micropython repos. |
|
Read a csv with the micropython version and matching micropython-lib commit-hashes |
|
|
|
Fetch updates, then switch to the provided tag |
|
Return the paths to the micropython and micropython-lib repos, given a path to the repos.' |
- 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:
tag (str) –
mpy_path (pathlib.Path) –
mpy_lib_path (pathlib.Path) –
- stubber.utils.repos.read_micropython_lib_commits(filename: str = 'data/micropython_tags.csv')¶
Read a csv with the micropython version and matching 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
git for-each-ref –sort=creatordate –format ‘%(refname) %(creatordate)’ refs/tags
- Parameters:
filename (str) –
- stubber.utils.repos.match_lib_with_mpy(version_tag: str, mpy_path: pathlib.Path, lib_path: pathlib.Path) bool ¶
- Parameters:
version_tag (str) –
mpy_path (pathlib.Path) –
lib_path (pathlib.Path) –
- Return type:
- stubber.utils.repos.fetch_repos(tag: str, mpy_path: pathlib.Path, mpy_lib_path: pathlib.Path)¶
Fetch updates, then switch to the provided tag
- Parameters:
tag (str) –
mpy_path (pathlib.Path) –
mpy_lib_path (pathlib.Path) –
- stubber.utils.repos.repo_paths(dest_path: pathlib.Path) Tuple[pathlib.Path, pathlib.Path] ¶
Return the paths to the micropython and micropython-lib repos, given a path to the repos.’
- Parameters:
dest_path (pathlib.Path) –
- Return type:
Tuple[pathlib.Path, pathlib.Path]