Skip to content

Commit 1fe70ab

Browse files
committed
Replaced PyPI comments in CHANGES.rst with a regex
This avoids having to move the comments in `CHANGES.rst` *every* time we're preparing a new release.
1 parent 695b17f commit 1fe70ab

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGES.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ Unreleased
55
----------
66

77

8-
.. DEV: Move these comments just below the "Unreleased" section when preparing a new release!
9-
.. Start of PyPI readme
10-
118
3.7.0 (2024-05-29)
129
------------------
1310

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,14 @@ core-metadata-version = "2.2"
7070

7171
[tool.hatch.metadata.hooks.fancy-pypi-readme]
7272
content-type = "text/x-rst"
73+
# (Preview the generated readme by installing `hatch` and running
74+
# `hatch project metadata readme` - see
75+
# https://github.com/hynek/hatch-fancy-pypi-readme/blob/24.1.0/README.md#cli-interface)
7376
fragments = [
7477
{ path = "README.rst", start-after = ".. Start of PyPI readme\n\n" },
7578
{ text = "\n====\n\nChangelog\n=========\n\n" },
76-
{ path = "CHANGES.rst", start-after = ".. Start of PyPI readme\n\n" },
79+
# Only include the first title after "Unreleased" - as well as the rest of the file
80+
{ path = "CHANGES.rst", pattern = "\nUnreleased\n-{4,}\n(?:.*?)\n([^\n]+\n-{4,}\n.*)" },
7781
]
7882

7983
[tool.black]

0 commit comments

Comments
 (0)