From 726bbf303208dfad9b644eb796854b0986f26ee2 Mon Sep 17 00:00:00 2001
From: Eliot Berriot <contact@eliotberriot.com>
Date: Tue, 27 Feb 2018 19:04:50 +0100
Subject: [PATCH] Now use towncrier for changelog management

---
 CHANGELOG                                     |  6 +---
 changes/__init__.py                           |  0
 changes/changelog.d/89.bugfix                 |  1 +
 changes/changelog.d/changelog.misc            |  1 +
 changes/changelog.d/transaction-import.bugfix |  1 +
 changes/template.rst                          | 27 +++++++++++++++
 pyproject.toml                                | 33 +++++++++++++++++++
 7 files changed, 64 insertions(+), 5 deletions(-)
 create mode 100644 changes/__init__.py
 create mode 100644 changes/changelog.d/89.bugfix
 create mode 100644 changes/changelog.d/changelog.misc
 create mode 100644 changes/changelog.d/transaction-import.bugfix
 create mode 100644 changes/template.rst
 create mode 100644 pyproject.toml

diff --git a/CHANGELOG b/CHANGELOG
index 7c1215ee..4ce156e0 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,11 +1,7 @@
 Changelog
 =========
 
-0.6 (Unreleased)
-----------------
-
-- Always use username in sidebar (#89)
-- Fixed broken import because of missing transaction
+.. towncrier
 
 
 0.5.2 (2018-02-26)
diff --git a/changes/__init__.py b/changes/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/changes/changelog.d/89.bugfix b/changes/changelog.d/89.bugfix
new file mode 100644
index 00000000..5338e87d
--- /dev/null
+++ b/changes/changelog.d/89.bugfix
@@ -0,0 +1 @@
+Always use username in sidebar (#89)
diff --git a/changes/changelog.d/changelog.misc b/changes/changelog.d/changelog.misc
new file mode 100644
index 00000000..46516abc
--- /dev/null
+++ b/changes/changelog.d/changelog.misc
@@ -0,0 +1 @@
+Switched to towncrier for changelog management and compilation
diff --git a/changes/changelog.d/transaction-import.bugfix b/changes/changelog.d/transaction-import.bugfix
new file mode 100644
index 00000000..0efe3f00
--- /dev/null
+++ b/changes/changelog.d/transaction-import.bugfix
@@ -0,0 +1 @@
+Fixed broken import because of missing transaction
diff --git a/changes/template.rst b/changes/template.rst
new file mode 100644
index 00000000..f4d94dee
--- /dev/null
+++ b/changes/template.rst
@@ -0,0 +1,27 @@
+{% for section, _ in sections.items() %}
+{% if sections[section] %}
+{% for category, val in definitions.items() if category in sections[section]%}
+{{ definitions[category]['name'] }}:
+
+{% if definitions[category]['showcontent'] %}
+{% for text in sections[section][category].keys()|sort() %}
+- {{ text }}
+{% endfor %}
+
+{% else %}
+- {{ sections[section][category]['']|join(', ') }}
+
+{% endif %}
+{% if sections[section][category]|length == 0 %}
+No significant changes.
+
+{% else %}
+{% endif %}
+
+{% endfor %}
+{% else %}
+No significant changes.
+
+
+{% endif %}
+{% endfor %}
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 00000000..baea1686
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,33 @@
+[tool.towncrier]
+    package = "changes"
+    package_dir = ""
+    filename = "CHANGELOG"
+    directory = "changes/changelog.d/"
+    start_string = ".. towncrier\n"
+    template = "changes/template.rst"
+    issue_format = ""
+    title_format = "{version} (unreleased)"
+    underlines = "-"
+
+    [[tool.towncrier.section]]
+        path = ""
+
+    [[tool.towncrier.type]]
+        directory = "feature"
+        name = "Features"
+        showcontent = true
+
+    [[tool.towncrier.type]]
+        directory = "bugfix"
+        name = "Bugfixes"
+        showcontent = true
+
+    [[tool.towncrier.type]]
+        directory = "doc"
+        name = "Documentation"
+        showcontent = true
+
+    [[tool.towncrier.type]]
+        directory = "misc"
+        name = "Other"
+        showcontent = true
-- 
GitLab