python-semantic-release 9.17.0__tar.gz → 9.18.1__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.17.0/src/python_semantic_release.egg-info → python_semantic_release-9.18.1}/PKG-INFO +1 -1
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/automatic-releases/github-actions.rst +7 -7
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/changelog_templates.rst +108 -17
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/commit_parsing.rst +38 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/index.rst +1 -0
- python_semantic_release-9.18.1/docs/psr_changelog.rst +1 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/pyproject.toml +6 -1
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1/src/python_semantic_release.egg-info}/PKG-INFO +1 -1
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/python_semantic_release.egg-info/SOURCES.txt +3 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/__init__.py +1 -1
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/changelog/context.py +17 -1
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/changelog/release_history.py +39 -5
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/cli/changelog_writer.py +4 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/cli/commands/changelog.py +45 -1
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/cli/commands/version.py +20 -2
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/cli/config.py +29 -10
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/commit_parser/angular.py +33 -13
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/commit_parser/emoji.py +34 -12
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/commit_parser/token.py +19 -6
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/commit_parser/util.py +11 -3
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/const.py +2 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/data/templates/angular/md/.components/changes.md.j2 +59 -14
- python_semantic_release-9.18.1/src/semantic_release/data/templates/angular/md/.components/first_release.md.j2 +18 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/data/templates/angular/md/.components/macros.md.j2 +66 -0
- python_semantic_release-9.18.1/src/semantic_release/data/templates/angular/md/.components/versioned_changes.md.j2 +20 -0
- python_semantic_release-9.18.1/src/semantic_release/data/templates/angular/md/.release_notes.md.j2 +62 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/data/templates/angular/rst/.components/changes.rst.j2 +68 -23
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/data/templates/angular/rst/.components/first_release.rst.j2 +2 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/data/templates/angular/rst/.components/macros.rst.j2 +66 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/data/templates/angular/rst/.components/versioned_changes.rst.j2 +2 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/helpers.py +8 -1
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/hvcs/bitbucket.py +15 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/hvcs/gitea.py +21 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/hvcs/github.py +21 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/hvcs/gitlab.py +20 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/version/algorithm.py +48 -27
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/const.py +5 -1
- python_semantic_release-9.18.1/tests/e2e/cmd_changelog/test_changelog_parsing.py +138 -0
- python_semantic_release-9.18.1/tests/e2e/cmd_changelog/test_changelog_release_notes.py +332 -0
- python_semantic_release-9.18.1/tests/e2e/cmd_version/test_version_release_notes.py +175 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/example_project.py +5 -1
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/git_repo.py +265 -7
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/changelog/conftest.py +178 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/changelog/test_changelog_context.py +165 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/changelog/test_default_changelog.py +447 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/changelog/test_release_notes.py +502 -3
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/commit_parser/test_angular.py +130 -17
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/commit_parser/test_emoji.py +110 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/commit_parser/test_scipy.py +110 -0
- python_semantic_release-9.17.0/src/semantic_release/data/templates/angular/md/.components/first_release.md.j2 +0 -11
- python_semantic_release-9.17.0/src/semantic_release/data/templates/angular/md/.components/versioned_changes.md.j2 +0 -14
- python_semantic_release-9.17.0/src/semantic_release/data/templates/angular/md/.release_notes.md.j2 +0 -58
- python_semantic_release-9.17.0/tests/e2e/cmd_version/test_version_release_notes.py +0 -78
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/AUTHORS.rst +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/LICENSE +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/MANIFEST.in +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/README.rst +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/Makefile +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/algorithm.rst +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/automatic-releases/cronjobs.rst +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/automatic-releases/index.rst +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/automatic-releases/travis.rst +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/commands.rst +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/conf.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/configuration.rst +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/contributing.rst +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/contributors.rst +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/make.bat +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/migrating_from_v7.rst +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/multibranch_releases.rst +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/strict_mode.rst +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/troubleshooting.rst +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/setup.cfg +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/python_semantic_release.egg-info/dependency_links.txt +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/python_semantic_release.egg-info/entry_points.txt +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/python_semantic_release.egg-info/requires.txt +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/python_semantic_release.egg-info/top_level.txt +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/__main__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/changelog/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/changelog/template.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/cli/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/cli/cli_context.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/cli/commands/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/cli/commands/generate_config.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/cli/commands/main.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/cli/commands/publish.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/cli/const.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/cli/github_actions_output.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/cli/masking_filter.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/cli/util.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/commit_parser/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/commit_parser/_base.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/commit_parser/scipy.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/commit_parser/tag.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/data/templates/angular/md/.components/changelog_header.md.j2 +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/data/templates/angular/md/.components/changelog_init.md.j2 +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/data/templates/angular/md/.components/changelog_update.md.j2 +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/data/templates/angular/md/.components/unreleased_changes.md.j2 +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/data/templates/angular/md/CHANGELOG.md.j2 +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/data/templates/angular/rst/.components/changelog_header.rst.j2 +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/data/templates/angular/rst/.components/changelog_init.rst.j2 +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/data/templates/angular/rst/.components/changelog_update.rst.j2 +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/data/templates/angular/rst/.components/unreleased_changes.rst.j2 +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/data/templates/angular/rst/CHANGELOG.rst.j2 +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/enums.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/errors.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/gitproject.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/globals.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/hvcs/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/hvcs/_base.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/hvcs/remote_hvcs_base.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/hvcs/token_auth.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/hvcs/util.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/py.typed +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/version/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/version/declaration.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/version/translator.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/src/semantic_release/version/version.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/conftest.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_changelog/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_changelog/test_changelog.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_changelog/test_changelog_custom_parser.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_config/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_config/test_generate_config.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_publish/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_publish/test_publish.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/bump_version/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/bump_version/conftest.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/bump_version/git_flow/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/bump_version/git_flow/test_repo_1_channel.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/bump_version/git_flow/test_repo_2_channels.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/bump_version/git_flow/test_repo_3_channels.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/bump_version/git_flow/test_repo_4_channels.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/bump_version/github_flow/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/bump_version/github_flow/test_repo_1_channel.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/bump_version/github_flow/test_repo_2_channels.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/bump_version/trunk_based_dev/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_dual_version_support.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_dual_version_support_w_prereleases.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_w_prereleases.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/test_version.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/test_version_build.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/test_version_bump.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/test_version_changelog.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/test_version_changelog_custom_commit_msg.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/test_version_github_actions.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/test_version_print.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/test_version_stamp.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/cmd_version/test_version_strict.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/conftest.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/test_help.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/e2e/test_main.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/commit_parsers.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/repos/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/repos/git_flow/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/repos/git_flow/repo_w_1_release_channel.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/repos/git_flow/repo_w_4_release_channels.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/repos/github_flow/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/repos/github_flow/repo_w_default_release.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/repos/github_flow/repo_w_release_channels.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/repos/repo_initial_commit.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/repos/trunk_based_dev/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/repos/trunk_based_dev/repo_w_dual_version_support.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/repos/trunk_based_dev/repo_w_dual_version_support_w_prereleases.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/fixtures/scipy.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/conftest.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/changelog/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/changelog/test_release_history.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/changelog/test_template.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/changelog/test_template_render.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/cli/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/cli/test_config.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/cli/test_github_actions_output.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/cli/test_masking_filter.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/cli/test_util.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/cli/test_version.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/commit_parser/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/commit_parser/test_parsed_commit.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/commit_parser/test_util.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/hvcs/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/hvcs/test__base.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/hvcs/test_bitbucket.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/hvcs/test_gitea.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/hvcs/test_github.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/hvcs/test_gitlab.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/hvcs/test_token_auth.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/hvcs/test_util.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/test_helpers.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/version/__init__.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/version/test_algorithm.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/version/test_declaration.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/version/test_translator.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/tests/unit/semantic_release/version/test_version.py +0 -0
- {python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/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.18.0
|
|
341
341
|
with:
|
|
342
342
|
root_options: "-vv --noop"
|
|
343
343
|
|
|
@@ -576,7 +576,7 @@ before the :ref:`publish <cmd-publish>` subcommand.
|
|
|
576
576
|
|
|
577
577
|
.. code:: yaml
|
|
578
578
|
|
|
579
|
-
- uses: python-semantic-release/publish-action@v9.
|
|
579
|
+
- uses: python-semantic-release/publish-action@v9.18.0
|
|
580
580
|
with:
|
|
581
581
|
root_options: "-vv --noop"
|
|
582
582
|
|
|
@@ -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.18.0
|
|
688
688
|
with:
|
|
689
689
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
690
690
|
git_committer_name: "github-actions"
|
|
@@ -695,7 +695,7 @@ to the GitHub Release Assets as well.
|
|
|
695
695
|
if: steps.release.outputs.released == 'true'
|
|
696
696
|
|
|
697
697
|
- name: Publish | Upload to GitHub Release Assets
|
|
698
|
-
uses: python-semantic-release/publish-action@v9.
|
|
698
|
+
uses: python-semantic-release/publish-action@v9.18.0
|
|
699
699
|
if: steps.release.outputs.released == 'true'
|
|
700
700
|
with:
|
|
701
701
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -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.18.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.18.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.18.0
|
|
782
782
|
with:
|
|
783
783
|
directory: ./project2
|
|
784
784
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
{python_semantic_release-9.17.0 → python_semantic_release-9.18.1}/docs/changelog_templates.rst
RENAMED
|
@@ -246,6 +246,11 @@ Configuration Examples
|
|
|
246
246
|
'''Merged? .*''',
|
|
247
247
|
]
|
|
248
248
|
|
|
249
|
+
If identified or supported by the parser, the default changelog templates will include
|
|
250
|
+
a separate section of breaking changes and additional release information. Refer to the
|
|
251
|
+
:ref:`commit parsing <commit-parsing>` section to see how to write commit messages that
|
|
252
|
+
will be properly parsed and displayed in these sections.
|
|
253
|
+
|
|
249
254
|
|
|
250
255
|
.. _changelog-templates-default_release_notes:
|
|
251
256
|
|
|
@@ -260,16 +265,37 @@ default built-in template out-of-the-box for generating release notes.
|
|
|
260
265
|
|
|
261
266
|
The difference between the changelog and release notes is that the release notes
|
|
262
267
|
only contain the changes for the current release. Due to the modularity of the
|
|
263
|
-
PSR templates, the format is
|
|
264
|
-
changelog.
|
|
268
|
+
PSR templates, the format is similar to an individual version of the default
|
|
269
|
+
changelog but may include other version specific information.
|
|
265
270
|
|
|
266
271
|
At this time, the default template for version release notes is only available
|
|
267
272
|
in Markdown format for all VCS types.
|
|
268
273
|
|
|
274
|
+
If you want to review what the default release notes look like you can use the
|
|
275
|
+
following command to print the release notes to the console (remove any configuration
|
|
276
|
+
for defining a custom template directory):
|
|
277
|
+
|
|
278
|
+
.. code:: console
|
|
279
|
+
|
|
280
|
+
# Create a current tag
|
|
281
|
+
git tag v1.0.0
|
|
282
|
+
semantic-release --noop changelog --post-to-release-tag v1.0.0
|
|
283
|
+
|
|
284
|
+
The default template provided by PSR will respect the
|
|
285
|
+
:ref:`<config-changelog-default_templates-mask_initial_release>` setting and
|
|
286
|
+
will also add a comparison link to the previous release if one exists without
|
|
287
|
+
customization.
|
|
288
|
+
|
|
289
|
+
As of ``v9.18.0``, the default release notes will also include a statement to
|
|
290
|
+
declare which license the project was released under. PSR determines which license
|
|
291
|
+
to declare based on the value of ``project.license-expression`` in the ``pyproject.toml``
|
|
292
|
+
file as defined in the `PEP 639`_ specification.
|
|
293
|
+
|
|
269
294
|
.. seealso::
|
|
270
295
|
- To personalize your release notes, see the
|
|
271
296
|
:ref:`changelog-templates-custom_release_notes` section.
|
|
272
297
|
|
|
298
|
+
.. _PEP 639: https://peps.python.org/pep-0639/
|
|
273
299
|
|
|
274
300
|
.. _changelog-templates-template-rendering:
|
|
275
301
|
|
|
@@ -658,6 +684,45 @@ The filters provided vary based on the VCS configured and available features:
|
|
|
658
684
|
)
|
|
659
685
|
}}
|
|
660
686
|
|
|
687
|
+
* ``create_pypi_url(package_name: str, version: str = "")``: given a package name and an optional
|
|
688
|
+
version, return a URL to the PyPI page for the package. If a version is provided, the URL will
|
|
689
|
+
point to the specific version page. If no version is provided, the URL will point to the package
|
|
690
|
+
page.
|
|
691
|
+
|
|
692
|
+
*Introduced in v9.18.0.*
|
|
693
|
+
|
|
694
|
+
**Example Usage:**
|
|
695
|
+
|
|
696
|
+
.. code:: jinja
|
|
697
|
+
|
|
698
|
+
{{ "example-package" | create_pypi_url }}
|
|
699
|
+
{{ "example-package" | create_pypi_url("1.0.0") }}
|
|
700
|
+
|
|
701
|
+
**Markdown Output:**
|
|
702
|
+
|
|
703
|
+
.. code:: markdown
|
|
704
|
+
|
|
705
|
+
https://pypi.org/project/example-package
|
|
706
|
+
https://pypi.org/project/example-package/1.0.0
|
|
707
|
+
|
|
708
|
+
* ``create_release_url (Callable[[TagStr], UrlStr])``: given a tag, return a URL to the release
|
|
709
|
+
page on the remote vcs. This filter is useful when you want to link to the release page on the
|
|
710
|
+
remote vcs.
|
|
711
|
+
|
|
712
|
+
*Introduced in v9.18.0.*
|
|
713
|
+
|
|
714
|
+
**Example Usage:**
|
|
715
|
+
|
|
716
|
+
.. code:: jinja
|
|
717
|
+
|
|
718
|
+
{{ "v1.0.0" | create_release_url }}
|
|
719
|
+
|
|
720
|
+
**Markdown Output:**
|
|
721
|
+
|
|
722
|
+
.. code:: markdown
|
|
723
|
+
|
|
724
|
+
https://example.com/example/repo/releases/tag/v1.0.0
|
|
725
|
+
|
|
661
726
|
* ``create_server_url (Callable[[PathStr, AuthStr | None, QueryStr | None, FragmentStr | None], UrlStr])``:
|
|
662
727
|
when given a path, prepend the configured vcs server host and url scheme. Optionally you
|
|
663
728
|
can provide, a auth string, a query string or a url fragment to be normalized into the
|
|
@@ -817,6 +882,29 @@ The filters provided vary based on the VCS configured and available features:
|
|
|
817
882
|
|
|
818
883
|
[#29](https://example.com/example/repo/pull/29)
|
|
819
884
|
|
|
885
|
+
* ``format_w_official_vcs_name (Callable[[str], str])``: given a format string, insert
|
|
886
|
+
the official VCS type name into the string and return. This filter is useful when you want to
|
|
887
|
+
display the proper name of the VCS type in a changelog or release notes. The filter supports
|
|
888
|
+
three different replace formats: ``%s``, ``{}``, and ``{vcs_name}``.
|
|
889
|
+
|
|
890
|
+
*Introduced in v9.18.0.*
|
|
891
|
+
|
|
892
|
+
**Example Usage:**
|
|
893
|
+
|
|
894
|
+
.. code:: jinja
|
|
895
|
+
|
|
896
|
+
{{ "%s Releases" | format_w_official_vcs_name }}
|
|
897
|
+
{{ "{} Releases" | format_w_official_vcs_name }}
|
|
898
|
+
{{ "{vcs_name} Releases" | format_w_official_vcs_name }}
|
|
899
|
+
|
|
900
|
+
**Markdown Output:**
|
|
901
|
+
|
|
902
|
+
.. code:: markdown
|
|
903
|
+
|
|
904
|
+
GitHub Releases
|
|
905
|
+
GitHub Releases
|
|
906
|
+
GitHub Releases
|
|
907
|
+
|
|
820
908
|
* ``read_file (Callable[[str], str])``: given a file path, read the file and
|
|
821
909
|
return the contents as a string. This function was added specifically to
|
|
822
910
|
enable the changelog update feature where it would load the existing changelog
|
|
@@ -858,21 +946,24 @@ The filters provided vary based on the VCS configured and available features:
|
|
|
858
946
|
|
|
859
947
|
Availability of the documented filters can be found in the table below:
|
|
860
948
|
|
|
861
|
-
|
|
862
|
-
**filter - hvcs_type**
|
|
863
|
-
|
|
864
|
-
autofit_text_width
|
|
865
|
-
convert_md_to_rst
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
949
|
+
========================== ========= ===== ====== ======
|
|
950
|
+
**filter - hvcs_type** bitbucket gitea github gitlab
|
|
951
|
+
========================== ========= ===== ====== ======
|
|
952
|
+
autofit_text_width ✅ ✅ ✅ ✅
|
|
953
|
+
convert_md_to_rst ✅ ✅ ✅ ✅
|
|
954
|
+
create_pypi_url ✅ ✅ ✅ ✅
|
|
955
|
+
create_server_url ✅ ✅ ✅ ✅
|
|
956
|
+
create_release_url ❌ ✅ ✅ ✅
|
|
957
|
+
create_repo_url ✅ ✅ ✅ ✅
|
|
958
|
+
commit_hash_url ✅ ✅ ✅ ✅
|
|
959
|
+
compare_url ✅ ❌ ✅ ✅
|
|
960
|
+
format_w_official_vcs_name ✅ ✅ ✅ ✅
|
|
961
|
+
issue_url ❌ ✅ ✅ ✅
|
|
962
|
+
merge_request_url ❌ ❌ ❌ ✅
|
|
963
|
+
pull_request_url ✅ ✅ ✅ ✅
|
|
964
|
+
read_file ✅ ✅ ✅ ✅
|
|
965
|
+
sort_numerically ✅ ✅ ✅ ✅
|
|
966
|
+
========================== ========= ===== ====== ======
|
|
876
967
|
|
|
877
968
|
.. seealso::
|
|
878
969
|
* `Filters <https://jinja.palletsprojects.com/en/3.1.x/templates/#filters>`_
|
|
@@ -114,6 +114,12 @@ logic in relation to how PSR's core features:
|
|
|
114
114
|
feature on/off via the :ref:`config-commit_parser_options` setting. *Feature available in
|
|
115
115
|
v9.17.0+.*
|
|
116
116
|
|
|
117
|
+
- **Release Notice Footer Detection**: This parser implements PSR's
|
|
118
|
+
:ref:`commit_parser-builtin-release_notice_footer_detection`, which is a custom extension
|
|
119
|
+
to traditional `Angular Commit Style Guidelines`_ to use the ``NOTICE`` keyword as a git
|
|
120
|
+
footer to document additional release information that is not considered a breaking change.
|
|
121
|
+
*Feature available in v9.18.0+.*
|
|
122
|
+
|
|
117
123
|
**Limitations**:
|
|
118
124
|
|
|
119
125
|
- Commits with the ``revert`` type are not currently supported. Track the implementation
|
|
@@ -185,6 +191,11 @@ how PSR's core features:
|
|
|
185
191
|
feature on/off via the :ref:`config-commit_parser_options` setting. *Feature available in
|
|
186
192
|
v9.17.0+.*
|
|
187
193
|
|
|
194
|
+
- **Release Notice Footer Detection**: This parser implements PSR's
|
|
195
|
+
:ref:`commit_parser-builtin-release_notice_footer_detection`, which is a custom extension
|
|
196
|
+
that uses the ``NOTICE`` keyword as a git footer to document additional release information
|
|
197
|
+
that is not considered a breaking change. *Feature available in v9.18.0+.*
|
|
198
|
+
|
|
188
199
|
If no commit parser options are provided via the configuration, the parser will use PSR's
|
|
189
200
|
built-in :py:class:`defaults <semantic_release.commit_parser.emoji.EmojiParserOptions>`.
|
|
190
201
|
|
|
@@ -310,6 +321,33 @@ return an empty tuple.
|
|
|
310
321
|
|
|
311
322
|
----
|
|
312
323
|
|
|
324
|
+
.. _commit_parser-builtin-release_notice_footer_detection:
|
|
325
|
+
|
|
326
|
+
Common Release Notice Footer Detection
|
|
327
|
+
""""""""""""""""""""""""""""""""""""""
|
|
328
|
+
|
|
329
|
+
*Introduced in v9.18.0**
|
|
330
|
+
|
|
331
|
+
All of the PSR built-in parsers implement common release notice footer detection logic
|
|
332
|
+
to identify and extract a ``NOTICE`` git trailer that documents any additional release
|
|
333
|
+
information the developer wants to provide to the software consumer. The idea extends
|
|
334
|
+
from the concept of the ``BREAKING CHANGE:`` git trailer to document any breaking change
|
|
335
|
+
descriptions but the ``NOTICE`` trailer is intended to document any information that is
|
|
336
|
+
below the threshold of a breaking change while still important for the software consumer
|
|
337
|
+
to be aware of. Common uses would be to provide deprecation warnings or more detailed
|
|
338
|
+
change usage information for that release. Parsers will collapse single newlines after
|
|
339
|
+
the ``NOTICE`` trailer into a single line paragraph. Commits may have more than one
|
|
340
|
+
``NOTICE`` trailer in a single commit message. Each
|
|
341
|
+
:py:class:`ParsedCommit <semantic_release.commit_parser.token.ParsedCommit>` will have
|
|
342
|
+
a ``release_notices`` attribute that is a tuple of string paragraphs to identify each
|
|
343
|
+
release notice.
|
|
344
|
+
|
|
345
|
+
In the default changelog and release notes template, these release notices will be
|
|
346
|
+
formatted into their own section called **ADDITIONAL RELEASE INFORMATION**. Each will
|
|
347
|
+
include any commit scope defined and each release notice in alphabetical order.
|
|
348
|
+
|
|
349
|
+
----
|
|
350
|
+
|
|
313
351
|
.. _commit_parser-builtin-squash_commit_evaluation:
|
|
314
352
|
|
|
315
353
|
Common Squash Commit Evaluation
|
|
@@ -69,6 +69,7 @@ Documentation Contents
|
|
|
69
69
|
Migrating from Python Semantic Release v7 <migrating_from_v7>
|
|
70
70
|
Internal API <api/modules>
|
|
71
71
|
Algorithm <algorithm>
|
|
72
|
+
Changelog <psr_changelog>
|
|
72
73
|
View on GitHub <https://github.com/python-semantic-release/python-semantic-release>
|
|
73
74
|
|
|
74
75
|
Getting Started
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.. include:: ../CHANGELOG.rst
|
|
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "python-semantic-release"
|
|
9
|
-
version = "9.
|
|
9
|
+
version = "9.18.1"
|
|
10
10
|
description = "Automatic Semantic Versioning for Python projects"
|
|
11
11
|
requires-python = ">=3.8"
|
|
12
12
|
license = { text = "MIT" }
|
|
@@ -399,6 +399,7 @@ ignore_names = ["change_to_ex_proj_dir", "init_example_project"]
|
|
|
399
399
|
[tool.semantic_release]
|
|
400
400
|
logging_use_named_masks = true
|
|
401
401
|
commit_parser = "angular"
|
|
402
|
+
commit_parser_options = { parse_squash_commits = true, ignore_merge_commits = true }
|
|
402
403
|
build_command = """
|
|
403
404
|
python -m pip install -e .[build]
|
|
404
405
|
python -m build .
|
|
@@ -408,6 +409,7 @@ version_variables = ["src/semantic_release/__init__.py:__version__"]
|
|
|
408
409
|
version_toml = ["pyproject.toml:project.version"]
|
|
409
410
|
|
|
410
411
|
[tool.semantic_release.changelog]
|
|
412
|
+
# default_templates = { changelog_file = "CHANGELOG.rst" }
|
|
411
413
|
exclude_commit_patterns = [
|
|
412
414
|
'''chore(?:\([^)]*?\))?: .+''',
|
|
413
415
|
'''ci(?:\([^)]*?\))?: .+''',
|
|
@@ -420,6 +422,9 @@ exclude_commit_patterns = [
|
|
|
420
422
|
# Old semantic-release version commits
|
|
421
423
|
'''^\d+\.\d+\.\d+''',
|
|
422
424
|
]
|
|
425
|
+
insertion_flag = "=========\nCHANGELOG\n========="
|
|
426
|
+
mode = "update"
|
|
427
|
+
template_dir = "config/release-templates"
|
|
423
428
|
|
|
424
429
|
[tool.semantic_release.branches.main]
|
|
425
430
|
match = "(main|master)"
|
|
@@ -16,6 +16,7 @@ docs/index.rst
|
|
|
16
16
|
docs/make.bat
|
|
17
17
|
docs/migrating_from_v7.rst
|
|
18
18
|
docs/multibranch_releases.rst
|
|
19
|
+
docs/psr_changelog.rst
|
|
19
20
|
docs/strict_mode.rst
|
|
20
21
|
docs/troubleshooting.rst
|
|
21
22
|
docs/automatic-releases/cronjobs.rst
|
|
@@ -107,6 +108,8 @@ tests/e2e/test_main.py
|
|
|
107
108
|
tests/e2e/cmd_changelog/__init__.py
|
|
108
109
|
tests/e2e/cmd_changelog/test_changelog.py
|
|
109
110
|
tests/e2e/cmd_changelog/test_changelog_custom_parser.py
|
|
111
|
+
tests/e2e/cmd_changelog/test_changelog_parsing.py
|
|
112
|
+
tests/e2e/cmd_changelog/test_changelog_release_notes.py
|
|
110
113
|
tests/e2e/cmd_config/__init__.py
|
|
111
114
|
tests/e2e/cmd_config/test_generate_config.py
|
|
112
115
|
tests/e2e/cmd_publish/__init__.py
|
|
@@ -4,10 +4,13 @@ import logging
|
|
|
4
4
|
import os
|
|
5
5
|
from dataclasses import dataclass
|
|
6
6
|
from enum import Enum
|
|
7
|
-
from pathlib import Path
|
|
7
|
+
from pathlib import Path, PurePosixPath
|
|
8
8
|
from re import compile as regexp
|
|
9
9
|
from typing import TYPE_CHECKING, Any, Callable, Literal
|
|
10
10
|
|
|
11
|
+
from urllib3.util import Url
|
|
12
|
+
|
|
13
|
+
from semantic_release.const import PYPI_WEB_DOMAIN
|
|
11
14
|
from semantic_release.helpers import sort_numerically
|
|
12
15
|
|
|
13
16
|
if TYPE_CHECKING: # pragma: no cover
|
|
@@ -26,6 +29,7 @@ class ReleaseNotesContext:
|
|
|
26
29
|
version: Version
|
|
27
30
|
release: Release
|
|
28
31
|
mask_initial_release: bool
|
|
32
|
+
license_name: str
|
|
29
33
|
filters: tuple[Callable[..., Any], ...] = ()
|
|
30
34
|
|
|
31
35
|
def bind_to_environment(self, env: Environment) -> Environment:
|
|
@@ -86,6 +90,7 @@ def make_changelog_context(
|
|
|
86
90
|
hvcs_type=hvcs_client.__class__.__name__.lower(),
|
|
87
91
|
filters=(
|
|
88
92
|
*hvcs_client.get_changelog_context_filters(),
|
|
93
|
+
create_pypi_url,
|
|
89
94
|
read_file,
|
|
90
95
|
convert_md_to_rst,
|
|
91
96
|
autofit_text_width,
|
|
@@ -94,6 +99,17 @@ def make_changelog_context(
|
|
|
94
99
|
)
|
|
95
100
|
|
|
96
101
|
|
|
102
|
+
def create_pypi_url(package_name: str, version: str = "") -> str:
|
|
103
|
+
project_name = package_name.strip("/").strip()
|
|
104
|
+
if not project_name:
|
|
105
|
+
raise ValueError("package_name must not be empty!")
|
|
106
|
+
return Url(
|
|
107
|
+
scheme="https",
|
|
108
|
+
host=PYPI_WEB_DOMAIN,
|
|
109
|
+
path=str(PurePosixPath("project", project_name, version.strip("/").strip())),
|
|
110
|
+
).url.rstrip("/")
|
|
111
|
+
|
|
112
|
+
|
|
97
113
|
def read_file(filepath: str) -> str:
|
|
98
114
|
try:
|
|
99
115
|
if not filepath:
|
|
@@ -9,7 +9,9 @@ from git.objects.tag import TagObject
|
|
|
9
9
|
|
|
10
10
|
from semantic_release.commit_parser import ParseError
|
|
11
11
|
from semantic_release.commit_parser.token import ParsedCommit
|
|
12
|
+
from semantic_release.commit_parser.util import force_str
|
|
12
13
|
from semantic_release.enums import LevelBump
|
|
14
|
+
from semantic_release.helpers import validate_types_in_sequence
|
|
13
15
|
from semantic_release.version.algorithm import tags_and_versions
|
|
14
16
|
|
|
15
17
|
if TYPE_CHECKING: # pragma: no cover
|
|
@@ -50,6 +52,12 @@ class ReleaseHistory:
|
|
|
50
52
|
for tag, version in all_git_tags_and_versions
|
|
51
53
|
}
|
|
52
54
|
|
|
55
|
+
ignore_merge_commits = bool(
|
|
56
|
+
hasattr(commit_parser, "options")
|
|
57
|
+
and hasattr(commit_parser.options, "ignore_merge_commits")
|
|
58
|
+
and getattr(commit_parser.options, "ignore_merge_commits") # noqa: B009
|
|
59
|
+
)
|
|
60
|
+
|
|
53
61
|
# Strategy:
|
|
54
62
|
# Loop through commits in history, parsing as we go.
|
|
55
63
|
# Add these commits to `unreleased` as a key-value mapping
|
|
@@ -110,14 +118,36 @@ class ReleaseHistory:
|
|
|
110
118
|
# returns a ParseResult or list of ParseResult objects,
|
|
111
119
|
# it is usually one, but we split a commit if a squashed merge is detected
|
|
112
120
|
parse_results = commit_parser.parse(commit)
|
|
113
|
-
if not isinstance(parse_results, list):
|
|
114
|
-
parse_results = [parse_results]
|
|
115
121
|
|
|
116
|
-
|
|
122
|
+
if not any(
|
|
123
|
+
(
|
|
124
|
+
isinstance(parse_results, (ParseError, ParsedCommit)),
|
|
125
|
+
(
|
|
126
|
+
(
|
|
127
|
+
isinstance(parse_results, list)
|
|
128
|
+
or type(parse_results) == tuple
|
|
129
|
+
)
|
|
130
|
+
and validate_types_in_sequence(
|
|
131
|
+
parse_results, (ParseError, ParsedCommit)
|
|
132
|
+
)
|
|
133
|
+
),
|
|
134
|
+
)
|
|
135
|
+
):
|
|
136
|
+
raise TypeError("Unexpected type returned from commit_parser.parse")
|
|
137
|
+
|
|
138
|
+
results: list[ParseResult] = [
|
|
139
|
+
*(
|
|
140
|
+
[parse_results]
|
|
141
|
+
if isinstance(parse_results, (ParseError, ParsedCommit))
|
|
142
|
+
else parse_results
|
|
143
|
+
),
|
|
144
|
+
]
|
|
145
|
+
|
|
146
|
+
is_squash_commit = bool(len(results) > 1)
|
|
117
147
|
|
|
118
148
|
# iterate through parsed commits to add to changelog definition
|
|
119
|
-
for parsed_result in
|
|
120
|
-
commit_message =
|
|
149
|
+
for parsed_result in results:
|
|
150
|
+
commit_message = force_str(parsed_result.commit.message)
|
|
121
151
|
commit_type = (
|
|
122
152
|
"unknown"
|
|
123
153
|
if isinstance(parsed_result, ParseError)
|
|
@@ -135,6 +165,10 @@ class ReleaseHistory:
|
|
|
135
165
|
else parsed_result.bump
|
|
136
166
|
)
|
|
137
167
|
|
|
168
|
+
if ignore_merge_commits and parsed_result.is_merge_commit():
|
|
169
|
+
log.info("Excluding merge commit[%s]", parsed_result.short_hash)
|
|
170
|
+
continue
|
|
171
|
+
|
|
138
172
|
# Skip excluded commits except for any commit causing a version bump
|
|
139
173
|
# Reasoning: if a commit causes a version bump, and no other commits
|
|
140
174
|
# are included, then the changelog will be empty. Even if ther was other
|
|
@@ -13,6 +13,7 @@ import semantic_release
|
|
|
13
13
|
from semantic_release.changelog.context import (
|
|
14
14
|
ReleaseNotesContext,
|
|
15
15
|
autofit_text_width,
|
|
16
|
+
create_pypi_url,
|
|
16
17
|
make_changelog_context,
|
|
17
18
|
)
|
|
18
19
|
from semantic_release.changelog.template import environment, recursive_render
|
|
@@ -229,6 +230,7 @@ def generate_release_notes(
|
|
|
229
230
|
history: ReleaseHistory,
|
|
230
231
|
style: str,
|
|
231
232
|
mask_initial_release: bool,
|
|
233
|
+
license_name: str = "",
|
|
232
234
|
) -> str:
|
|
233
235
|
users_tpl_file = template_dir / DEFAULT_RELEASE_NOTES_TPL_FILE
|
|
234
236
|
|
|
@@ -255,8 +257,10 @@ def generate_release_notes(
|
|
|
255
257
|
version=release["version"],
|
|
256
258
|
release=release,
|
|
257
259
|
mask_initial_release=mask_initial_release,
|
|
260
|
+
license_name=license_name,
|
|
258
261
|
filters=(
|
|
259
262
|
*hvcs_client.get_changelog_context_filters(),
|
|
263
|
+
create_pypi_url,
|
|
260
264
|
autofit_text_width,
|
|
261
265
|
sort_numerically,
|
|
262
266
|
),
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
+
from contextlib import suppress
|
|
5
|
+
from pathlib import Path
|
|
4
6
|
from typing import TYPE_CHECKING
|
|
5
7
|
|
|
6
8
|
import click
|
|
7
|
-
|
|
9
|
+
import tomlkit
|
|
10
|
+
from git import GitCommandError, Repo
|
|
8
11
|
|
|
9
12
|
from semantic_release.changelog.release_history import ReleaseHistory
|
|
10
13
|
from semantic_release.cli.changelog_writer import (
|
|
@@ -21,6 +24,43 @@ if TYPE_CHECKING: # pragma: no cover
|
|
|
21
24
|
log = logging.getLogger(__name__)
|
|
22
25
|
|
|
23
26
|
|
|
27
|
+
def get_license_name_for_release(tag_name: str, project_root: Path) -> str:
|
|
28
|
+
# Retrieve the license name at the time of the specific release tag
|
|
29
|
+
project_metadata: dict[str, str] = {}
|
|
30
|
+
curr_dir = Path.cwd().resolve()
|
|
31
|
+
allowed_directories = [
|
|
32
|
+
dir_path
|
|
33
|
+
for dir_path in [curr_dir, *curr_dir.parents]
|
|
34
|
+
if str(project_root) in str(dir_path)
|
|
35
|
+
]
|
|
36
|
+
for allowed_dir in allowed_directories:
|
|
37
|
+
proj_toml = allowed_dir.joinpath("pyproject.toml")
|
|
38
|
+
with Repo(project_root) as git_repo, suppress(GitCommandError):
|
|
39
|
+
toml_contents = git_repo.git.show(
|
|
40
|
+
f"{tag_name}:{proj_toml.relative_to(project_root)}"
|
|
41
|
+
)
|
|
42
|
+
config_toml = tomlkit.parse(toml_contents)
|
|
43
|
+
project_metadata = config_toml.unwrap().get("project", project_metadata)
|
|
44
|
+
break
|
|
45
|
+
|
|
46
|
+
license_cfg = project_metadata.get(
|
|
47
|
+
"license-expression",
|
|
48
|
+
project_metadata.get(
|
|
49
|
+
"license",
|
|
50
|
+
"",
|
|
51
|
+
),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
if not isinstance(license_cfg, (str, dict)) or license_cfg is None:
|
|
55
|
+
return ""
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
license_cfg.get("text", "") # type: ignore[attr-defined]
|
|
59
|
+
if isinstance(license_cfg, dict)
|
|
60
|
+
else license_cfg or ""
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
24
64
|
def post_release_notes(
|
|
25
65
|
release_tag: str,
|
|
26
66
|
release_notes: str,
|
|
@@ -120,6 +160,10 @@ def changelog(cli_ctx: CliContextObj, release_tag: str | None) -> None:
|
|
|
120
160
|
release_history,
|
|
121
161
|
style=runtime.changelog_style,
|
|
122
162
|
mask_initial_release=runtime.changelog_mask_initial_release,
|
|
163
|
+
license_name=get_license_name_for_release(
|
|
164
|
+
tag_name=release_tag,
|
|
165
|
+
project_root=runtime.repo_dir,
|
|
166
|
+
),
|
|
123
167
|
)
|
|
124
168
|
|
|
125
169
|
try:
|
|
@@ -699,13 +699,31 @@ def version( # noqa: C901
|
|
|
699
699
|
log.info("Remote does not support releases. Skipping release creation...")
|
|
700
700
|
return
|
|
701
701
|
|
|
702
|
+
license_cfg = runtime.project_metadata.get(
|
|
703
|
+
"license-expression",
|
|
704
|
+
runtime.project_metadata.get(
|
|
705
|
+
"license",
|
|
706
|
+
"",
|
|
707
|
+
),
|
|
708
|
+
)
|
|
709
|
+
|
|
710
|
+
if not isinstance(license_cfg, (str, dict)) or license_cfg is None:
|
|
711
|
+
license_cfg = ""
|
|
712
|
+
|
|
713
|
+
license_name = (
|
|
714
|
+
license_cfg.get("text", "")
|
|
715
|
+
if isinstance(license_cfg, dict)
|
|
716
|
+
else license_cfg or ""
|
|
717
|
+
)
|
|
718
|
+
|
|
702
719
|
release_notes = generate_release_notes(
|
|
703
720
|
hvcs_client,
|
|
704
|
-
release_history.released[new_version],
|
|
705
|
-
runtime.template_dir,
|
|
721
|
+
release=release_history.released[new_version],
|
|
722
|
+
template_dir=runtime.template_dir,
|
|
706
723
|
history=release_history,
|
|
707
724
|
style=runtime.changelog_style,
|
|
708
725
|
mask_initial_release=runtime.changelog_mask_initial_release,
|
|
726
|
+
license_name=license_name,
|
|
709
727
|
)
|
|
710
728
|
|
|
711
729
|
exception: Exception | None = None
|