python-semantic-release 9.12.2__tar.gz → 9.13.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.
Files changed (180) hide show
  1. {python_semantic_release-9.12.2/src/python_semantic_release.egg-info → python_semantic_release-9.13.0}/PKG-INFO +1 -1
  2. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/automatic-releases/github-actions.rst +5 -5
  3. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/changelog_templates.rst +58 -34
  4. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/commit-parsing.rst +46 -22
  5. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/conf.py +1 -1
  6. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/pyproject.toml +1 -1
  7. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0/src/python_semantic_release.egg-info}/PKG-INFO +1 -1
  8. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/python_semantic_release.egg-info/SOURCES.txt +2 -0
  9. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/__init__.py +1 -1
  10. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/commit_parser/angular.py +60 -33
  11. python_semantic_release-9.13.0/src/semantic_release/commit_parser/emoji.py +162 -0
  12. python_semantic_release-9.13.0/src/semantic_release/commit_parser/scipy.py +152 -0
  13. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/commit_parser/token.py +30 -0
  14. python_semantic_release-9.13.0/src/semantic_release/commit_parser/util.py +58 -0
  15. python_semantic_release-9.13.0/src/semantic_release/data/templates/angular/md/.components/changes.md.j2 +44 -0
  16. python_semantic_release-9.13.0/src/semantic_release/data/templates/angular/md/.components/macros.md.j2 +48 -0
  17. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/data/templates/angular/md/CHANGELOG.md.j2 +3 -2
  18. python_semantic_release-9.13.0/src/semantic_release/data/templates/angular/rst/.components/changes.rst.j2 +76 -0
  19. python_semantic_release-9.13.0/src/semantic_release/data/templates/angular/rst/.components/macros.rst.j2 +85 -0
  20. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/const.py +3 -0
  21. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/cmd_changelog/test_changelog.py +185 -195
  22. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/cmd_publish/test_publish.py +4 -4
  23. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/cmd_version/test_version.py +7 -7
  24. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/cmd_version/test_version_build.py +5 -5
  25. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/cmd_version/test_version_bump.py +68 -543
  26. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/cmd_version/test_version_changelog.py +102 -91
  27. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/cmd_version/test_version_github_actions.py +2 -2
  28. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/cmd_version/test_version_print.py +19 -12
  29. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/cmd_version/test_version_release_notes.py +2 -2
  30. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/cmd_version/test_version_stamp.py +7 -9
  31. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/cmd_version/test_version_strict.py +3 -3
  32. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/test_help.py +4 -4
  33. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/test_main.py +12 -12
  34. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/fixtures/git_repo.py +430 -28
  35. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py +175 -230
  36. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py +222 -273
  37. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/fixtures/repos/github_flow/__init__.py +1 -0
  38. python_semantic_release-9.13.0/tests/fixtures/repos/github_flow/repo_w_default_release.py +477 -0
  39. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/fixtures/repos/github_flow/repo_w_release_channels.py +172 -85
  40. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/fixtures/repos/repo_initial_commit.py +17 -24
  41. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py +23 -39
  42. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py +34 -43
  43. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py +28 -31
  44. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/changelog/test_default_changelog.py +23 -15
  45. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/changelog/test_release_history.py +36 -20
  46. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/changelog/test_release_notes.py +9 -5
  47. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/cli/test_config.py +2 -2
  48. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/commit_parser/test_angular.py +43 -0
  49. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/commit_parser/test_emoji.py +43 -0
  50. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/commit_parser/test_scipy.py +69 -11
  51. python_semantic_release-9.12.2/src/semantic_release/commit_parser/emoji.py +0 -115
  52. python_semantic_release-9.12.2/src/semantic_release/commit_parser/scipy.py +0 -203
  53. python_semantic_release-9.12.2/src/semantic_release/commit_parser/util.py +0 -27
  54. python_semantic_release-9.12.2/src/semantic_release/data/templates/angular/md/.components/changes.md.j2 +0 -16
  55. python_semantic_release-9.12.2/src/semantic_release/data/templates/angular/rst/.components/changes.rst.j2 +0 -36
  56. python_semantic_release-9.12.2/src/semantic_release/data/templates/angular/rst/.components/macros.rst.j2 +0 -16
  57. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/AUTHORS.rst +0 -0
  58. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/LICENSE +0 -0
  59. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/MANIFEST.in +0 -0
  60. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/README.rst +0 -0
  61. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/Makefile +0 -0
  62. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/algorithm.rst +0 -0
  63. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/automatic-releases/cronjobs.rst +0 -0
  64. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/automatic-releases/index.rst +0 -0
  65. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/automatic-releases/travis.rst +0 -0
  66. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/commands.rst +0 -0
  67. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/configuration.rst +0 -0
  68. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/contributing.rst +0 -0
  69. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/contributors.rst +0 -0
  70. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/index.rst +0 -0
  71. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/make.bat +0 -0
  72. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/migrating_from_v7.rst +0 -0
  73. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/multibranch_releases.rst +0 -0
  74. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/strict_mode.rst +0 -0
  75. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/docs/troubleshooting.rst +0 -0
  76. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/setup.cfg +0 -0
  77. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/python_semantic_release.egg-info/dependency_links.txt +0 -0
  78. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/python_semantic_release.egg-info/entry_points.txt +0 -0
  79. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/python_semantic_release.egg-info/requires.txt +0 -0
  80. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/python_semantic_release.egg-info/top_level.txt +0 -0
  81. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/__main__.py +0 -0
  82. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/changelog/__init__.py +0 -0
  83. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/changelog/context.py +0 -0
  84. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/changelog/release_history.py +0 -0
  85. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/changelog/template.py +0 -0
  86. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/cli/__init__.py +0 -0
  87. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/cli/changelog_writer.py +0 -0
  88. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/cli/cli_context.py +0 -0
  89. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/cli/commands/__init__.py +0 -0
  90. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/cli/commands/changelog.py +0 -0
  91. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/cli/commands/generate_config.py +0 -0
  92. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/cli/commands/main.py +0 -0
  93. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/cli/commands/publish.py +0 -0
  94. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/cli/commands/version.py +0 -0
  95. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/cli/config.py +0 -0
  96. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/cli/const.py +0 -0
  97. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/cli/github_actions_output.py +0 -0
  98. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/cli/masking_filter.py +0 -0
  99. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/cli/util.py +0 -0
  100. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/commit_parser/__init__.py +0 -0
  101. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/commit_parser/_base.py +0 -0
  102. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/commit_parser/tag.py +0 -0
  103. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/const.py +0 -0
  104. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/data/templates/angular/md/.components/changelog_header.md.j2 +0 -0
  105. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/data/templates/angular/md/.components/changelog_init.md.j2 +0 -0
  106. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/data/templates/angular/md/.components/changelog_update.md.j2 +0 -0
  107. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/data/templates/angular/md/.components/unreleased_changes.md.j2 +0 -0
  108. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/data/templates/angular/md/.components/versioned_changes.md.j2 +0 -0
  109. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/data/templates/angular/md/.release_notes.md.j2 +0 -0
  110. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/data/templates/angular/rst/.components/changelog_header.rst.j2 +0 -0
  111. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/data/templates/angular/rst/.components/changelog_init.rst.j2 +0 -0
  112. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/data/templates/angular/rst/.components/changelog_update.rst.j2 +0 -0
  113. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/data/templates/angular/rst/.components/unreleased_changes.rst.j2 +0 -0
  114. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/data/templates/angular/rst/.components/versioned_changes.rst.j2 +0 -0
  115. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/data/templates/angular/rst/CHANGELOG.rst.j2 +0 -0
  116. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/enums.py +0 -0
  117. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/errors.py +0 -0
  118. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/gitproject.py +0 -0
  119. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/globals.py +0 -0
  120. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/helpers.py +0 -0
  121. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/hvcs/__init__.py +0 -0
  122. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/hvcs/_base.py +0 -0
  123. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/hvcs/bitbucket.py +0 -0
  124. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/hvcs/gitea.py +0 -0
  125. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/hvcs/github.py +0 -0
  126. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/hvcs/gitlab.py +0 -0
  127. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/hvcs/remote_hvcs_base.py +0 -0
  128. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/hvcs/token_auth.py +0 -0
  129. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/hvcs/util.py +0 -0
  130. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/version/__init__.py +0 -0
  131. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/version/algorithm.py +0 -0
  132. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/version/declaration.py +0 -0
  133. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/version/translator.py +0 -0
  134. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/src/semantic_release/version/version.py +0 -0
  135. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/__init__.py +0 -0
  136. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/conftest.py +0 -0
  137. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/__init__.py +0 -0
  138. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/cmd_changelog/__init__.py +0 -0
  139. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/cmd_config/__init__.py +0 -0
  140. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/cmd_config/test_generate_config.py +0 -0
  141. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/cmd_publish/__init__.py +0 -0
  142. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/cmd_version/__init__.py +0 -0
  143. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/e2e/conftest.py +0 -0
  144. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/fixtures/__init__.py +0 -0
  145. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/fixtures/commit_parsers.py +0 -0
  146. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/fixtures/example_project.py +0 -0
  147. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/fixtures/repos/__init__.py +0 -0
  148. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/fixtures/repos/git_flow/__init__.py +0 -0
  149. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/fixtures/repos/trunk_based_dev/__init__.py +0 -0
  150. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/fixtures/scipy.py +0 -0
  151. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/__init__.py +0 -0
  152. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/conftest.py +0 -0
  153. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/__init__.py +0 -0
  154. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/changelog/__init__.py +0 -0
  155. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/changelog/test_changelog_context.py +0 -0
  156. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/changelog/test_template.py +0 -0
  157. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/changelog/test_template_render.py +0 -0
  158. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/cli/__init__.py +0 -0
  159. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/cli/test_github_actions_output.py +0 -0
  160. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/cli/test_masking_filter.py +0 -0
  161. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/cli/test_util.py +0 -0
  162. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/cli/test_version.py +0 -0
  163. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/commit_parser/__init__.py +0 -0
  164. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/commit_parser/test_parsed_commit.py +0 -0
  165. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/commit_parser/test_util.py +0 -0
  166. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/hvcs/__init__.py +0 -0
  167. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/hvcs/test__base.py +0 -0
  168. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/hvcs/test_bitbucket.py +0 -0
  169. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/hvcs/test_gitea.py +0 -0
  170. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/hvcs/test_github.py +0 -0
  171. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/hvcs/test_gitlab.py +0 -0
  172. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/hvcs/test_token_auth.py +0 -0
  173. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/hvcs/test_util.py +0 -0
  174. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/test_helpers.py +0 -0
  175. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/version/__init__.py +0 -0
  176. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/version/test_algorithm.py +0 -0
  177. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/version/test_declaration.py +0 -0
  178. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/version/test_translator.py +0 -0
  179. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/unit/semantic_release/version/test_version.py +0 -0
  180. {python_semantic_release-9.12.2 → python_semantic_release-9.13.0}/tests/util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-semantic-release
