• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

geigerzaehler / beets-alternatives / 17698958271

13 Sep 2025 04:11PM UTC coverage: 97.068% (-1.6%) from 98.665%
17698958271

push

github

geigerzaehler
Automate release publishing with workflows

66 of 67 branches covered (98.51%)

7 of 22 new or added lines in 1 file covered. (31.82%)

894 of 921 relevant lines covered (97.07%)

0.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

31.82
/dev/get_release_notes.py
1
#!/usr/bin/env python
2

3
# /// script
4
# dependencies = ["tomli"]
5
# ///
6

7

8
import re
1✔
9
from itertools import dropwhile, takewhile
1✔
10
from pathlib import Path
1✔
11

12
import tomli
1✔
13

14

15
def _validate_heading_format(heading: str, version: str):
1✔
NEW
16
    pattern = rf"^## v{re.escape(version)} - \d{{4}}-\d{{2}}-\d{{2}}$"
×
NEW
17
    if not re.match(pattern, heading.strip()):
×
NEW
18
        raise ValueError(
×
19
            "Invalid heading format in CHANGELOG.md\n"
20
            f"Actual: {heading.strip()}\n"
21
            f"Expected ## v{version} - YYYY-MM-DD"
22
        )
23

24

25
def _get_release_notes():
1✔
NEW
26
    with Path("pyproject.toml").open("rb") as f:
×
NEW
27
        data = tomli.load(f)
×
NEW
28
        version = data["tool"]["poetry"]["version"]
×
NEW
29
    release_notes = []
×
30

NEW
31
    with Path("CHANGELOG.md").open() as lines:
×
NEW
32
        lines = dropwhile(lambda line: not line.startswith("## "), lines)
×
NEW
33
        heading = next(lines)
×
NEW
34
        _validate_heading_format(heading, version)
×
NEW
35
        assert next(lines) == "\n", "Expected empty line after release heading"
×
NEW
36
        release_notes = list(takewhile(lambda line: not line.startswith("## "), lines))
×
37

NEW
38
    return "".join(release_notes).rstrip()
×
39

40

41
if __name__ == "__main__":
1✔
NEW
42
    print(_get_release_notes())  # noqa: T201
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc