File: generate_github_changelog.py

package info (click to toggle)
sunpy 7.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,592 kB
  • sloc: python: 41,765; ansic: 1,710; makefile: 39
file content (10 lines) | stat: -rw-r--r-- 428 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
"""
Script to render to terminal, the changelog entry for the latest version in markdown so it can be copied and pasted for a GitHub release.

It requires pandoc to be installed on your system.
"""
import subprocess
from pathlib import Path

res = subprocess.run(['pandoc', '--wrap=none', '-t', 'gfm', str(Path(__file__).parent.parent / "CHANGELOG.rst")], capture_output=True)
print(res.stdout.decode('ascii').split('\n# ')[0])