Skip to content

Commit

Permalink
Adopt towncrier for changelog management (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Apr 23, 2020
1 parent 9c84e6f commit ef7bf0c
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 1 deletion.
15 changes: 15 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
Changelog
=========

<!--
You should *NOT* be adding new change log entries to this file, this
file is managed by towncrier. You *may* edit previous change logs to
fix problems like typo corrections or such.
To add a new change log entry, please refer
https://pip.pypa.io/en/latest/development/contributing/#news-entries
We named the news folder "changes".
WARNING: Don't drop the last line!
-->

.. towncrier release notes start

0.9.1 (2020-02-25)
------------------

Expand Down
1 change: 1 addition & 0 deletions changes/15.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adopt towncrier for changelog management
38 changes: 38 additions & 0 deletions changes/template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{%- for section, _ in sections.items() -%}
{%- if section %}
## {{ section }}
{%- endif -%}
{%- if sections[section] -%}
{%- for category, val in definitions.items() if category in sections[section] %}


### {{ definitions[category]['name'] }}

{%- if definitions[category]['showcontent'] %}
{%- for text, values in sections[section][category].items() %}
{%- if values[0].endswith("/0)") %}

* {{ definitions[category]['name'] }} without explicit PR/issue numbers
{{ text }}
{%- else %}

* {{ text }} {{ values|join(',\n ') }}
{%- endif %}

{%- 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 %}
38 changes: 38 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[tool.towncrier]
package = "aiotools"
filename = "CHANGELOG.md"
directory = "changes/"
title_format = "{version} ({project_date})"
template = "changes/template.md"
issue_format = "([#{issue}](https://github.com/achimnol/aiotools/issues/{issue}))"
underlines = ["-", "", ""]

[[tool.towncrier.type]]
directory = "breaking"
name = "Breaking Changes"
showcontent = true

[[tool.towncrier.type]]
directory = "feature"
name = "Features"
showcontent = true

[[tool.towncrier.type]]
directory = "deprecation"
name = "Deprecations"
showcontent = true

[[tool.towncrier.type]]
directory = "fix"
name = "Fixes"
showcontent = true

[[tool.towncrier.type]]
directory = "doc"
name = "Documentation Changes"
showcontent = true

[[tool.towncrier.type]]
directory = "misc"
name = "Miscellaneous"
showcontent = true
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ include_package_data = true
[options.extras_require]
build =
setuptools>=45.0.0
wheel>=0.33.6
wheel>=0.34.2
twine>=3.1.0
towncrier~=19.2.0
test =
pytest~=5.4.1
pytest-asyncio~=0.11.0
Expand Down

0 comments on commit ef7bf0c

Please sign in to comment.