stubber.utils.repos =================== .. py:module:: stubber.utils.repos .. autoapi-nested-parse:: utility functions to handle to cloned repos needed for stubbing. Functions --------- .. autoapisummary:: stubber.utils.repos.switch stubber.utils.repos.read_micropython_lib_commits stubber.utils.repos.sync_submodules stubber.utils.repos.checkout_arduino_lib stubber.utils.repos.match_lib_with_mpy stubber.utils.repos.fetch_repos stubber.utils.repos.repo_paths Module Contents --------------- .. py:function:: 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 .. py:function:: 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 .. py:function:: sync_submodules(repo: Union[pathlib.Path, str]) -> bool make sure any submodules are in sync .. py:function:: checkout_arduino_lib(mpy_path: pathlib.Path) Checkout the arduino-lib submodule repo if it exists This is needed as some of the arduino boards freeze modules originationg from the arduino-lib .. py:function:: match_lib_with_mpy(version_tag: str, mpy_path: pathlib.Path, lib_path: pathlib.Path) -> bool .. py:function:: fetch_repos(tag: str, mpy_path: pathlib.Path, mpy_lib_path: pathlib.Path) Fetch updates, then switch to the provided tag/branch/commit .. py:function:: 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.'