Skip to content

Commit

Permalink
build: update python-semantic-release pin (#463)
Browse files Browse the repository at this point in the history
This change is an update to the one made in #454. Since then, the
`python-semantic-release` (PSR) dependency has responded to their
breaking change by re-defining the `context` variable for release notes
templates. However, they also say that the variable was not meant to be
exposed in the first place and that it will be removed again in the next
major version release. Therefore, the pin has been changed to a
caret-style one to allow for getting future releases that are at least
v9.8.7 but less than v10.

Discussions with the maintainer are ongoing, to request the features
relied upon with the current implementation are accounted for in the
next major version release.

References:
* python-semantic-release/python-semantic-release#1005
* python-semantic-release/python-semantic-release#984

Additionally, the release notes template was refactored a tiny bit to
account for new methods of doing the same thing, but with less code. The
changes were tested locally and found to produce the same output as the
previous template.
  • Loading branch information
maxrake authored Aug 21, 2024
1 parent 323ccdb commit 1c14f1a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
14 changes: 7 additions & 7 deletions poetry.lock

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

8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ optional = true
[tool.poetry.group.ci.dependencies]
tox-gh-actions = "*"
pytest-github-actions-annotate-failures = "*"
# TODO: Remove pin when PSR defines the `context` variable in release notes templates:
# https://github.com/python-semantic-release/python-semantic-release/issues/984
python-semantic-release = "9.8.3"
# 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.
# 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"
rich-codex = "*"

[tool.poetry.group.qa]
Expand Down
4 changes: 2 additions & 2 deletions templates/.release_notes.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
Ref: https://python-semantic-release.readthedocs.io/en/latest/changelog_templates.html
#}
{% set releases = context.history.released.items() | list %}
{% set prev_version = "v{}".format(releases[1][0]) %}
{% set prev_version = releases[1][0].as_tag() %}
{% include ".changes.j2" %}
**Full Changelog**: {{ prev_version | compare_url("v{}".format(version)) }}
**Full Changelog**: {{ prev_version | compare_url(version.as_tag()) }}

0 comments on commit 1c14f1a

Please sign in to comment.