3
- Version: 9.12.2
3
+ Version: 9.13.0
4
4
  Summary: Automatic Semantic Versioning for Python projects
5
5
  Author-email: Rolf Erik Lekang <me@rolflekang.com>
6
6
  License: MIT
@@ -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.12.2
340
+ - uses: python-semantic-release/python-semantic-release@v9.13.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.12.2
687
+ uses: python-semantic-release/python-semantic-release@v9.13.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.12.2
747
+ uses: python-semantic-release/python-semantic-release@v9.13.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.12.2
775
+ uses: python-semantic-release/python-semantic-release@v9.13.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.12.2
781
+ uses: python-semantic-release/python-semantic-release@v9.13.0
782
782
  with:
783
783
  directory: ./project2
784
784
  github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -512,60 +512,72 @@ the ``context`` object has the following attributes:
512
512
  Release History
513
513
  """""""""""""""
514
514
 
515
- A ``ReleaseHistory`` object has two attributes: ``released`` and ``unreleased``.
515
+ A :py:class:`ReleaseHistory <semantic_release.changelog.release_history.ReleaseHistory>`
516
+ object has two attributes: ``released`` and ``unreleased``.
516
517
 
517
518
  The ``unreleased`` attribute is of type ``Dict[str, List[ParseResult]]``. Each commit
518
519
  in the current branch's commit history since the last release on this branch is grouped
519
- by the ``type`` attribute of the ``ParsedCommit`` returned by the commit parser,
520
- or if the parser returned a ``ParseError`` then the result is grouped under the
521
- ``"unknown"`` key.
520
+ by the ``type`` attribute of the
521
+ :py:class:`ParsedCommit <semantic_release.commit_parser.token.ParsedCommit>`
522
+ returned by the commit parser, or if the parser returned a
523
+ :py:class:`ParseError <semantic_release.commit_parser.token.ParseError>`
524
+ then the result is grouped under the ``"unknown"`` key.
522
525
 
523
526
  For this reason, every element of ``ReleaseHistory.unreleased["unknown"]`` is a
524
- ``ParseError``, and every element of every other value in ``ReleaseHistory.unreleased``
525
- is of type ``ParsedCommit``.
527
+ :py:class:`ParseError <semantic_release.commit_parser.token.ParseError>`, and
528
+ every element of every other value in ``ReleaseHistory.unreleased`` is of type
529
+ :py:class:`ParsedCommit <semantic_release.commit_parser.token.ParsedCommit>`.
526
530
 
527
531
  Typically, commit types will be ``"feature"``, ``"fix"``, ``"breaking"``, though the
528
532
  specific types are determined by the parser. For example, the
529
- :py:class:`semantic_release.commit_parser.EmojiCommitParser` uses a textual
530
- representation of the emoji corresponding to the most significant change introduced
531
- in a commit (e.g. ``":boom:"``) as the different commit types. As a template author,
532
- you are free to customise how these are presented in the rendered template.
533
+ :py:class:`EmojiCommitParser <semantic_release.commit_parser.emoji.EmojiCommitParser>`
534
+ uses a textual representation of the emoji corresponding to the most significant change
535
+ introduced in a commit (e.g. ``":boom:"``) as the different commit types. As a template
536
+ author, you are free to customize how these are presented in the rendered template.
533
537
 
534
538
  .. note::
535
539
  If you are using a custom commit parser following the guide at
536
540
  :ref:`commit-parser-writing-your-own-parser`, your custom implementations of
537
- :py:class:`semantic_release.ParseResult`, :py:class:`semantic_release.ParseError`
538
- and :py:class:`semantic_release.ParsedCommit` will be used in place of the built-in
539
- types.
541
+ :py:class:`ParseResult <semantic_release.commit_parser.token.ParseResult>`,
542
+ :py:class:`ParseError <semantic_release.commit_parser.token.ParseError>`
543
+ and :py:class:`ParsedCommit <semantic_release.commit_parser.token.ParsedCommit>`
544
+ will be used in place of the built-in types.
540
545
 
541
546
  The ``released`` attribute is of type ``Dict[Version, Release]``. The keys of this
542
547
  dictionary correspond to each version released within this branch's history, and
543
- are of type ``semantic_release.Version``. You can use the ``as_tag()`` method to
544
- render these as the Git tag that they correspond to inside your template.
545
-
546
- A ``Release`` object has an ``elements`` attribute, which has the same
547
- structure as the ``unreleased`` attribute of a ``ReleaseHistory``; that is,
548
- ``elements`` is of type ``Dict[str, List[ParseResult]]``, where every element
549
- of ``elements["unknown"]`` is a ``ParseError``, and elements of every other
550
- value correspond to the ``type`` attribute of the ``ParsedCommit`` returned
548
+ are of type :py:class:`Version <semantic_release.version.version.Version>`. You can
549
+ use the ``as_tag()`` method to render these as the Git tag that they correspond to
550
+ inside your template.
551
+
552
+ A :py:class:`Release <semantic_release.changelog.release_history.Release>`object
553
+ has an ``elements`` attribute, which has the same structure as the ``unreleased``
554
+ attribute of a
555
+ :py:class:`ReleaseHistory <semantic_release.changelog.release_history.ReleaseHistory>`;
556
+ that is, ``elements`` is of type ``Dict[str, List[ParseResult]]``, where every element
557
+ of ``elements["unknown"]`` is a
558
+ :py:class:`ParseError <semantic_release.commit_parser.token.ParseError>`, and elements
559
+ of every other value correspond to the ``type`` attribute of the
560
+ :py:class:`ParsedCommit <semantic_release.commit_parser.token.ParsedCommit>` returned
551
561
  by the commit parser.
552
562
 
553
563
  The commits represented within each ``ReleaseHistory.released[version].elements``
554
- grouping are the commits which were made between ``version`` and the release
555
- corresponding to the previous version.
556
- That is, given two releases ``Version(1, 0, 0)`` and ``Version(1, 1, 0)``,
557
- ``ReleaseHistory.released[Version(1, 0, 0)].elements`` contains only commits
558
- made after the release of ``Version(1, 0, 0)`` up to and including the release
559
- of ``Version(1, 1, 0)``.
564
+ grouping are the commits which were made between version and the release corresponding
565
+ to the previous version. That is, given two releases ``Version(1, 0, 0)`` and
566
+ ``Version(1, 1, 0)``, ``ReleaseHistory.released[Version(1, 0, 0)].elements`` contains
567
+ only commits made after the release of ``Version(1, 0, 0)`` up to and including the
568
+ release of ``Version(1, 1, 0)``.
560
569
 
561
570
  To maintain a consistent order of subsections in the changelog headed by the commit
562
- type, it's recommended to use Jinja's `dictsort <https://jinja.palletsprojects.com/en/3.1.x/templates/#jinja-filters.dictsort>`_
571
+ type, it's recommended to use Jinja's
572
+ `dictsort <https://jinja.palletsprojects.com/en/3.1.x/templates/#jinja-filters.dictsort>`_
563
573
  filter.
564
574
 
565
575
  Each ``Release`` object also has the following attributes:
566
576
 
567
577
  * ``tagger: git.Actor``: The tagger who tagged the release.
578
+
568
579
  * ``committer: git.Actor``: The committer who made the release commit.
580
+
569
581
  * ``tagged_date: datetime``: The date and time at which the release was tagged.
570
582
 
571
583
  .. seealso::
@@ -724,11 +736,17 @@ The filters provided vary based on the VCS configured and available features:
724
736
 
725
737
  .. code:: jinja
726
738
 
727
- {{ "29" | merge_request_url }}
739
+ {{
740
+ "[%s](%s)" | format(
741
+ commit.linked_merge_request,
742
+ commit.linked_merge_request | merge_request_url
743
+ )
744
+ }}
745
+ {# commit.linked_merge_request is only available in v9.13.0 or greater #}
728
746
 
729
747
  .. code:: markdown
730
748
 
731
- https://example.com/example/repo/-/merge_requests/29
749
+ [#29](https://example.com/example/repo/-/merge_requests/29)
732
750
 
733
751
  * ``pull_request_url (Callable[[PullReqStr | PullReqInt], UrlStr])``: given a pull
734
752
  request number, return a URL to the pull request in the remote. For remote vcs'
@@ -743,11 +761,17 @@ The filters provided vary based on the VCS configured and available features:
743
761
 
744
762
  .. code:: jinja
745
763
 
746
- {{ "29" | pull_request_url }}
764
+ {{
765
+ "[%s](%s)" | format(
766
+ commit.linked_merge_request,
767
+ commit.linked_merge_request | pull_request_url
768
+ )
769
+ }}
770
+ {# commit.linked_merge_request is only available in v9.13.0 or greater #}
747
771
 
748
772
  .. code:: markdown
749
773
 
750
- https://example.com/example/repo/pull/29
774
+ [#29](https://example.com/example/repo/pull/29)
751
775
 
752
776
  * ``read_file (Callable[[str], str])``: given a file path, read the file and
753
777
  return the contents as a string. This function was added specifically to
@@ -883,12 +907,12 @@ exposed to the `Jinja`_ template when rendering the release notes.
883
907
 
884
908
  Additionally, the following two globals are available to the template:
885
909
 
886
- * ``release`` (:class:`Release <semantic_release.changelog.release_history.Release>`):
910
+ * ``release`` (:py:class:`Release <semantic_release.changelog.release_history.Release>`):
887
911
  contains metadata about the content of the release, as parsed from commit logs
888
912
 
889
913
  *Introduced in v8.0.0.*
890
914
 
891
- * ``version`` (:class:`Version <semantic_release.version.version.Version>`): contains
915
+ * ``version`` (:py:class:`Version <semantic_release.version.version.Version>`): contains
892
916
  metadata about the software version to be released and its ``git`` tag
893
917
 
894
918
  *Introduced in v8.0.0.*
@@ -45,9 +45,12 @@ The following parsers are built in to Python Semantic Release:
45
45
  ``semantic_release.commit_parser.AngularCommitParser``
46
46
  """"""""""""""""""""""""""""""""""""""""""""""""""""""
47
47
 
48
- The default parser, which uses the `Angular commit style <https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits>`_ with the following differences:
48
+ The default parser, which uses the
49
+ `Angular commit style <https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits>`_
50
+ with the following differences:
49
51
 
50
52
  - Multiple ``BREAKING CHANGE:`` paragraphs are supported
53
+
51
54
  - ``revert`` is not currently supported
52
55
 
53
56
  The default configuration options for
@@ -222,26 +225,41 @@ as the commit history of a repository is being parsed. Python Semantic Release d
222
225
  not raise an exception if a commit cannot be parsed.
223
226
 
224
227
  Python Semantic Release uses :py:class:`semantic_release.ParsedCommit`
225
- as the return type of a successful parse operation, and :py:class:`semantic_release.ParseError`
226
- as the return type from an unsuccessful parse of a commit. :py:class:`semantic_release.ParsedCommit` is a `namedtuple`_ which has the following fields:
227
-
228
- * bump: a :py:class:`semantic_release.LevelBump` indicating what type of change this commit introduces.
229
- * type: the *type* of the commit as a string, per the commit message style. This is up to the
230
- parser to implement; for example, the :py:class:`semantic_release.commit_parser.EmojiCommitParser`
231
- parser fills this field with the emoji representing the most significant change for the commit.
232
- The field is named after the representation in the Angular commit specification.
233
- * scope: The scope, as a string, parsed from the commit. Commit styles which do not have a meaningful
234
- concept of "scope" should fill this field with an empty string.
235
- * descriptions: A list of paragraphs (strings) (delimited by a double-newline) from the commit message.
236
- * breaking_descriptions: A list of paragraphs (strings) which are deemed to identify and describe
237
- breaking changes by the parser. An example would be a paragraph which begins with the text
238
- ``BREAKING CHANGE:``.
239
- * commit: The original commit object that was parsed.
228
+ as the return type of a successful parse operation, and
229
+ :py:class:`semantic_release.ParseError` as the return type from an unsuccessful
230
+ parse of a commit. :py:class:`semantic_release.ParsedCommit` is a `namedtuple`_
231
+ which has the following fields:
232
+
233
+ * **bump**: a :py:class:`semantic_release.LevelBump` indicating what type of change
234
+ this commit introduces.
235
+
236
+ * **type**: the *type* of the commit as a string, per the commit message style. This
237
+ is up to the parser to implement; for example, the
238
+ :py:class:`semantic_release.commit_parser.EmojiCommitParser` parser fills this field
239
+ with the emoji representing the most significant change for the commit. The field is
240
+ named after the representation in the Angular commit specification.
241
+
242
+ * **scope**: The scope, as a string, parsed from the commit. Commit styles which do
243
+ not have a meaningful concept of "scope" should fill this field with an empty string.
244
+
245
+ * **descriptions**: A list of paragraphs (strings) (delimited by a double-newline)
246
+ from the commit message.
247
+
248
+ * **breaking_descriptions**: A list of paragraphs (strings) which are deemed to
249
+ identify and describe breaking changes by the parser. An example would be a
250
+ paragraph which begins with the text ``BREAKING CHANGE:``.
251
+
252
+ * **commit**: The original commit object (a class defined by GitPython) that was parsed.
253
+
254
+ * **linked_merge_request**: A pull request or merge request definition, if the commit is
255
+ labeled with a pull/merge request number. This is a string value which includes any
256
+ special character prefix used by the VCS (e.g. ``#`` for GitLab, ``!`` for Bitbucket).
240
257
 
241
258
  :py:class:`semantic_release.ParseError` is a `namedtuple`_ which has the following fields:
242
259
 
243
- * commit: The original commit object that was parsed.
244
- * error: A string with a meaningful error message as to why the commit parsing failed.
260
+ * **commit**: The original commit object that was parsed.
261
+
262
+ * **error**: A string with a meaningful error message as to why the commit parsing failed.
245
263
 
246
264
  In addition, :py:class:`semantic_release.ParseError` implements an additional method, ``raise_error``.
247
265
  This method raises a :py:class:`semantic_release.CommitParseError` with the message contained in the
@@ -252,10 +270,12 @@ attributes available, each implemented as a ``property`` which is computed, as a
252
270
  convenience for template authors - therefore custom implementations should ensure
253
271
  these properties can also be computed:
254
272
 
255
- * message: the ``message`` attribute of the ``commit``; where the message is of type ``bytes``
256
- this should be decoded to a ``UTF-8`` string.
257
- * hexsha: the ``hexsha`` attribute of the ``commit``, representing its hash.
258
- * short_hash: the first 7 characters of the ``hexsha`` attribute of the ``commit``.
273
+ * **message**: the ``message`` attribute of the ``commit``; where the message is of type
274
+ ``bytes`` this should be decoded to a ``UTF-8`` string.
275
+
276
+ * **hexsha**: the ``hexsha`` attribute of the ``commit``, representing its hash.
277
+
278
+ * **short_hash**: the first 7 characters of the ``hexsha`` attribute of the ``commit``.
259
279
 
260
280
  In Python Semantic Release, the class :py:class:`semantic_release.ParseResult`
261
281
  is defined as ``ParseResultType[ParsedCommit, ParseError]``, as a convenient shorthand.
@@ -268,7 +288,9 @@ type returned on an unsuccessful parse of the ``commit``.
268
288
  A custom parser result type, therefore, could be implemented as follows:
269
289
 
270
290
  * ``MyParsedCommit`` subclasses ``ParsedCommit``
291
+
271
292
  * ``MyParseError`` subclasses ``ParseError``
293
+
272
294
  * ``MyParseResult = ParseResultType[MyParsedCommit, MyParseError]``
273
295
 
274
296
  Internally, Python Semantic Release uses ``isinstance`` to determine if the result
@@ -326,8 +348,10 @@ the following:
326
348
 
327
349
  * A class-level attribute ``parser_options``, which must be set to
328
350
  :py:class:`semantic_release.ParserOptions` or a subclass of this.
351
+
329
352
  * An ``__init__`` method which takes a single parameter, ``options``, that should be
330
353
  of the same type as the class' ``parser_options`` attribute.
354
+
331
355
  * A method, ``parse``, which takes a single parameter ``commit`` that is of type
332
356
  `git.objects.commit.Commit <gitpython-commit-object>`_, and returns
333
357
  :py:class:`semantic_release.token.ParseResult`, or a subclass of this.
@@ -38,7 +38,7 @@ htmlhelp_basename = "python-semantic-releasedoc"
38
38
 
39
39
  docs_path = os.path.dirname(__file__)
40
40
  apidoc_output_dir = os.path.join(docs_path, "api")
41
- apidoc_module_dir = os.path.join(docs_path, "..", "semantic_release")
41
+ apidoc_module_dir = os.path.join(docs_path, "..", "src")
42
42
  apidoc_separate_modules = True
43
43
  apidoc_module_first = True
44
44
  apidoc_extra_args = ["-d", "3"]
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "python-semantic-release"
9
- version = "9.12.2"
9
+ version = "9.13.0"
10
10
  description = "Automatic Semantic Versioning for Python projects"
11
11
  requires-python = ">=3.8"
12
12
  license = { text = "MIT" }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-semantic-release
3
- Version: 9.12.2
3
+ Version: 9.13.0
4
4
  Summary: Automatic Semantic Versioning for Python projects
5
5
  Author-email: Rolf Erik Lekang <me@rolflekang.com>
6
6
  License: MIT
@@ -68,6 +68,7 @@ src/semantic_release/data/templates/angular/md/.components/changelog_header.md.j
68
68
  src/semantic_release/data/templates/angular/md/.components/changelog_init.md.j2
69
69
  src/semantic_release/data/templates/angular/md/.components/changelog_update.md.j2
70
70
  src/semantic_release/data/templates/angular/md/.components/changes.md.j2
71
+ src/semantic_release/data/templates/angular/md/.components/macros.md.j2
71
72
  src/semantic_release/data/templates/angular/md/.components/unreleased_changes.md.j2
72
73
  src/semantic_release/data/templates/angular/md/.components/versioned_changes.md.j2
73
74
  src/semantic_release/data/templates/angular/rst/CHANGELOG.rst.j2
@@ -127,6 +128,7 @@ tests/fixtures/repos/git_flow/__init__.py
127
128
  tests/fixtures/repos/git_flow/repo_w_2_release_channels.py
128
129
  tests/fixtures/repos/git_flow/repo_w_3_release_channels.py
129
130
  tests/fixtures/repos/github_flow/__init__.py
131
+ tests/fixtures/repos/github_flow/repo_w_default_release.py
130
132
  tests/fixtures/repos/github_flow/repo_w_release_channels.py
131
133
  tests/fixtures/repos/trunk_based_dev/__init__.py
132
134
  tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py
@@ -24,7 +24,7 @@ from semantic_release.version import (
24
24
  tags_and_versions,
25
25
  )
26
26
 
27
- __version__ = "9.12.2"
27
+ __version__ = "9.13.0"
28
28
 
29
29
  __all__ = [
30
30
  "CommitParser",
@@ -8,19 +8,26 @@ from __future__ import annotations
8
8
  import logging
9
9
  import re
10
10
  from functools import reduce
11
+ from itertools import zip_longest
11
12
  from re import compile as regexp
12
13
  from typing import TYPE_CHECKING, Tuple
13
14
 
14
15
  from pydantic.dataclasses import dataclass
15
16
 
16
17
  from semantic_release.commit_parser._base import CommitParser, ParserOptions
17
- from semantic_release.commit_parser.token import ParsedCommit, ParseError, ParseResult
18
+ from semantic_release.commit_parser.token import (
19
+ ParsedCommit,
20
+ ParsedMessageResult,
21
+ ParseError,
22
+ ParseResult,
23
+ )
18
24
  from semantic_release.commit_parser.util import breaking_re, parse_paragraphs
19
25
  from semantic_release.enums import LevelBump
20
26
 
21
27
  if TYPE_CHECKING:
22
28
  from git.objects.commit import Commit
23
29
 
30
+
24
31
  logger = logging.getLogger(__name__)
25
32
 
26
33
 
@@ -65,11 +72,16 @@ class AngularParserOptions(ParserOptions):
65
72
  default_bump_level: LevelBump = LevelBump.NO_RELEASE
66
73
 
67
74
  def __post_init__(self) -> None:
68
- self.tag_to_level = {tag: self.default_bump_level for tag in self.allowed_tags}
69
- for tag in self.patch_tags:
70
- self.tag_to_level[tag] = LevelBump.PATCH
71
- for tag in self.minor_tags:
72
- self.tag_to_level[tag] = LevelBump.MINOR
75
+ self.tag_to_level: dict[str, LevelBump] = dict(
76
+ [
77
+ # we have to do a type ignore as zip_longest provides a type that is not specific enough
78
+ # for our expected output. Due to the empty second array, we know the first is always longest
79
+ # and that means no values in the first entry of the tuples will ever be a LevelBump.
80
+ *zip_longest(self.allowed_tags, (), fillvalue=self.default_bump_level), # type: ignore[list-item]
81
+ *zip_longest(self.patch_tags, (), fillvalue=LevelBump.PATCH), # type: ignore[list-item]
82
+ *zip_longest(self.minor_tags, (), fillvalue=LevelBump.MINOR), # type: ignore[list-item]
83
+ ]
84
+ )
73
85
 
74
86
 
75
87
  class AngularCommitParser(CommitParser[ParseResult, AngularParserOptions]):
@@ -98,6 +110,10 @@ class AngularCommitParser(CommitParser[ParseResult, AngularParserOptions]):
98
110
  ),
99
111
  flags=re.DOTALL,
100
112
  )
113
+ # GitHub & Gitea use (#123), GitLab uses (!123), and BitBucket uses (pull request #123)
114
+ self.mr_selector = regexp(
115
+ r"[\t ]+\((?:pull request )?(?P<mr_number>[#!]\d+)\)[\t ]*$"
116
+ )
101
117
 
102
118
  @staticmethod
103
119
  def get_default_options() -> AngularParserOptions:
@@ -114,27 +130,23 @@ class AngularCommitParser(CommitParser[ParseResult, AngularParserOptions]):
114
130
  accumulator["descriptions"].append(text)
115
131
  return accumulator
116
132
 
117
- # Maybe this can be cached as an optimization, similar to how
118
- # mypy/pytest use their own caching directories, for very large commit
119
- # histories?
120
- # The problem is the cache likely won't be present in CI environments
121
- def parse(self, commit: Commit) -> ParseResult:
122
- """
123
- Attempt to parse the commit message with a regular expression into a
124
- ParseResult
125
- """
126
- message = str(commit.message)
127
- parsed = self.re_parser.match(message)
128
- if not parsed:
129
- return _logged_parse_error(
130
- commit, f"Unable to parse commit message: {message}"
131
- )
133
+ def parse_message(self, message: str) -> ParsedMessageResult | None:
134
+ if not (parsed := self.re_parser.match(message)):
135
+ return None
136
+
132
137
  parsed_break = parsed.group("break")
133
138
  parsed_scope = parsed.group("scope")
134
139
  parsed_subject = parsed.group("subject")
135
140
  parsed_text = parsed.group("text")
136
141
  parsed_type = parsed.group("type")
137
142
 
143
+ linked_merge_request = ""
144
+ if mr_match := self.mr_selector.search(parsed_subject):
145
+ linked_merge_request = mr_match.group("mr_number")
146
+ # TODO: breaking change v10, removes PR number from subject/descriptions
147
+ # expects changelog template to format the line accordingly
148
+ # parsed_subject = self.pr_selector.sub("", parsed_subject).strip()
149
+
138
150
  body_components: dict[str, list[str]] = reduce(
139
151
  self.commit_body_components_separator,
140
152
  [
@@ -157,19 +169,34 @@ class AngularCommitParser(CommitParser[ParseResult, AngularParserOptions]):
157
169
  )
158
170
  )
159
171
 
160
- # TODO: remove in the future
161
- if level_bump == LevelBump.MAJOR:
162
- parsed_type = "breaking"
172
+ return ParsedMessageResult(
173
+ bump=level_bump,
174
+ type=parsed_type,
175
+ category=LONG_TYPE_NAMES.get(parsed_type, parsed_type),
176
+ scope=parsed_scope,
177
+ descriptions=tuple(body_components["descriptions"]),
178
+ breaking_descriptions=tuple(body_components["breaking_descriptions"]),
179
+ linked_merge_request=linked_merge_request,
180
+ )
181
+
182
+ # Maybe this can be cached as an optimization, similar to how
183
+ # mypy/pytest use their own caching directories, for very large commit
184
+ # histories?
185
+ # The problem is the cache likely won't be present in CI environments
186
+ def parse(self, commit: Commit) -> ParseResult:
187
+ """
188
+ Attempt to parse the commit message with a regular expression into a
189
+ ParseResult
190
+ """
191
+ if not (pmsg_result := self.parse_message(str(commit.message))):
192
+ return _logged_parse_error(
193
+ commit, f"Unable to parse commit message: {commit.message!r}"
194
+ )
163
195
 
164
196
  logger.debug(
165
- "commit %s introduces a %s level_bump", commit.hexsha[:8], level_bump
197
+ "commit %s introduces a %s level_bump",
198
+ commit.hexsha[:8],
199
+ pmsg_result.bump,
166
200
  )
167
201
 
168
- return ParsedCommit(
169
- bump=level_bump,
170
- type=LONG_TYPE_NAMES.get(parsed_type, parsed_type),
171
- scope=parsed_scope,
172
- descriptions=body_components["descriptions"],
173
- breaking_descriptions=body_components["breaking_descriptions"],
174
- commit=commit,
175
- )
202
+ return ParsedCommit.from_parsed_message_result(commit, pmsg_result)