How to use the tbump.file_bumper.ChangeRequest 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 / file_bumper.py View on Github external
def get_patches(self, new_version: str) -> List[Patch]:
        self.new_version = new_version
        self.new_groups = self.parse_version(self.new_version)
        change_requests = self.compute_change_requests()
        tbump_toml_change = ChangeRequest(
            "tbump.toml", self.current_version, new_version
        )
        change_requests.append(tbump_toml_change)
        patches = []
        for change_request in change_requests:
            patches_for_request = self.compute_patches_for_change_request(
                change_request
            )
            patches.extend(patches_for_request)
        return patches
github TankerHQ / tbump / tbump / file_bumper.py View on Github external
on_version_containing_none(
                    file.src,
                    "replace by",
                    new_version,
                    groups=self.new_groups,
                    template=file.version_template,
                )
        else:
            current_version = self.current_version
            new_version = self.new_version

        to_search = None
        if file.search:
            to_search = file.search.format(current_version=re.escape(current_version))

        return ChangeRequest(file.src, current_version, new_version, search=to_search)