Skip to content

Commit ff127f8

Browse files
committed
build: igor tweaks for scriv start marker
1 parent 5f65d87 commit ff127f8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

igor.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ def update_file(fname, pattern, replacement):
413413
fobj.write(new_text)
414414

415415
UNRELEASED = "Unreleased\n----------"
416+
SCRIV_START = ".. scriv-start-here\n\n"
416417

417418
def do_edit_for_release():
418419
"""Edit a few files in preparation for a release."""
@@ -430,7 +431,8 @@ def do_edit_for_release():
430431
rule = "-" * len(title)
431432
new_head = f".. _changes_{facts.anchor}:\n\n{title}\n{rule}"
432433

433-
update_file("CHANGES.rst", re.escape(UNRELEASED), new_head)
434+
update_file("CHANGES.rst", re.escape(SCRIV_START), "")
435+
update_file("CHANGES.rst", re.escape(UNRELEASED), SCRIV_START + new_head)
434436

435437
# doc/conf.py
436438
new_conf = textwrap.dedent(f"""\
@@ -454,8 +456,8 @@ def do_bump_version():
454456
# CHANGES.rst
455457
update_file(
456458
"CHANGES.rst",
457-
r"(?m)^\.\. _changes_",
458-
f"{UNRELEASED}\n\nNothing yet.\n\n\n.. _changes_",
459+
re.escape(SCRIV_START),
460+
f"{UNRELEASED}\n\nNothing yet.\n\n\n" + SCRIV_START,
459461
)
460462

461463
# coverage/version.py

0 commit comments

Comments
 (0)