MCPcopy
hub / github.com/psf/black / update_version_in_docs

Method update_version_in_docs

scripts/release.py:189–205  ·  scripts/release.py::SourceFiles.update_version_in_docs
(self)

Source from the content-addressed store, hash-verified

187 return 0 class="cm"># return 0 if no exceptions hit
188
189 def update_version_in_docs(self) -> None:
190 for doc_path in self.version_doc_paths:
191 LOG.info(fclass="st">"Updating black version to {self.next_version} in {doc_path}")
192
193 with doc_path.open(class="st">"r", encoding=class="st">"utf-8") as dfp:
194 doc_string = dfp.read()
195
196 next_version_doc = doc_string.replace(
197 self.current_version, self.next_version
198 )
199
200 with doc_path.open(class="st">"w", encoding=class="st">"utf-8") as dfp:
201 dfp.write(next_version_doc)
202
203 LOG.debug(
204 fclass="st">"Finished updating black version to {self.next_version} in {doc_path}"
205 )
206
207
208def _handle_debug(debug: bool) -> None:

Callers 1

Calls 3

readMethod · 0.80
replaceMethod · 0.80
writeMethod · 0.80

Tested by

no test coverage detected