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