File: format_GH_release_notes.py

package info (click to toggle)
silx 2.2.1%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 31,696 kB
  • sloc: python: 119,829; ansic: 5,062; lisp: 4,454; cpp: 883; sh: 286; makefile: 90; xml: 46
file content (16 lines) | stat: -rw-r--r-- 502 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
""" Fix the format of GitHub-generated release notes. """

import os.path
import re

root_dir = os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))

with open(os.path.join(root_dir, 'CHANGELOG.rst'), 'r') as f:
    content = f.read().split('/n')


with open(os.path.join(root_dir,'CHANGELOG_new.rst'), 'w') as f:
    for line in content:
        new_line = re.sub(r'by @.+ in https://github\.com/silx-kit/silx/pull/(\d+)', r'(PR #\1)', line)
        f.write(new_line)
        f.write('\n')