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

geigerzaehler / beets-alternatives / 18444671654

12 Oct 2025 01:32PM UTC coverage: 96.739%. Remained the same
18444671654

push

github

geigerzaehler
Switch to `uv` and PEP621 dependencies

65 of 67 branches covered (97.01%)

0 of 1 new or added line in 1 file covered. (0.0%)

890 of 920 relevant lines covered (96.74%)

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✔
16
    pattern = rf"^## v{re.escape(version)} - \d{{4}}-\d{{2}}-\d{{2}}$"
×
17
    if not re.match(pattern, heading.strip()):
×
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✔
26
    with Path("pyproject.toml").open("rb") as f:
×
27
        data = tomli.load(f)
×
NEW
28
        version = data["project"]["version"]
×
29
    release_notes = []
×
30

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

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

40

41
if __name__ == "__main__":
1✔
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