def update_release_notes(version: str) -> None:
- p = pathlib.Path(__file__).parent.parent / 'docs' / 'relnotes.rst'
+ p = pathlib.Path('docs') / 'relnotes.rst'
with open(p, 'r') as f:
relnotes = f.readlines()
new_relnotes = []
first_list = True
+ second_list = True
for line in relnotes:
if first_list and line.startswith('-'):
first_list = False
- new_relnotes.append(f'- `{version} release notes <relnotes/{version}.rst>`__\n')
+ new_relnotes.append(f'- :doc:`{version} release notes <relnotes/{version}>`\n')
+ if not first_list and second_list and line.startswith(' relnotes/'):
+ second_list = False
+ new_relnotes.append(f' relnotes/{version}\n')
new_relnotes.append(line)
with open(p, 'w') as f:
def update_calendar(version: str) -> None:
- p = pathlib.Path(__file__).parent.parent / 'docs' / 'release-calendar.rst'
+ p = pathlib.Path('docs') / 'release-calendar.rst'
with open(p, 'r') as f:
calendar = f.readlines()
update_calendar(args.version)
done = 'update calendar'
- if not is_release_candidate(args.version):
- update_index(args.version)
+ if 'rc' not in args.version:
update_release_notes(args.version)
- done += ', add news item, and link releases notes'
+ done += ' and link releases notes'
subprocess.run(['git', 'commit', '-m',
f'docs: {done} for {args.version}'])