Skip to content

Commit

Permalink
Replaced PyPI comments in CHANGES.rst with a regex
Browse files Browse the repository at this point in the history
This avoids having to move the comments in `CHANGES.rst` *every* time
we're preparing a new release.
  • Loading branch information
ddabble committed May 29, 2024
1 parent 695b17f commit 1fe70ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 0 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ Unreleased
----------


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

Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ core-metadata-version = "2.2"

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

[tool.black]
Expand Down

0 comments on commit 1fe70ab

Please sign in to comment.