From 3e1de72bcbbc808a100ae9090b2d9c7f069dbfd0 Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Tue, 18 Jan 2022 22:12:17 +0200 Subject: [PATCH] Setup release notes build using towncrier --- NEWS | 2 ++ tools/NEWS.template.jinja | 30 ++++++++++++++++++++++++++++++ towncrier.toml | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 tools/NEWS.template.jinja create mode 100644 towncrier.toml diff --git a/NEWS b/NEWS index 7a13ecdea..c711b09c3 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ semi-automatically. --> + + ## New with 1.0.32 (released 2021-02-14) ### Backends diff --git a/tools/NEWS.template.jinja b/tools/NEWS.template.jinja new file mode 100644 index 000000000..afb5c11e0 --- /dev/null +++ b/tools/NEWS.template.jinja @@ -0,0 +1,30 @@ +{% for section, _ in sections|dictsort(by='key') %} +{% set underline = "-" %} +{% if section %} +----- {{section}} + +{% endif %} +{% if sections[section] %} +{% for category, val in definitions|dictsort if category in sections[section]%} + +### {{ definitions[category]['name'] }} + +{% for text, values in sections[section][category]|dictsort(by='value') %} +- {{ text }} +{% endfor %} + +{% if sections[section][category]|length == 0 %} + +No significant changes. + + +{% else %} +{% endif %} +{% endfor %} +{% else %} + +No significant changes. + + +{% endif %} +{% endfor %} diff --git a/towncrier.toml b/towncrier.toml new file mode 100644 index 000000000..54ee6c422 --- /dev/null +++ b/towncrier.toml @@ -0,0 +1,34 @@ +[tool.towncrier] + package = "" + directory = "newsfragments" + filename = "NEWS" + template = "tools/NEWS.template.jinja" + title_format = "\n## New with {version} (released {project_date})\n" + start_string = "" + [[tool.towncrier.section]] + path = "" + + [[tool.towncrier.type]] + directory = "security" + name = "Security fixes" + showcontent = false + + [[tool.towncrier.type]] + directory = "backend" + name = "Backends" + showcontent = true + + [[tool.towncrier.type]] + directory = "frontend" + name = "Frontends" + showcontent = true + + [[tool.towncrier.type]] + directory = "removal" + name = "Deprecations and removals" + showcontent = true + + [[tool.towncrier.type]] + directory = "misc" + name = "Miscellaneous" + showcontent = true