How to use the tbump.config function in tbump

To help you get started, we’ve selected a few tbump examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TankerHQ / tbump / tbump / main.py View on Github external
def parse_config(working_path: Path) -> Config:
    tbump_path = working_path / "tbump.toml"
    try:
        config = tbump.config.parse(tbump_path)
    except IOError as io_error:
        raise InvalidConfig(io_error=io_error)
    except Exception as parse_error:
        raise InvalidConfig(parse_error=parse_error)
    return config
github TankerHQ / sdk-js / ci / deploy.py View on Github external
def version_from_git_tag(git_tag):
    prefix = "v"
    assert git_tag.startswith(prefix), "tag should start with %s" % prefix
    tbump_cfg = tbump.config.parse(Path("tbump.toml"))
    regex = tbump_cfg.version_regex
    version = git_tag[len(prefix):]
    match = regex.match(version)
    assert match, "Could not parse %s as a valid tag" % git_tag
    return version
github TankerHQ / tbump / tbump / file_bumper.py View on Github external
def bump_files(new_version: str, repo_path: Path = None) -> None:
    repo_path = repo_path or Path(".")
    bumper = FileBumper(repo_path)
    cfg = tbump.config.parse(repo_path / "tbump.toml")
    bumper.set_config(cfg)
    patches = bumper.get_patches(new_version=new_version)
    n = len(patches)
    for i, patch in enumerate(patches):
        ui.info_count(i, n, patch.src)
        patch.print_self()
        patch.apply()