Skip to content

Commit

Permalink
build: account for Python Semantic Release update (#490)
Browse files Browse the repository at this point in the history
Python Semantic Release (PSR) released another minor version today and
it ended up having breaking changes. This time, the v9.12.0 release of
PSR included this commit, which changed another long name of the `fix`
type of angular commit as it is referred to in a parsed release element:

python-semantic-release/python-semantic-release@09e3a4d

The effect would have been that, going forward, `fix` commits would not
have been picked up for inclusion. The update was accounted for in
`templates/.changes.j2`. At the same time, the section headings were
changed to title case so that all the words would be capitalized instead
of just the first word (e.g., `Bug Fixes` vs. `Bug fixes`).

These breaking changes have become a regular occurence so the dependency
was pinned to an explicit version. This will prevent more breaking
changes during the weekly automated dependency bump.
  • Loading branch information
maxrake authored Nov 1, 2024
1 parent a218e73 commit b6fa901
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,15 @@ optional = true
[tool.poetry.group.ci.dependencies]
tox-gh-actions = "*"
pytest-github-actions-annotate-failures = "*"
# PSR has a history of releasing breaking changes in minor and bugfix releases.
# The irony is not lost, but it has become too much. This dependency has a hard
# pin now so that every new release can be examined before it is used. Some notes:
#
# PSR re-defined the `context` variable in release notes templates in v9.8.7, but
# expects to remove it again in the next major version. Pin to prevent that upgrade.
# expects to remove it again in the next major version.
# https://github.com/python-semantic-release/python-semantic-release/pull/1005
# https://github.com/python-semantic-release/python-semantic-release/issues/984
python-semantic-release = "^9.8.7"
python-semantic-release = "==9.12.0"
rich-codex = "*"

[tool.poetry.group.qa]
Expand Down
4 changes: 2 additions & 2 deletions templates/.changes.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% set included_commit_types = ("breaking", "features", "fixes", "performance improvements", "documentation") %}
{% set included_commit_types = ("breaking", "features", "bug fixes", "performance improvements", "documentation") %}

{% for commit_type in included_commit_types if commit_type in release.elements %}
### {{ commit_type | capitalize }}
### {{ commit_type | title }}

{% for commit in release.elements[commit_type] %}
{% set commit_summary = commit.descriptions[0].rstrip().capitalize() %}
Expand Down

0 comments on commit b6fa901

Please sign in to comment.