Skip to content

Commit e559da0

Browse files
committed
Test release workflow
1 parent 05144ee commit e559da0

2 files changed

Lines changed: 65 additions & 0 deletions

File tree

CHANGELOG.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
Changelog
22
=========
33

4+
0.1.10
5+
-----
6+
7+
This is techical release, to check a new releasing workflow.
8+
This release will be deleted after the test.
9+
10+
* Added support for Python 3.10 through 3.14
11+
* Removed support for Python versions older than 3.10
12+
* Updated versions: p4a v2026, Python 3.14, Android API 36
13+
* Replaced ``nest_asyncio`` usage in tests with ``nest-asyncio2``
14+
* Fixed PythonHere app asyncio lifecycle handling and task shutdown
15+
* Fixed SSH server exception logging
16+
* Avoided duplicate Kivy exception handlers and duplicate KV loading
17+
* Added an Android cryptography recipe workaround for linking failures
18+
* Removed the legacy ``mididriver`` recipe
19+
420
0.1.5
521
-----
622

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env python3
2+
"""Extract one version section from CHANGELOG.rst."""
3+
4+
from __future__ import annotations
5+
6+
import argparse
7+
import re
8+
from pathlib import Path
9+
10+
11+
def extract_section(changelog: str, version: str) -> str:
12+
pattern = re.compile(
13+
rf"^{re.escape(version)}\n[-=~^`:#\"']+\n(?P<body>.*?)(?=\n[0-9]+[.][0-9]+[.][0-9]+\n[-=~^`:#\"']+\n|\Z)",
14+
re.MULTILINE | re.DOTALL,
15+
)
16+
match = pattern.search(changelog)
17+
if match is None:
18+
raise SystemExit(f"CHANGELOG.rst does not contain a section for {version}")
19+
20+
body = match.group("body").strip()
21+
if not body:
22+
raise SystemExit(f"CHANGELOG.rst section for {version} is empty")
23+
24+
return body + "\n"
25+
26+
27+
def main() -> None:
28+
parser = argparse.ArgumentParser()
29+
parser.add_argument("version")
30+
parser.add_argument(
31+
"--changelog",
32+
default="CHANGELOG.rst",
33+
type=Path,
34+
help="Path to the RST changelog",
35+
)
36+
parser.add_argument(
37+
"--output",
38+
default="release-notes.rst",
39+
type=Path,
40+
help="Path to write the extracted release notes",
41+
)
42+
args = parser.parse_args()
43+
44+
changelog = args.changelog.read_text(encoding="utf-8")
45+
args.output.write_text(extract_section(changelog, args.version), encoding="utf-8")
46+
47+
48+
if __name__ == "__main__":
49+
main()

0 commit comments

Comments
 (0)