python-semantic-release 9.10.0__tar.gz → 9.11.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_semantic_release-9.10.0/python_semantic_release.egg-info → python_semantic_release-9.11.0}/PKG-INFO +1 -1
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/automatic-releases/github-actions.rst +5 -5
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/changelog_templates.rst +120 -2
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/configuration.rst +62 -5
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/pyproject.toml +1 -1
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0/python_semantic_release.egg-info}/PKG-INFO +1 -1
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/python_semantic_release.egg-info/SOURCES.txt +16 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/__init__.py +1 -1
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/changelog/context.py +25 -1
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/cli/config.py +99 -8
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/data/templates/angular/md/.changelog_update.md.j2 +1 -1
- python_semantic_release-9.11.0/semantic_release/data/templates/angular/rst/.changelog_header.rst.j2 +13 -0
- python_semantic_release-9.11.0/semantic_release/data/templates/angular/rst/.changelog_init.rst.j2 +22 -0
- python_semantic_release-9.11.0/semantic_release/data/templates/angular/rst/.changelog_update.rst.j2 +62 -0
- python_semantic_release-9.11.0/semantic_release/data/templates/angular/rst/.changes.rst.j2 +36 -0
- python_semantic_release-9.11.0/semantic_release/data/templates/angular/rst/.macros.rst.j2 +16 -0
- python_semantic_release-9.11.0/semantic_release/data/templates/angular/rst/.unreleased_changes.rst.j2 +10 -0
- python_semantic_release-9.11.0/semantic_release/data/templates/angular/rst/.versioned_changes.rst.j2 +23 -0
- python_semantic_release-9.11.0/semantic_release/data/templates/angular/rst/CHANGELOG.rst.j2 +24 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/command_line/test_changelog.py +352 -96
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/command_line/test_version.py +183 -56
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/const.py +27 -3
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/fixtures/example_project.py +22 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/fixtures/git_repo.py +152 -39
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py +242 -67
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py +258 -71
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/fixtures/repos/github_flow/repo_w_release_channels.py +126 -41
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py +47 -21
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py +99 -34
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py +48 -18
- python_semantic_release-9.11.0/tests/scenario/test_release_history.py +289 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/cli/test_config.py +55 -0
- python_semantic_release-9.10.0/tests/scenario/test_release_history.py +0 -373
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/AUTHORS.rst +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/LICENSE +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/MANIFEST.in +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/README.rst +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/Makefile +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/algorithm.rst +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/automatic-releases/cronjobs.rst +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/automatic-releases/index.rst +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/automatic-releases/travis.rst +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/commands.rst +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/commit-parsing.rst +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/conf.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/contributing.rst +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/contributors.rst +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/index.rst +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/make.bat +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/migrating_from_v7.rst +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/multibranch_releases.rst +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/strict_mode.rst +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/troubleshooting.rst +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/python_semantic_release.egg-info/dependency_links.txt +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/python_semantic_release.egg-info/entry_points.txt +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/python_semantic_release.egg-info/requires.txt +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/python_semantic_release.egg-info/top_level.txt +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/__main__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/changelog/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/changelog/release_history.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/changelog/template.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/cli/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/cli/changelog_writer.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/cli/cli_context.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/cli/commands/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/cli/commands/changelog.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/cli/commands/generate_config.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/cli/commands/main.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/cli/commands/publish.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/cli/commands/version.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/cli/const.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/cli/github_actions_output.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/cli/masking_filter.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/cli/util.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/commit_parser/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/commit_parser/_base.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/commit_parser/angular.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/commit_parser/emoji.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/commit_parser/scipy.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/commit_parser/tag.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/commit_parser/token.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/commit_parser/util.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/const.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/data/templates/angular/md/.changelog_header.md.j2 +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/data/templates/angular/md/.changelog_init.md.j2 +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/data/templates/angular/md/.changes.md.j2 +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/data/templates/angular/md/.unreleased_changes.md.j2 +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/data/templates/angular/md/.versioned_changes.md.j2 +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/data/templates/angular/md/CHANGELOG.md.j2 +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/data/templates/angular/release_notes.md.j2 +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/enums.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/errors.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/gitproject.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/helpers.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/hvcs/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/hvcs/_base.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/hvcs/bitbucket.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/hvcs/gitea.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/hvcs/github.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/hvcs/gitlab.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/hvcs/remote_hvcs_base.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/hvcs/token_auth.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/hvcs/util.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/version/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/version/algorithm.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/version/declaration.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/version/translator.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/version/version.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/setup.cfg +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/command_line/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/command_line/conftest.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/command_line/test_generate_config.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/command_line/test_help.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/command_line/test_main.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/command_line/test_publish.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/conftest.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/fixtures/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/fixtures/commit_parsers.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/fixtures/repos/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/fixtures/repos/git_flow/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/fixtures/repos/github_flow/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/fixtures/repos/trunk_based_dev/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/fixtures/scipy.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/scenario/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/scenario/test_next_version.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/scenario/test_template_render.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/scenario/test_version_stamp.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/changelog/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/changelog/test_changelog_context.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/changelog/test_default_changelog.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/changelog/test_release_notes.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/changelog/test_template.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/cli/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/cli/test_github_actions_output.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/cli/test_masking_filter.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/cli/test_util.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/cli/test_version.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/commit_parser/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/commit_parser/test_angular.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/commit_parser/test_emoji.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/commit_parser/test_parsed_commit.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/commit_parser/test_scipy.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/commit_parser/test_tag.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/commit_parser/test_util.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/hvcs/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/hvcs/test__base.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/hvcs/test_bitbucket.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/hvcs/test_gitea.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/hvcs/test_github.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/hvcs/test_gitlab.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/hvcs/test_token_auth.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/hvcs/test_util.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/test_helpers.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/version/__init__.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/version/test_algorithm.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/version/test_declaration.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/version/test_translator.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/unit/semantic_release/version/test_version.py +0 -0
- {python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/tests/util.py +0 -0
|
@@ -337,7 +337,7 @@ before the :ref:`version <cmd-version>` subcommand.
|
|
|
337
337
|
|
|
338
338
|
.. code:: yaml
|
|
339
339
|
|
|
340
|
-
- uses: python-semantic-release/python-semantic-release@v9.
|
|
340
|
+
- uses: python-semantic-release/python-semantic-release@v9.11.0
|
|
341
341
|
with:
|
|
342
342
|
root_options: "-vv --noop"
|
|
343
343
|
|
|
@@ -684,7 +684,7 @@ to the GitHub Release Assets as well.
|
|
|
684
684
|
- name: Action | Semantic Version Release
|
|
685
685
|
id: release
|
|
686
686
|
# Adjust tag with desired version if applicable.
|
|
687
|
-
uses: python-semantic-release/python-semantic-release@v9.
|
|
687
|
+
uses: python-semantic-release/python-semantic-release@v9.11.0
|
|
688
688
|
with:
|
|
689
689
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
690
690
|
git_committer_name: "github-actions"
|
|
@@ -744,7 +744,7 @@ The equivalent GitHub Action configuration would be:
|
|
|
744
744
|
|
|
745
745
|
- name: Action | Semantic Version Release
|
|
746
746
|
# Adjust tag with desired version if applicable.
|
|
747
|
-
uses: python-semantic-release/python-semantic-release@v9.
|
|
747
|
+
uses: python-semantic-release/python-semantic-release@v9.11.0
|
|
748
748
|
with:
|
|
749
749
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
750
750
|
force: patch
|
|
@@ -772,13 +772,13 @@ Publish Action.
|
|
|
772
772
|
.. code:: yaml
|
|
773
773
|
|
|
774
774
|
- name: Release Project 1
|
|
775
|
-
uses: python-semantic-release/python-semantic-release@v9.
|
|
775
|
+
uses: python-semantic-release/python-semantic-release@v9.11.0
|
|
776
776
|
with:
|
|
777
777
|
directory: ./project1
|
|
778
778
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
779
779
|
|
|
780
780
|
- name: Release Project 2
|
|
781
|
-
uses: python-semantic-release/python-semantic-release@v9.
|
|
781
|
+
uses: python-semantic-release/python-semantic-release@v9.11.0
|
|
782
782
|
with:
|
|
783
783
|
directory: ./project2
|
|
784
784
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
{python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/docs/changelog_templates.rst
RENAMED
|
@@ -36,8 +36,48 @@ the :ref:`--no-changelog <cmd-version-option-changelog>` command-line option.
|
|
|
36
36
|
Using the Default Changelog
|
|
37
37
|
---------------------------
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
If you don't provide any custom templates in the
|
|
40
|
+
:ref:`changelog.template_dir <config-changelog-template_dir>`, the default changelog
|
|
41
|
+
templates will be used to render the changelog.
|
|
42
|
+
|
|
43
|
+
PSR provides two default changelog output formats:
|
|
44
|
+
|
|
45
|
+
1. Markdown (``.md``), *default*
|
|
46
|
+
|
|
47
|
+
2. reStructuredText (``.rst``), *available since v9.11.0*
|
|
48
|
+
|
|
49
|
+
Both formats are kept in sync with one another to display the equivalent information
|
|
50
|
+
in the respective format. The default changelog template is located in the
|
|
51
|
+
``data/templates/`` directory within the PSR package. The templates are written in
|
|
52
|
+
modular style (ie. multiple files) and during the render proccess are ultimately
|
|
53
|
+
combined together to render the final changelog output. The rendering start point
|
|
54
|
+
is the ``CHANGELOG.{FORMAT_EXT}.j2`` underneath the respective format directory.
|
|
55
|
+
|
|
56
|
+
PSR provides a few configuration options to customize the default changelog output
|
|
57
|
+
and can be found under the
|
|
58
|
+
:ref:`changelog.default_templates <config-changelog-default_templates>` section
|
|
59
|
+
as well as some common configuration options under the :ref:`config-changelog`
|
|
60
|
+
section.
|
|
61
|
+
|
|
62
|
+
To toggle the output format, you only need to set the
|
|
63
|
+
:ref:`changelog.default_templates.changelog_file <config-changelog-default_templates-changelog_file>`
|
|
64
|
+
file name to include the desired file extension (``.md`` or ``.rst``). If you would
|
|
65
|
+
like a different extension for the resulting changelog file, but would like
|
|
66
|
+
to still have control over the template format, you can set the
|
|
67
|
+
:ref:`changelog.default_templates.output_format <config-changelog-default_templates-output_format>`
|
|
68
|
+
configuration setting to the desired format.
|
|
69
|
+
|
|
70
|
+
A common and *highly-recommended* configuration option is the
|
|
71
|
+
:ref:`changelog.exclude_commit_patterns <config-changelog-exclude_commit_patterns>`
|
|
72
|
+
setting which allows the user to define regular expressions that will exclude commits
|
|
73
|
+
from the changelog output. This is useful to filter out change messages that are not
|
|
74
|
+
relevant to your external consumers (ex. ``ci`` and ``test`` in the angular commit
|
|
75
|
+
convention) and only include the important changes that impact the consumer of your
|
|
76
|
+
software.
|
|
77
|
+
|
|
78
|
+
Another important configuration option is the :ref:`changelog.mode <config-changelog-mode>`
|
|
79
|
+
setting which determines the behavior of the changelog generation. There are 2
|
|
80
|
+
modes that available that described in detail below.
|
|
41
81
|
|
|
42
82
|
1. :ref:`changelog-templates-default_changelog-init` when ``mode = "init"``.
|
|
43
83
|
|
|
@@ -153,6 +193,60 @@ information will be inserted after the insertion flag.
|
|
|
153
193
|
- Initial Release
|
|
154
194
|
|
|
155
195
|
|
|
196
|
+
.. _changelog-templates-default_changelog-examples:
|
|
197
|
+
|
|
198
|
+
Configuration Examples
|
|
199
|
+
^^^^^^^^^^^^^^^^^^^^^^
|
|
200
|
+
|
|
201
|
+
1. Goal: Configure an updating reStructuredText changelog with a custom insertion
|
|
202
|
+
flag within ``pyproject.toml``.
|
|
203
|
+
|
|
204
|
+
.. code:: toml
|
|
205
|
+
|
|
206
|
+
[tool.semantic_release.changelog]
|
|
207
|
+
mode = "update"
|
|
208
|
+
insertion_flag = "..\n All versions below are listed in reverse chronological order"
|
|
209
|
+
|
|
210
|
+
[tool.semantic_release.changelog.default_templates]
|
|
211
|
+
changelog_file = "CHANGELOG.rst"
|
|
212
|
+
output_format = "rst" # optional because of the file extension
|
|
213
|
+
|
|
214
|
+
2. Goal: Configure an updating Markdown changelog with custom file name and default
|
|
215
|
+
insertion flag within a separate config file ``releaserc.json``.
|
|
216
|
+
|
|
217
|
+
.. code:: json
|
|
218
|
+
|
|
219
|
+
{
|
|
220
|
+
"semantic_release": {
|
|
221
|
+
"changelog": {
|
|
222
|
+
"mode": "update",
|
|
223
|
+
"default_templates": {
|
|
224
|
+
"changelog_file": "docs/HISTORY",
|
|
225
|
+
"output_format": "md"
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
3. Goal: Configure an initializing reStructuredText changelog with filtered angular
|
|
232
|
+
commits patterns and merge commits within a custom config file ``releaserc.toml``.
|
|
233
|
+
|
|
234
|
+
.. code:: toml
|
|
235
|
+
|
|
236
|
+
[semantic_release.changelog]
|
|
237
|
+
mode = "init"
|
|
238
|
+
default_templates = { changelog_file = "docs/CHANGELOG.rst" }
|
|
239
|
+
exclude_commit_patterns = [
|
|
240
|
+
'''chore(?:\([^)]*?\))?: .+''',
|
|
241
|
+
'''ci(?:\([^)]*?\))?: .+''',
|
|
242
|
+
'''refactor(?:\([^)]*?\))?: .+''',
|
|
243
|
+
'''style(?:\([^)]*?\))?: .+''',
|
|
244
|
+
'''test(?:\([^)]*?\))?: .+''',
|
|
245
|
+
'''build\((?!deps\): .+)''',
|
|
246
|
+
'''Merged? .*''',
|
|
247
|
+
]
|
|
248
|
+
|
|
249
|
+
|
|
156
250
|
.. _changelog-templates-default_release_notes:
|
|
157
251
|
|
|
158
252
|
Using the Default Release Notes
|
|
@@ -493,6 +587,24 @@ arguments are passed in parentheses like normal function calls.
|
|
|
493
587
|
|
|
494
588
|
The filters provided vary based on the VCS configured and available features:
|
|
495
589
|
|
|
590
|
+
* ``convert_md_to_rst (Callable[[MdStr], RstStr])``: given a markdown string, convert it to
|
|
591
|
+
reStructuredText format. This filter is useful when building a reStructuredText changelog
|
|
592
|
+
but your commit messages are in markdown format. It is utilized by the default RST changelog
|
|
593
|
+
template. It is limited in its ability to convert all markdown to reStructuredText, but it
|
|
594
|
+
handles most common cases (bold, italics, inline-raw, etc.) within commit messages.
|
|
595
|
+
|
|
596
|
+
*Introduced in v9.11.0.*
|
|
597
|
+
|
|
598
|
+
**Example Usage:**
|
|
599
|
+
|
|
600
|
+
.. code:: jinja
|
|
601
|
+
|
|
602
|
+
{{ "\n* %s (`%s`_)\n" | format(
|
|
603
|
+
commit.message.rstrip() | convert_md_to_rst,
|
|
604
|
+
commit.short_hash,
|
|
605
|
+
)
|
|
606
|
+
}}
|
|
607
|
+
|
|
496
608
|
* ``create_server_url (Callable[[PathStr, AuthStr | None, QueryStr | None, FragmentStr | None], UrlStr])``:
|
|
497
609
|
when given a path, prepend the configured vcs server host and url scheme. Optionally you
|
|
498
610
|
can provide, a auth string, a query string or a url fragment to be normalized into the
|
|
@@ -632,6 +744,7 @@ Availability of the documented filters can be found in the table below:
|
|
|
632
744
|
====================== ========= ===== ====== ======
|
|
633
745
|
**filter - hvcs_type** bitbucket gitea github gitlab
|
|
634
746
|
====================== ========= ===== ====== ======
|
|
747
|
+
convert_md_to_rst ✅ ✅ ✅ ✅
|
|
635
748
|
create_server_url ✅ ✅ ✅ ✅
|
|
636
749
|
create_repo_url ✅ ✅ ✅ ✅
|
|
637
750
|
commit_hash_url ✅ ✅ ✅ ✅
|
|
@@ -830,6 +943,11 @@ existing changelog, follow these steps:
|
|
|
830
943
|
step 2. The insertion flag should be placed in the location above where you would like
|
|
831
944
|
the new release information to be inserted.
|
|
832
945
|
|
|
946
|
+
.. note::
|
|
947
|
+
If you are trying to convert an existing changelog to a new format, you will need to do
|
|
948
|
+
most of the conversion manually (or rebuild via init and modify) and make sure to include
|
|
949
|
+
your insertion flag into the format of the new changelog.
|
|
950
|
+
|
|
833
951
|
**Prior to v9.10.0**
|
|
834
952
|
|
|
835
953
|
If you have an existing changelog that you would like to preserve, you will need to
|
|
@@ -295,12 +295,23 @@ This section outlines the configuration options available that modify changelog
|
|
|
295
295
|
``changelog_file``
|
|
296
296
|
******************
|
|
297
297
|
|
|
298
|
+
.. warning::
|
|
299
|
+
*Deprecated in v9.11.0.* This setting has been moved to
|
|
300
|
+
:ref:`changelog.default_templates.changelog_file <config-changelog-default_templates-changelog_file>`
|
|
301
|
+
for a more logical grouping. This setting will be removed in a future major release.
|
|
302
|
+
|
|
298
303
|
**Type:** ``str``
|
|
299
304
|
|
|
300
305
|
Specify the name of the changelog file that will be created. This file will be created
|
|
301
306
|
or overwritten (if it previously exists) with the rendered default template included
|
|
302
307
|
with Python Semantic Release.
|
|
303
308
|
|
|
309
|
+
Depending on the file extension of this setting, the changelog will be rendered in the
|
|
310
|
+
format designated by the extension. PSR, as of v9.11.0, provides a default changelog template
|
|
311
|
+
in both Markdown (``.md``) and reStructuredText (``.rst``) formats. If the file extension is
|
|
312
|
+
not recognized, the changelog will be rendered in Markdown format, unless the
|
|
313
|
+
:ref:`config-changelog-default_templates-output_format` setting is set.
|
|
314
|
+
|
|
304
315
|
If you are using the ``template_dir`` setting for providing customized templates,
|
|
305
316
|
this setting is not used. See :ref:`config-changelog-template_dir` for more information.
|
|
306
317
|
|
|
@@ -325,6 +336,32 @@ this setting is not used. See :ref:`config-changelog-template_dir` for more info
|
|
|
325
336
|
|
|
326
337
|
----
|
|
327
338
|
|
|
339
|
+
.. _config-changelog-default_templates-changelog_file:
|
|
340
|
+
|
|
341
|
+
``changelog_file``
|
|
342
|
+
''''''''''''''''''
|
|
343
|
+
|
|
344
|
+
*Introduced in v9.11.0.*
|
|
345
|
+
|
|
346
|
+
**Type:** ``str``
|
|
347
|
+
|
|
348
|
+
Specify the name of the changelog file that will be created. This file will be created
|
|
349
|
+
or overwritten (if it previously exists) with the rendered default template included
|
|
350
|
+
with Python Semantic Release.
|
|
351
|
+
|
|
352
|
+
Depending on the file extension of this setting, the changelog will be rendered in the
|
|
353
|
+
format designated by the extension. PSR, as of v9.11.0, provides a default changelog template
|
|
354
|
+
in both Markdown (``.md``) and reStructuredText (``.rst``) formats. If the file extension is
|
|
355
|
+
not recognized, the changelog will be rendered in Markdown format, unless the
|
|
356
|
+
:ref:`config-changelog-default_templates-output_format` setting is set.
|
|
357
|
+
|
|
358
|
+
If you are using the ``template_dir`` setting for providing customized templates,
|
|
359
|
+
this setting is not used. See :ref:`config-changelog-template_dir` for more information.
|
|
360
|
+
|
|
361
|
+
**Default:** ``"CHANGELOG.md"``
|
|
362
|
+
|
|
363
|
+
----
|
|
364
|
+
|
|
328
365
|
.. _config-changelog-default_templates-output_format:
|
|
329
366
|
|
|
330
367
|
``output_format``
|
|
@@ -332,14 +369,23 @@ this setting is not used. See :ref:`config-changelog-template_dir` for more info
|
|
|
332
369
|
|
|
333
370
|
*Introduced in v9.10.0*
|
|
334
371
|
|
|
335
|
-
**Type:** ``Literal["md"]``
|
|
372
|
+
**Type:** ``Literal["md", "rst"]``
|
|
336
373
|
|
|
337
374
|
This setting is used to specify the output format the default changelog template
|
|
338
|
-
will use when rendering the changelog.
|
|
339
|
-
``
|
|
375
|
+
will use when rendering the changelog. PSR supports both Markdown (``md``) and
|
|
376
|
+
reStructuredText (``rst``) formats.
|
|
377
|
+
|
|
378
|
+
This setting will take presendence over the file extension of the
|
|
379
|
+
:ref:`config-changelog-default_templates-changelog_file` setting. If this setting is
|
|
380
|
+
omitted, the file extension of the :ref:`config-changelog-default_templates-changelog_file`
|
|
381
|
+
setting will be used to determine the output format. If the file extension is not recognized,
|
|
382
|
+
the output format will default to Markdown.
|
|
340
383
|
|
|
341
384
|
**Default:** ``"md"``
|
|
342
385
|
|
|
386
|
+
.. seealso::
|
|
387
|
+
- :ref:`config-changelog-default_templates-changelog_file`
|
|
388
|
+
|
|
343
389
|
----
|
|
344
390
|
|
|
345
391
|
.. _config-changelog-environment:
|
|
@@ -625,9 +671,20 @@ for future version insertions.
|
|
|
625
671
|
|
|
626
672
|
If you modify this value in your config, you will need to manually update any saved changelog
|
|
627
673
|
file to match the new insertion flag if you use the ``update`` mode. In ``init`` mode, the
|
|
628
|
-
changelog file will be overwritten
|
|
674
|
+
changelog file will be overwritten as normal.
|
|
675
|
+
|
|
676
|
+
In v9.11.0, the ``insertion_flag`` default value became more dynamic with the introduction of
|
|
677
|
+
an reStructuredText template. The default value will be set depending on the
|
|
678
|
+
:ref:`config-changelog-default_templates-output_format` setting. The default flag values are:
|
|
679
|
+
|
|
680
|
+
================== =========================
|
|
681
|
+
Output Format Default Insertion Flag
|
|
682
|
+
================== =========================
|
|
683
|
+
Markdown (``md``) ``<!-- version list -->``
|
|
684
|
+
reStructuredText ``..\n version list``
|
|
685
|
+
================== =========================
|
|
629
686
|
|
|
630
|
-
**Default:**
|
|
687
|
+
**Default:** various, see above
|
|
631
688
|
|
|
632
689
|
----
|
|
633
690
|
|
|
@@ -11,6 +11,14 @@ pyproject.toml
|
|
|
11
11
|
./semantic_release/data/templates/angular/md/.unreleased_changes.md.j2
|
|
12
12
|
./semantic_release/data/templates/angular/md/.versioned_changes.md.j2
|
|
13
13
|
./semantic_release/data/templates/angular/md/CHANGELOG.md.j2
|
|
14
|
+
./semantic_release/data/templates/angular/rst/.changelog_header.rst.j2
|
|
15
|
+
./semantic_release/data/templates/angular/rst/.changelog_init.rst.j2
|
|
16
|
+
./semantic_release/data/templates/angular/rst/.changelog_update.rst.j2
|
|
17
|
+
./semantic_release/data/templates/angular/rst/.changes.rst.j2
|
|
18
|
+
./semantic_release/data/templates/angular/rst/.macros.rst.j2
|
|
19
|
+
./semantic_release/data/templates/angular/rst/.unreleased_changes.rst.j2
|
|
20
|
+
./semantic_release/data/templates/angular/rst/.versioned_changes.rst.j2
|
|
21
|
+
./semantic_release/data/templates/angular/rst/CHANGELOG.rst.j2
|
|
14
22
|
docs/Makefile
|
|
15
23
|
docs/algorithm.rst
|
|
16
24
|
docs/changelog_templates.rst
|
|
@@ -77,6 +85,14 @@ semantic_release/data/templates/angular/md/.changes.md.j2
|
|
|
77
85
|
semantic_release/data/templates/angular/md/.unreleased_changes.md.j2
|
|
78
86
|
semantic_release/data/templates/angular/md/.versioned_changes.md.j2
|
|
79
87
|
semantic_release/data/templates/angular/md/CHANGELOG.md.j2
|
|
88
|
+
semantic_release/data/templates/angular/rst/.changelog_header.rst.j2
|
|
89
|
+
semantic_release/data/templates/angular/rst/.changelog_init.rst.j2
|
|
90
|
+
semantic_release/data/templates/angular/rst/.changelog_update.rst.j2
|
|
91
|
+
semantic_release/data/templates/angular/rst/.changes.rst.j2
|
|
92
|
+
semantic_release/data/templates/angular/rst/.macros.rst.j2
|
|
93
|
+
semantic_release/data/templates/angular/rst/.unreleased_changes.rst.j2
|
|
94
|
+
semantic_release/data/templates/angular/rst/.versioned_changes.rst.j2
|
|
95
|
+
semantic_release/data/templates/angular/rst/CHANGELOG.rst.j2
|
|
80
96
|
semantic_release/hvcs/__init__.py
|
|
81
97
|
semantic_release/hvcs/_base.py
|
|
82
98
|
semantic_release/hvcs/bitbucket.py
|
|
@@ -5,6 +5,7 @@ import os
|
|
|
5
5
|
from dataclasses import dataclass
|
|
6
6
|
from enum import Enum
|
|
7
7
|
from pathlib import Path
|
|
8
|
+
from re import compile as regexp
|
|
8
9
|
from typing import TYPE_CHECKING, Any, Callable, Literal
|
|
9
10
|
|
|
10
11
|
if TYPE_CHECKING:
|
|
@@ -77,7 +78,11 @@ def make_changelog_context(
|
|
|
77
78
|
changelog_insertion_flag=insertion_flag,
|
|
78
79
|
prev_changelog_file=str(prev_changelog_file),
|
|
79
80
|
hvcs_type=hvcs_client.__class__.__name__.lower(),
|
|
80
|
-
filters=(
|
|
81
|
+
filters=(
|
|
82
|
+
*hvcs_client.get_changelog_context_filters(),
|
|
83
|
+
read_file,
|
|
84
|
+
convert_md_to_rst,
|
|
85
|
+
),
|
|
81
86
|
)
|
|
82
87
|
|
|
83
88
|
|
|
@@ -88,3 +93,22 @@ def read_file(filepath: str) -> str:
|
|
|
88
93
|
except FileNotFoundError as err:
|
|
89
94
|
logging.warning(err)
|
|
90
95
|
return ""
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def convert_md_to_rst(md_content: str) -> str:
|
|
99
|
+
rst_content = md_content
|
|
100
|
+
replacements = {
|
|
101
|
+
# Replace markdown doubleunder bold with rst bold
|
|
102
|
+
"bold-inline": (regexp(r"(?<=\s)__(.+?)__(?=\s|$)"), r"**\1**"),
|
|
103
|
+
# Replace markdown italics with rst italics
|
|
104
|
+
"italic-inline": (regexp(r"(?<=\s)_([^_].+?[^_])_(?=\s|$)"), r"*\1*"),
|
|
105
|
+
# Replace markdown bullets with rst bullets
|
|
106
|
+
"bullets": (regexp(r"^(\s*)-(\s)"), r"\1*\2"),
|
|
107
|
+
# Replace markdown inline raw content with rst inline raw content
|
|
108
|
+
"raw-inline": (regexp(r"(?<=\s)(`[^`]+`)(?![`_])(?=\s|$)"), r"`\1`"),
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
for pattern, replacement in replacements.values():
|
|
112
|
+
rst_content = pattern.sub(replacement, rst_content)
|
|
113
|
+
|
|
114
|
+
return rst_content
|
{python_semantic_release-9.10.0 → python_semantic_release-9.11.0}/semantic_release/cli/config.py
RENAMED
|
@@ -99,7 +99,8 @@ class ChangelogOutputFormat(str, Enum):
|
|
|
99
99
|
"""Supported changelog output formats when using the default templates."""
|
|
100
100
|
|
|
101
101
|
MARKDOWN = "md"
|
|
102
|
-
|
|
102
|
+
RESTRUCTURED_TEXT = "rst"
|
|
103
|
+
NONE = ""
|
|
103
104
|
|
|
104
105
|
|
|
105
106
|
class ChangelogEnvironmentConfig(BaseModel):
|
|
@@ -120,29 +121,116 @@ class ChangelogEnvironmentConfig(BaseModel):
|
|
|
120
121
|
|
|
121
122
|
|
|
122
123
|
class DefaultChangelogTemplatesConfig(BaseModel):
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
changelog_file: str = "CHANGELOG.md"
|
|
125
|
+
output_format: ChangelogOutputFormat = ChangelogOutputFormat.NONE
|
|
126
|
+
|
|
127
|
+
@model_validator(mode="after")
|
|
128
|
+
def interpret_output_format(self) -> Self:
|
|
129
|
+
# Set the output format value when no user input is given
|
|
130
|
+
if self.output_format == ChangelogOutputFormat.NONE:
|
|
131
|
+
try:
|
|
132
|
+
# Note: If the user gave no extension, force '.' so enumeration fails,
|
|
133
|
+
# and defaults to markdown
|
|
134
|
+
# Otherwise normal files with extensions will just look for the extension support
|
|
135
|
+
self.output_format = ChangelogOutputFormat(
|
|
136
|
+
Path(self.changelog_file).suffix.lstrip(".") or "."
|
|
137
|
+
)
|
|
138
|
+
except ValueError:
|
|
139
|
+
self.output_format = ChangelogOutputFormat.MARKDOWN
|
|
140
|
+
|
|
141
|
+
return self
|
|
126
142
|
|
|
127
143
|
|
|
128
144
|
class ChangelogConfig(BaseModel):
|
|
129
145
|
# TODO: BREAKING CHANGE v10, move to DefaultChangelogTemplatesConfig
|
|
130
|
-
changelog_file: str = "
|
|
146
|
+
changelog_file: str = ""
|
|
147
|
+
"""Deprecated! Moved to 'default_templates.changelog_file'"""
|
|
148
|
+
|
|
131
149
|
default_templates: DefaultChangelogTemplatesConfig = (
|
|
132
|
-
DefaultChangelogTemplatesConfig()
|
|
150
|
+
DefaultChangelogTemplatesConfig(output_format=ChangelogOutputFormat.NONE)
|
|
133
151
|
)
|
|
134
152
|
environment: ChangelogEnvironmentConfig = ChangelogEnvironmentConfig()
|
|
135
153
|
exclude_commit_patterns: Tuple[str, ...] = ()
|
|
136
154
|
mode: ChangelogMode = ChangelogMode.INIT
|
|
137
|
-
insertion_flag: str = "
|
|
155
|
+
insertion_flag: str = ""
|
|
138
156
|
template_dir: str = "templates"
|
|
139
157
|
|
|
158
|
+
@field_validator("changelog_file", mode="after")
|
|
159
|
+
@classmethod
|
|
160
|
+
def changelog_file_deprecation_warning(cls, val: str) -> str:
|
|
161
|
+
log.warning(
|
|
162
|
+
str.join(
|
|
163
|
+
" ",
|
|
164
|
+
[
|
|
165
|
+
"The 'changelog.changelog_file' configuration option is moving to 'changelog.default_templates.changelog_file'.",
|
|
166
|
+
"Please update your configuration as the compatibility will break in v10.",
|
|
167
|
+
],
|
|
168
|
+
)
|
|
169
|
+
)
|
|
170
|
+
return val
|
|
171
|
+
|
|
172
|
+
@model_validator(mode="after")
|
|
173
|
+
def move_changelog_file(self) -> Self:
|
|
174
|
+
# TODO: Remove this method in v10
|
|
175
|
+
if not self.changelog_file:
|
|
176
|
+
return self
|
|
177
|
+
|
|
178
|
+
if self.changelog_file == self.default_templates.changelog_file:
|
|
179
|
+
return self
|
|
180
|
+
|
|
181
|
+
# Re-evaluate now that we are passing the changelog_file option down to default_templates
|
|
182
|
+
# and only reset the output_format if it was not already set by the user
|
|
183
|
+
self.default_templates = DefaultChangelogTemplatesConfig.model_validate(
|
|
184
|
+
{
|
|
185
|
+
**self.default_templates.model_dump(),
|
|
186
|
+
"changelog_file": self.changelog_file,
|
|
187
|
+
"output_format": (
|
|
188
|
+
self.default_templates.output_format
|
|
189
|
+
if self.default_templates.output_format
|
|
190
|
+
!= ChangelogOutputFormat.MARKDOWN
|
|
191
|
+
else ChangelogOutputFormat.NONE
|
|
192
|
+
),
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
return self
|
|
197
|
+
|
|
198
|
+
@model_validator(mode="after")
|
|
199
|
+
def load_default_insertion_flag_on_missing(self) -> Self:
|
|
200
|
+
# Set the insertion flag value when no user input is given
|
|
201
|
+
if not self.insertion_flag:
|
|
202
|
+
defaults = {
|
|
203
|
+
ChangelogOutputFormat.MARKDOWN: "<!-- version list -->",
|
|
204
|
+
ChangelogOutputFormat.RESTRUCTURED_TEXT: f"..{os.linesep} version list",
|
|
205
|
+
}
|
|
206
|
+
try:
|
|
207
|
+
self.insertion_flag = defaults[self.default_templates.output_format]
|
|
208
|
+
except KeyError as err:
|
|
209
|
+
raise ValueError(
|
|
210
|
+
"changelog.default_templates.output_format cannot be None"
|
|
211
|
+
) from err
|
|
212
|
+
|
|
213
|
+
return self
|
|
214
|
+
|
|
140
215
|
|
|
141
216
|
class BranchConfig(BaseModel):
|
|
142
217
|
match: str = "(main|master)"
|
|
143
218
|
prerelease_token: str = "rc" # noqa: S105
|
|
144
219
|
prerelease: bool = False
|
|
145
220
|
|
|
221
|
+
@field_validator("match", mode="after")
|
|
222
|
+
@classmethod
|
|
223
|
+
def validate_match(cls, match: str) -> str:
|
|
224
|
+
# Allow the special case of a plain wildcard although it's not a valid regex
|
|
225
|
+
if match == "*":
|
|
226
|
+
return ".*"
|
|
227
|
+
|
|
228
|
+
try:
|
|
229
|
+
re.compile(match)
|
|
230
|
+
except re.error as err:
|
|
231
|
+
raise ValueError(f"Invalid regex {match!r}") from err
|
|
232
|
+
return match
|
|
233
|
+
|
|
146
234
|
|
|
147
235
|
class RemoteConfig(BaseModel):
|
|
148
236
|
name: str = "origin"
|
|
@@ -607,7 +695,10 @@ class RuntimeContext:
|
|
|
607
695
|
# which means it returns a relative path. So we force absolute to ensure path is complete
|
|
608
696
|
# for the next check of path matching
|
|
609
697
|
changelog_file = (
|
|
610
|
-
Path(raw.changelog.changelog_file)
|
|
698
|
+
Path(raw.changelog.default_templates.changelog_file)
|
|
699
|
+
.expanduser()
|
|
700
|
+
.resolve()
|
|
701
|
+
.absolute()
|
|
611
702
|
)
|
|
612
703
|
|
|
613
704
|
# Prevent path traversal attacks
|
|
@@ -46,7 +46,7 @@ This Update changelog template uses the following logic:
|
|
|
46
46
|
%}{# # Check if the release version is already in the changelog and if not, add it
|
|
47
47
|
#}{% if "# " ~ release.version.as_semver_tag() ~ " " not in changelog_parts[1]
|
|
48
48
|
%}{{ "\n"
|
|
49
|
-
}}{
|
|
49
|
+
}}{%- include ".versioned_changes.md.j2"
|
|
50
50
|
-%}{{ "\n"
|
|
51
51
|
}}{% endif
|
|
52
52
|
%}{% endfor
|
python_semantic_release-9.11.0/semantic_release/data/templates/angular/rst/.changelog_init.rst.j2
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{#
|
|
2
|
+
This changelog template initializes a full changelog for the project,
|
|
3
|
+
it follows the following logic:
|
|
4
|
+
1. Header
|
|
5
|
+
2. Any Unreleased Details (uncommon)
|
|
6
|
+
3. all previous releases
|
|
7
|
+
|
|
8
|
+
#}{#
|
|
9
|
+
# Header
|
|
10
|
+
#}{% include ".changelog_header.rst.j2"
|
|
11
|
+
-%}{#
|
|
12
|
+
# Any Unreleased Details (uncommon)
|
|
13
|
+
#}{% include ".unreleased_changes.rst.j2"
|
|
14
|
+
%}{#
|
|
15
|
+
# Since this is initialization, we are generating all the previous
|
|
16
|
+
# release notes per version.
|
|
17
|
+
#}{% for release in context.history.released.values()
|
|
18
|
+
%}{{ "\n"
|
|
19
|
+
}}{% include ".versioned_changes.rst.j2"
|
|
20
|
+
-%}{{ "\n"
|
|
21
|
+
}}{% endfor
|
|
22
|
+
%}
|
python_semantic_release-9.11.0/semantic_release/data/templates/angular/rst/.changelog_update.rst.j2
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{#
|
|
2
|
+
This Update changelog template uses the following logic:
|
|
3
|
+
|
|
4
|
+
1. Read previous changelog file (ex. project_root/CHANGELOG.md)
|
|
5
|
+
2. Split on insertion flag (ex. <!-- version list -->)
|
|
6
|
+
3. Print top half of previous changelog
|
|
7
|
+
3. New Changes (unreleased commits & newly released)
|
|
8
|
+
4. Print bottom half of previous changelog
|
|
9
|
+
|
|
10
|
+
Note: if a previous file was not found, it does not write anything at the bottom
|
|
11
|
+
but render does NOT fail
|
|
12
|
+
|
|
13
|
+
#}{% set prev_changelog_contents = prev_changelog_file | read_file | safe
|
|
14
|
+
%}{% set changelog_parts = prev_changelog_contents.split(insertion_flag, maxsplit=1)
|
|
15
|
+
%}{#
|
|
16
|
+
#}{% if changelog_parts | length < 2
|
|
17
|
+
%}{# # insertion flag was not found, check if the file was empty or did not exist
|
|
18
|
+
#}{% if prev_changelog_contents | length > 0
|
|
19
|
+
%}{# # File has content but no insertion flag, therefore, file will not be updated
|
|
20
|
+
#}{{ changelog_parts[0]
|
|
21
|
+
}}{% else
|
|
22
|
+
%}{# # File was empty or did not exist, therefore, it will be created from scratch
|
|
23
|
+
#}{% include ".changelog_init.rst.j2"
|
|
24
|
+
%}{% endif
|
|
25
|
+
%}{% else
|
|
26
|
+
%}{#
|
|
27
|
+
# Previous Changelog Header
|
|
28
|
+
# - Depending if there is header content, then it will separate the insertion flag
|
|
29
|
+
# with a newline from header content, otherwise it will just print the insertion flag
|
|
30
|
+
#}{% set prev_changelog_top = changelog_parts[0] | trim
|
|
31
|
+
%}{% if prev_changelog_top | length > 0
|
|
32
|
+
%}{{
|
|
33
|
+
"%s\n\n%s\n" | format(prev_changelog_top, insertion_flag | trim)
|
|
34
|
+
|
|
35
|
+
}}{% else
|
|
36
|
+
%}{{
|
|
37
|
+
"%s\n" | format(insertion_flag | trim)
|
|
38
|
+
|
|
39
|
+
}}{% endif
|
|
40
|
+
%}{#
|
|
41
|
+
# Any Unreleased Details (uncommon)
|
|
42
|
+
#}{% include ".unreleased_changes.rst.j2"
|
|
43
|
+
-%}{#
|
|
44
|
+
# Latest Release Details
|
|
45
|
+
#}{% for release in new_releases
|
|
46
|
+
%}{# # Check if the release version is already in the changelog and if not, add it
|
|
47
|
+
#}{% if release.version.as_semver_tag() ~ " (" not in changelog_parts[1]
|
|
48
|
+
%}{{ "\n"
|
|
49
|
+
}}{%- include ".versioned_changes.rst.j2"
|
|
50
|
+
-%}{{ "\n"
|
|
51
|
+
}}{% endif
|
|
52
|
+
%}{% endfor
|
|
53
|
+
%}{#
|
|
54
|
+
# Previous Changelog Footer
|
|
55
|
+
# - skips printing footer if empty, which happens when the insertion_flag
|
|
56
|
+
# was at the end of the file (ignoring whitespace)
|
|
57
|
+
#}{% set previous_changelog_bottom = changelog_parts[1] | trim
|
|
58
|
+
%}{% if previous_changelog_bottom | length > 0
|
|
59
|
+
%}{{ "\n%s\n" | format(previous_changelog_bottom)
|
|
60
|
+
}}{% endif
|
|
61
|
+
%}{% endif
|
|
62
|
+
%}
|