Skip to content
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

use towncrier to generate CHANGELOG #2607

Merged
merged 1 commit into from
Sep 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Thank you for contributing to pyo3!

Please consider adding the following to your pull request:
- an entry in CHANGELOG.md
- an entry for this PR in newsfragments - see [https://pyo3.rs/main/contributing.html#documenting-changes]
- docs to all new functions and / or detail in the guide
- tests for all new or changed functions

Expand Down
4 changes: 4 additions & 0 deletions .netlify/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ else
echo "<meta http-equiv=refresh content=0;url=v${PYO3_VERSION}/>" > netlify_build/index.html
fi

## Generate towncrier release notes

pip install towncrier
towncrier build --yes --version Unreleased --date TBC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When doing a new release, do we need to update this version argument?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think not for the Netlify build which will always contain the latest not-yet-released changes.

We will however have to run towncrier build when creating a release which will remove the news fragments from version control after having merged their contents into the changelog.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, the release step to update the real CHANGELOG is manual.

I'm going to take a moment in the next week or two to make some notes on how to do releases, even though I hope to continue to be doing them for the foreseeable future!


## Build guide

Expand Down
14 changes: 14 additions & 0 deletions .towncrier.template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% for section_text, section in sections.items() %}{%- if section %}{{section_text}}{% endif -%}
{% if section %}
{% for category in ['packaging', 'added', 'changed', 'removed', 'fixed' ] if category in section %}
### {{ definitions[category]['name'] }}

{% if definitions[category]['showcontent'] %}
{% for text, pull_requests in section[category].items() %}
- {{ text }} {{ pull_requests|join(', ') }}
{% endfor %}
{% else %}
- {{ section[category]['']|join(', ') }}
{% endif %}

{% endfor %}{% else %}No significant changes.{% endif %}{% endfor %}
10 changes: 1 addition & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@ PyO3 versions, please see the [migration guide](https://pyo3.rs/latest/migration
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Added `type_input()` and `type_output()` to get the Python type of any Python-compatible object. [#2490](https://github.com/PyO3/pyo3/pull/2490)

### Removed

- Remove the deprecated `pyproto` feature, `#[pyproto]` macro, and all accompanying APIs. [#2587](https://github.com/PyO3/pyo3/pull/2587)
<!-- towncrier release notes start -->

## [0.17.1] - 2022-08-28

Expand Down
11 changes: 11 additions & 0 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ You can run these tests yourself with
```cargo xtask ci```
See [its documentation](https://github.com/PyO3/pyo3/tree/main/xtask#readme) for more commands you can run.

### Documenting changes

We use [towncrier](https://towncrier.readthedocs.io/en/stable/index.html) to generate a CHANGELOG for each release.

To include your changes in the release notes, you should create one (or more) news items in the `newsfragments` directory. Valid news items should be saved as `<PR>.<CATEGORY>.md` where `<PR>` is the pull request number and `<CATEGORY>` is one of the following:
- `packaging` - for dependency changes and Python / Rust version compatibility changes
- `added` - for new features
- `changed` - for features which already existed but have been altered or deprecated
- `removed` - for features which have been removed
- `fixed` - for "changed" features which were classed as a bugfix

## Python and Rust version support policy

PyO3 aims to keep sufficient compatibility to make packaging Python extensions built with PyO3 feasible on most common package managers.
Expand Down
Empty file added newsfragments/.gitignore
Empty file.
1 change: 1 addition & 0 deletions newsfragments/2490.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added `type_input()` and `type_output()` to get the Python type of any Python-compatible object.
1 change: 1 addition & 0 deletions newsfragments/2587.removed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove the deprecated `pyproto` feature, `#[pyproto]` macro, and all accompanying APIs.
24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,27 @@ exclude = '''
)/
)
'''

[tool.towncrier]
filename = "CHANGELOG.md"
version = "0.17.1"
start_string = "<!-- towncrier release notes start -->\n"
template = ".towncrier.template.md"
title_format = "## [{version}] - {project_date}"
issue_format = "[#{issue}](https://github.com/PyO3/pyo3/pull/{issue})" # Note PyO3 shows pulls, not issues, in the CHANGELOG
underlines = ["", "", ""]

[tool.towncrier.fragment.packaging]
name = "Packaging"

[tool.towncrier.fragment.added]
name = "Added"

[tool.towncrier.fragment.changed]
name = "Changed"

[tool.towncrier.fragment.removed]
name = "Removed"

[tool.towncrier.fragment.fixed]
name = "Fixed"