From 6b22e811acef4f9b9a4447d12c5dbf9d1f5f2195 Mon Sep 17 00:00:00 2001 From: Julian Dehm Date: Mon, 1 Jul 2024 10:16:51 +0200 Subject: [PATCH] release v2407.1 --- CHANGELOG.md | 29 +++++++++++++++++ changelog/parse_changelogs.py | 59 +++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100755 changelog/parse_changelogs.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 74de04f0..8a7ddccb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,35 @@ All notable changes to this project will be documented in this file. Since version v2306 the format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), This project (not yet) adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v2407.1 + +### + +- script top automatically create changelog from files in the changelog folder + +### Changed + +- update django rest to 3.15.1 to avoid bigger versions coming from wagtail and incompatible with django 3.2 +- update wagtail to 5.2.5 +- add wagtail hook to make richtext toolbar sticky by default +- webpack: don't output entrypoints as library, we don't need it and it will + just print errors on the console +- Django from 3.2.20 to 4.0 + - `re_path` with `path` for included urls. +- Django from 4.0 to 4.2 + - production settings for storage + - from psycopg2 to psycopg3 +- sentry to 2.3.1 + +### Fixed + +- fix calendar not shown because Flatpickr constructor changed + +### Removed + + - `USE_L10N` in settings as it is now True by default +- deprecated stylelint rules (15.x) + ## v2306 - 2023-06-27 ### Added diff --git a/changelog/parse_changelogs.py b/changelog/parse_changelogs.py new file mode 100755 index 00000000..564489a2 --- /dev/null +++ b/changelog/parse_changelogs.py @@ -0,0 +1,59 @@ +#!/bin/python3 + +import logging +import os +import re +from collections import OrderedDict + +logger = logging.getLogger(__name__) + + +def combine_sections_in_folder(folder_path): + """Parser for changelog files following the https://keepachangelog.com + format. + """ + allowed_section_headers = [ + "Added", + "Changed", + "Deprecated", + "Removed", + "Fixed", + "Security", + ] + sections = OrderedDict() + + for filename in os.listdir(folder_path): + if filename.endswith(".md") and filename != "README.md": + filepath = os.path.join(folder_path, filename) + with open(filepath, "r") as file: + current_section = None + for line in file: + # find all headings starting with # (they should always + # start with ### but we seem to sometimes use # or ##) + match = re.match(r"^#+ (.*)", line) + if match: + section_header = match.group(1).strip().capitalize() + if section_header not in allowed_section_headers: + logger.warning( + f"warning: section_header {section_header} " + f"in file {filename} is invalid, " + "see https://keepachangelog.com for a list of " + "allowed types." + ) + current_section = sections.get(section_header, []) + elif current_section is not None and line.strip(): + current_section.append(line) + sections[section_header] = current_section + + combined_md = "" + for section_header, lines in sections.items(): + combined_md += "### " + section_header + "\n\n" + combined_md += "".join(lines) + "\n" + + return combined_md + + +if __name__ == "__main__": + folder_path = "." + combined_md = combine_sections_in_folder(folder_path) + print(combined_md)