MCPcopy
hub / github.com/psycopg/psycopg / _get_changes_lines

Method _get_changes_lines

tools/bump_version.py:234–247  ·  view source on GitHub ↗
(self, fp: Path, version: Version)

Source from the content-addressed store, hash-verified

232 f.write("\n")
233
234 def _get_changes_lines(self, fp: Path, version: Version) -> list[str]:
235 with fp.open() as f:
236 lines = f.readlines()
237
238 if not (lns := self._find_lines("^[^\\s]+ " + re.escape(str(version)), lines)):
239 logger.warning("no change log line found")
240 return []
241
242 assert len(lns) == 1
243 start = end = lns[0] + 3
244 while lines[end].rstrip():
245 end += 1
246
247 return lines[start:end]
248
249 def _find_lines(self, pattern: str, lines: list[str]) -> list[int]:
250 rv = []

Callers 1

create_tagMethod · 0.95

Calls 2

_find_linesMethod · 0.95
openMethod · 0.45

Tested by

no test coverage detected