(self)
| 141 | return 0 |
| 142 | |
| 143 | def cleanup_changes_template_for_release(self) -> None: |
| 144 | LOG.info(f"Cleaning up {self.changes_path}") |
| 145 | |
| 146 | with self.changes_path.open("r", encoding="utf-8") as cfp: |
| 147 | changes_string = cfp.read() |
| 148 | |
| 149 | # Change Unreleased to next version |
| 150 | changes_string = changes_string.replace( |
| 151 | "## Unreleased", f"## Version {self.next_version}" |
| 152 | ) |
| 153 | |
| 154 | # Remove all comments |
| 155 | changes_string = re.sub(r"(?m)^<!--(?>(?:.|\n)*?-->)\n+", "", changes_string) |
| 156 | |
| 157 | # Remove empty subheadings |
| 158 | changes_string = re.sub(r"(?m)^###.+\n+(?=#)", "", changes_string) |
| 159 | |
| 160 | with self.changes_path.open("w", encoding="utf-8") as cfp: |
| 161 | cfp.write(changes_string) |
| 162 | |
| 163 | LOG.debug(f"Finished Cleaning up {self.changes_path}") |
| 164 | |
| 165 | def get_current_version(self) -> str: |
| 166 | """Get the latest git (version) tag as latest version""" |
no test coverage detected