Skip to content

Commit 920d83e

Browse files
Secrusneersighted
authored andcommitted
Add towncrier config
1 parent 39bd8a9 commit 920d83e

File tree

6 files changed

+166
-5
lines changed

6 files changed

+166
-5
lines changed

.github/workflows/news.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Check news file
2+
3+
on:
4+
pull_request:
5+
types: [labeled, unlabeled, opened, reopened, synchronize]
6+
7+
jobs:
8+
check-news-entry:
9+
name: news entry
10+
runs-on: ubuntu-20.04
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
# `towncrier check` runs `git diff --name-only origin/main...`, which
16+
# needs a non-shallow clone.
17+
fetch-depth: 0
18+
19+
- name: Check news entry
20+
if: "!contains(github.event.pull_request.labels.*.name, 'skip news')"
21+
run: |
22+
pipx run towncrier check --compare-with origin/${{ github.base_ref }}

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Changelog
22

3+
<!-- news notes entrypoint -->
4+
35
## [2.0.1] - 2022-11-23
46

57
- Relax `poetry-core` requirement for PEP 517 builds ([#291](https://github.com/python-poetry/cleo/pull/291)).

news/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!.gitignore

news/news_template.jinja2

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{% if top_line %}
2+
{{ top_line }}
3+
{{ top_underline * ((top_line)|length)}}
4+
{% endif %}
5+
{% for section in sections %}
6+
{% if sections[section] %}
7+
{% for category, val in definitions.items() if category in sections[section] and category != 'trivial' %}
8+
9+
### {{ definitions[category]['name'] }}
10+
11+
{% if definitions[category]['showcontent'] %}
12+
{% for text, values in sections[section][category]|dictsort(by='value') %}
13+
- {{ text }} {% if category != 'process' %}{{ values|sort|join(',\n ') }}{% endif %}
14+
{% endfor %}
15+
{% else %}
16+
- {{ sections[section][category]['']|sort|join(', ') }}
17+
{% endif %}
18+
{% if sections[section][category]|length == 0 %}
19+
20+
No significant changes.
21+
{% else %}
22+
{% endif %}
23+
{% endfor %}
24+
{% else %}
25+
26+
No significant changes.
27+
{% endif %}
28+
{% endfor %}

poetry.lock

Lines changed: 71 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[build-system]
2+
requires = ["poetry-core>=1.1.0"]
3+
build-backend = "poetry.core.masonry.api"
4+
15
[tool.poetry]
26
name = "cleo"
37
version = "2.1.0.dev0"
@@ -41,6 +45,7 @@ pytest-mock = "^3.8.2"
4145
pre-commit = "^2.20.0"
4246
pytest-cov = "^3.0.0"
4347
mypy = "^0.990"
48+
towncrier = ">=22.12.0"
4449

4550
[tool.poetry.group.doc.dependencies]
4651
Sphinx = "^5.2.3"
@@ -100,6 +105,40 @@ exclude_lines = [
100105
"raise NotImplementedError"
101106
]
102107

103-
[build-system]
104-
requires = ["poetry-core>=1.1.0"]
105-
build-backend = "poetry.core.masonry.api"
108+
[tool.towncrier]
109+
package = "cleo"
110+
filename = "CHANGELOG.md"
111+
issue_format = "([#{issue}](https://github.com/python-poetry/cleo/pull/{issue}))"
112+
directory = "news/"
113+
title_format = "{version} ({project_date})"
114+
template = "news/news_template.jinja2"
115+
underlines = "-~^"
116+
start_string = "<!-- news notes entrypoint -->\n"
117+
118+
[tool.towncrier.fragment.break]
119+
name = "Breaking Changes"
120+
showcontent = true
121+
122+
[tool.towncrier.fragment.feat]
123+
name = "Features & Improvements"
124+
showcontent = true
125+
126+
[tool.towncrier.fragment.bugfix]
127+
name = "Bug Fixes"
128+
showcontent = true
129+
130+
[tool.towncrier.fragment.docs]
131+
name = "Documentation"
132+
showcontent = true
133+
134+
[tool.towncrier.fragment.deps]
135+
name = "Dependencies"
136+
showcontent = true
137+
138+
[tool.towncrier.fragment.removal]
139+
name = "Removals and Deprecations"
140+
showcontent = true
141+
142+
[tool.towncrier.fragment.misc]
143+
name = "Miscellaneous"
144+
showcontent = true

0 commit comments

Comments
 (0)