Skip to content

Commit

Permalink
build: igor tweaks for scriv start marker
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jan 22, 2023
1 parent 5f65d87 commit ff127f8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions igor.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ def update_file(fname, pattern, replacement):
fobj.write(new_text)

UNRELEASED = "Unreleased\n----------"
SCRIV_START = ".. scriv-start-here\n\n"

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

update_file("CHANGES.rst", re.escape(UNRELEASED), new_head)
update_file("CHANGES.rst", re.escape(SCRIV_START), "")
update_file("CHANGES.rst", re.escape(UNRELEASED), SCRIV_START + new_head)

# doc/conf.py
new_conf = textwrap.dedent(f"""\
Expand All @@ -454,8 +456,8 @@ def do_bump_version():
# CHANGES.rst
update_file(
"CHANGES.rst",
r"(?m)^\.\. _changes_",
f"{UNRELEASED}\n\nNothing yet.\n\n\n.. _changes_",
re.escape(SCRIV_START),
f"{UNRELEASED}\n\nNothing yet.\n\n\n" + SCRIV_START,
)

# coverage/version.py
Expand Down

0 comments on commit ff127f8

Please sign in to comment.