-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add towncrier #618
Merged
Merged
Add towncrier #618
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
|
||
|
||
__api_version__ = '1.0' | ||
__version__ = '0.13.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
Release Notes | ||
============= | ||
|
||
.. towncrier release notes start | ||
|
||
v0.13.1 | ||
======= | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{% macro issue_url(value) -%} | ||
{%- if value.startswith("PR") -%} | ||
`PR#{{ value[2:] }} <https://github.com/fedora-infra/fedora-messaging/pull/{{ value[2:] }}>`_ | ||
{%- elif value.startswith("C") -%} | ||
`{{ value[1:] }} <https://github.com/fedora-infra/fedora-messaging/commit/{{ value[1:] }}>`_ | ||
{%- else -%} | ||
`#{{ value }} <https://github.com/fedora-infra/fedora-messaging/issues/{{ value }}>`_ | ||
{%- endif -%} | ||
{%- endmacro -%} | ||
|
||
{% for section, _ in sections.items() %} | ||
{% set underline = underlines[0] %}{% if section %}{{section}} | ||
{{ underline * section|length }}{% set underline = underlines[1] %} | ||
|
||
{% endif %} | ||
|
||
{% if sections[section] %} | ||
{% for category, val in definitions.items() if category in sections[section] and category != "author" %} | ||
{{ definitions[category]['name'] }} | ||
{{ underline * definitions[category]['name']|length }} | ||
|
||
{% if definitions[category]['showcontent'] %} | ||
{% for text, values in sections[section][category].items() %} | ||
* {{ text }} | ||
({% for value in values -%} | ||
{{ issue_url(value) }} | ||
{%- if not loop.last %}, {% endif -%} | ||
{%- endfor %}) | ||
|
||
{% endfor %} | ||
{% else %} | ||
* {{ sections[section][category]['']|sort|join(', ') }} | ||
|
||
{% endif %} | ||
{% if sections[section][category]|length == 0 %} | ||
No significant changes. | ||
|
||
{% else %} | ||
{% endif %} | ||
|
||
{% endfor %} | ||
{% if sections[section]["author"] %} | ||
{{definitions['author']["name"]}} | ||
{{ underline * definitions['author']['name']|length }} | ||
Many thanks to the contributors of bug reports, pull requests, and pull request | ||
reviews for this release: | ||
|
||
{% for text, values in sections[section]["author"].items() %} | ||
* {{ text }} | ||
{% endfor %} | ||
{% endif %} | ||
|
||
{% else %} | ||
No significant changes. | ||
|
||
|
||
{% endif %} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env python3 | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't see a general Copyright claim on Anitya - I also recommend adding a copyright claim on this file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. |
||
""" | ||
This script is browsing through git commit history (starting at latest tag), | ||
collects all authors of commits and creates fragment for `towncrier`_ python module. | ||
|
||
It's meant to be run before creating a final documentation before new release. | ||
|
||
Example: | ||
$ python get_authors.py | ||
|
||
.. _towncrier: | ||
https://github.com/hawkowl/towncrier | ||
|
||
(c) 2018 - Copyright Red Hat Inc | ||
|
||
Authors: | ||
Aurelien Bompard | ||
Michal Konecny | ||
""" | ||
|
||
|
||
from subprocess import check_output | ||
|
||
last_tag = check_output(["git", "describe", "--abbrev=0"], universal_newlines=True) | ||
authors = {} | ||
log_range = last_tag.strip() + "..HEAD" | ||
output = check_output(["git", "log", log_range, "--format=%ae\t%an"], universal_newlines=True) | ||
for line in output.splitlines(): | ||
email, fullname = line.split("\t") | ||
email = email.split("@")[0].replace(".", "") | ||
if email in authors: | ||
continue | ||
authors[email] = fullname | ||
|
||
for nick, fullname in authors.items(): | ||
with open("{}.author".format(nick), "w") as f: | ||
f.write(fullname) | ||
f.write("\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Michal Konečný |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[tool.towncrier] | ||
package = "anitya" | ||
filename = "docs/release_notes.rst" | ||
directory = "news/" | ||
title_format = "{version} ({project_date})" | ||
issue_format = "{issue}" | ||
template = "news/_template.rst" | ||
|
||
[[tool.towncrier.type]] | ||
directory = "api" | ||
name = "API Changes" | ||
showcontent = true | ||
|
||
[[tool.towncrier.type]] | ||
directory = "feature" | ||
name = "Features" | ||
showcontent = true | ||
|
||
[[tool.towncrier.type]] | ||
directory = "bug" | ||
name = "Bug Fixes" | ||
showcontent = true | ||
|
||
[[tool.towncrier.type]] | ||
directory = "dev" | ||
name = "Development Changes" | ||
showcontent = true | ||
|
||
[[tool.towncrier.type]] | ||
directory = "other" | ||
name = "Other Changes" | ||
showcontent = true | ||
|
||
[[tool.towncrier.type]] | ||
directory = "author" | ||
name = "Contributors" | ||
showcontent = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ sqlalchemy_schemadisplay | |
straight.plugin | ||
pytoml | ||
wtforms | ||
towncrier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend adding a docblock that explains the purpose of this script and any args it accepts (if any).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the code is copied from fedora-infra/fedora-messaging#67.
But I will add it, so this is more readable.