python-semantic-release 9.12.1__tar.gz → 9.12.2__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 (175) hide show
  1. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/MANIFEST.in +1 -4
  2. {python_semantic_release-9.12.1/python_semantic_release.egg-info → python_semantic_release-9.12.2}/PKG-INFO +1 -1
  3. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/automatic-releases/github-actions.rst +5 -5
  4. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/changelog_templates.rst +14 -8
  5. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/configuration.rst +1 -1
  6. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/pyproject.toml +14 -11
  7. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src/python_semantic_release.egg-info}/PKG-INFO +1 -1
  8. python_semantic_release-9.12.2/src/python_semantic_release.egg-info/SOURCES.txt +170 -0
  9. python_semantic_release-9.12.2/src/python_semantic_release.egg-info/entry_points.txt +3 -0
  10. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/__init__.py +1 -1
  11. python_semantic_release-9.12.2/src/semantic_release/__main__.py +42 -0
  12. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/cli/commands/main.py +4 -0
  13. python_semantic_release-9.12.2/src/semantic_release/globals.py +6 -0
  14. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/hvcs/bitbucket.py +14 -1
  15. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/hvcs/gitea.py +27 -2
  16. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/hvcs/github.py +27 -2
  17. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/hvcs/gitlab.py +28 -4
  18. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/hvcs/test_bitbucket.py +2 -2
  19. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/hvcs/test_gitea.py +4 -4
  20. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/hvcs/test_github.py +4 -4
  21. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/hvcs/test_gitlab.py +5 -5
  22. python_semantic_release-9.12.1/python_semantic_release.egg-info/SOURCES.txt +0 -185
  23. python_semantic_release-9.12.1/python_semantic_release.egg-info/entry_points.txt +0 -3
  24. python_semantic_release-9.12.1/semantic_release/__main__.py +0 -6
  25. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/AUTHORS.rst +0 -0
  26. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/LICENSE +0 -0
  27. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/README.rst +0 -0
  28. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/Makefile +0 -0
  29. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/algorithm.rst +0 -0
  30. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/automatic-releases/cronjobs.rst +0 -0
  31. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/automatic-releases/index.rst +0 -0
  32. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/automatic-releases/travis.rst +0 -0
  33. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/commands.rst +0 -0
  34. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/commit-parsing.rst +0 -0
  35. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/conf.py +0 -0
  36. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/contributing.rst +0 -0
  37. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/contributors.rst +0 -0
  38. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/index.rst +0 -0
  39. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/make.bat +0 -0
  40. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/migrating_from_v7.rst +0 -0
  41. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/multibranch_releases.rst +0 -0
  42. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/strict_mode.rst +0 -0
  43. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/docs/troubleshooting.rst +0 -0
  44. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/setup.cfg +0 -0
  45. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/python_semantic_release.egg-info/dependency_links.txt +0 -0
  46. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/python_semantic_release.egg-info/requires.txt +0 -0
  47. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/python_semantic_release.egg-info/top_level.txt +0 -0
  48. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/changelog/__init__.py +0 -0
  49. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/changelog/context.py +0 -0
  50. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/changelog/release_history.py +0 -0
  51. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/changelog/template.py +0 -0
  52. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/cli/__init__.py +0 -0
  53. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/cli/changelog_writer.py +0 -0
  54. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/cli/cli_context.py +0 -0
  55. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/cli/commands/__init__.py +0 -0
  56. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/cli/commands/changelog.py +0 -0
  57. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/cli/commands/generate_config.py +0 -0
  58. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/cli/commands/publish.py +0 -0
  59. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/cli/commands/version.py +0 -0
  60. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/cli/config.py +0 -0
  61. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/cli/const.py +0 -0
  62. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/cli/github_actions_output.py +0 -0
  63. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/cli/masking_filter.py +0 -0
  64. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/cli/util.py +0 -0
  65. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/commit_parser/__init__.py +0 -0
  66. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/commit_parser/_base.py +0 -0
  67. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/commit_parser/angular.py +0 -0
  68. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/commit_parser/emoji.py +0 -0
  69. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/commit_parser/scipy.py +0 -0
  70. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/commit_parser/tag.py +0 -0
  71. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/commit_parser/token.py +0 -0
  72. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/commit_parser/util.py +0 -0
  73. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/const.py +0 -0
  74. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/data/templates/angular/md/.components/changelog_header.md.j2 +0 -0
  75. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/data/templates/angular/md/.components/changelog_init.md.j2 +0 -0
  76. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/data/templates/angular/md/.components/changelog_update.md.j2 +0 -0
  77. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/data/templates/angular/md/.components/changes.md.j2 +0 -0
  78. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/data/templates/angular/md/.components/unreleased_changes.md.j2 +0 -0
  79. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/data/templates/angular/md/.components/versioned_changes.md.j2 +0 -0
  80. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/data/templates/angular/md/.release_notes.md.j2 +0 -0
  81. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/data/templates/angular/md/CHANGELOG.md.j2 +0 -0
  82. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/data/templates/angular/rst/.components/changelog_header.rst.j2 +0 -0
  83. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/data/templates/angular/rst/.components/changelog_init.rst.j2 +0 -0
  84. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/data/templates/angular/rst/.components/changelog_update.rst.j2 +0 -0
  85. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/data/templates/angular/rst/.components/changes.rst.j2 +0 -0
  86. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/data/templates/angular/rst/.components/macros.rst.j2 +0 -0
  87. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/data/templates/angular/rst/.components/unreleased_changes.rst.j2 +0 -0
  88. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/data/templates/angular/rst/.components/versioned_changes.rst.j2 +0 -0
  89. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/data/templates/angular/rst/CHANGELOG.rst.j2 +0 -0
  90. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/enums.py +0 -0
  91. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/errors.py +0 -0
  92. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/gitproject.py +0 -0
  93. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/helpers.py +0 -0
  94. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/hvcs/__init__.py +0 -0
  95. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/hvcs/_base.py +0 -0
  96. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/hvcs/remote_hvcs_base.py +0 -0
  97. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/hvcs/token_auth.py +0 -0
  98. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/hvcs/util.py +0 -0
  99. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/version/__init__.py +0 -0
  100. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/version/algorithm.py +0 -0
  101. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/version/declaration.py +0 -0
  102. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/version/translator.py +0 -0
  103. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2/src}/semantic_release/version/version.py +0 -0
  104. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/__init__.py +0 -0
  105. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/conftest.py +0 -0
  106. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/const.py +0 -0
  107. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/__init__.py +0 -0
  108. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/cmd_changelog/__init__.py +0 -0
  109. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/cmd_changelog/test_changelog.py +0 -0
  110. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/cmd_config/__init__.py +0 -0
  111. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/cmd_config/test_generate_config.py +0 -0
  112. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/cmd_publish/__init__.py +0 -0
  113. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/cmd_publish/test_publish.py +0 -0
  114. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/cmd_version/__init__.py +0 -0
  115. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/cmd_version/test_version.py +0 -0
  116. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/cmd_version/test_version_build.py +0 -0
  117. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/cmd_version/test_version_bump.py +0 -0
  118. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/cmd_version/test_version_changelog.py +0 -0
  119. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/cmd_version/test_version_github_actions.py +0 -0
  120. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/cmd_version/test_version_print.py +0 -0
  121. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/cmd_version/test_version_release_notes.py +0 -0
  122. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/cmd_version/test_version_stamp.py +0 -0
  123. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/cmd_version/test_version_strict.py +0 -0
  124. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/conftest.py +0 -0
  125. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/test_help.py +0 -0
  126. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/e2e/test_main.py +0 -0
  127. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/fixtures/__init__.py +0 -0
  128. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/fixtures/commit_parsers.py +0 -0
  129. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/fixtures/example_project.py +0 -0
  130. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/fixtures/git_repo.py +0 -0
  131. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/fixtures/repos/__init__.py +0 -0
  132. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/fixtures/repos/git_flow/__init__.py +0 -0
  133. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py +0 -0
  134. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py +0 -0
  135. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/fixtures/repos/github_flow/__init__.py +0 -0
  136. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/fixtures/repos/github_flow/repo_w_release_channels.py +0 -0
  137. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/fixtures/repos/repo_initial_commit.py +0 -0
  138. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/fixtures/repos/trunk_based_dev/__init__.py +0 -0
  139. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py +0 -0
  140. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py +0 -0
  141. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py +0 -0
  142. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/fixtures/scipy.py +0 -0
  143. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/__init__.py +0 -0
  144. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/conftest.py +0 -0
  145. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/__init__.py +0 -0
  146. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/changelog/__init__.py +0 -0
  147. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/changelog/test_changelog_context.py +0 -0
  148. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/changelog/test_default_changelog.py +0 -0
  149. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/changelog/test_release_history.py +0 -0
  150. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/changelog/test_release_notes.py +0 -0
  151. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/changelog/test_template.py +0 -0
  152. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/changelog/test_template_render.py +0 -0
  153. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/cli/__init__.py +0 -0
  154. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/cli/test_config.py +0 -0
  155. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/cli/test_github_actions_output.py +0 -0
  156. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/cli/test_masking_filter.py +0 -0
  157. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/cli/test_util.py +0 -0
  158. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/cli/test_version.py +0 -0
  159. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/commit_parser/__init__.py +0 -0
  160. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/commit_parser/test_angular.py +0 -0
  161. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/commit_parser/test_emoji.py +0 -0
  162. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/commit_parser/test_parsed_commit.py +0 -0
  163. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/commit_parser/test_scipy.py +0 -0
  164. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/commit_parser/test_util.py +0 -0
  165. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/hvcs/__init__.py +0 -0
  166. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/hvcs/test__base.py +0 -0
  167. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/hvcs/test_token_auth.py +0 -0
  168. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/hvcs/test_util.py +0 -0
  169. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/test_helpers.py +0 -0
  170. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/version/__init__.py +0 -0
  171. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/version/test_algorithm.py +0 -0
  172. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/version/test_declaration.py +0 -0
  173. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/version/test_translator.py +0 -0
  174. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/unit/semantic_release/version/test_version.py +0 -0
  175. {python_semantic_release-9.12.1 → python_semantic_release-9.12.2}/tests/util.py +0 -0
@@ -1,8 +1,5 @@
1
- # Make sure Jinja templates are included
2
- recursive-include ./ *.j2
3
-
4
1
  # Make sure non-python files are included
5
- graft semantic_release/data
2
+ graft src/**/data/
6
3
 
7
4
  # include docs & testing into sdist, ignored for wheel build
8
5
  graft tests/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-semantic-release
3
- Version: 9.12.1
3
+ Version: 9.12.2
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.1
340
+ - uses: python-semantic-release/python-semantic-release@v9.12.2
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.1
687
+ uses: python-semantic-release/python-semantic-release@v9.12.2
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.1
747
+ uses: python-semantic-release/python-semantic-release@v9.12.2
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.1
775
+ uses: python-semantic-release/python-semantic-release@v9.12.2
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.1
781
+ uses: python-semantic-release/python-semantic-release@v9.12.2
782
782
  with:
783
783
  directory: ./project2
784
784
  github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -694,10 +694,12 @@ The filters provided vary based on the VCS configured and available features:
694
694
 
695
695
  https://example.com/example/repo/compare/v1.0.0...v1.1.0
696
696
 
697
- * ``issue_url (Callable[[IssueNumStr | IssueNumInt], UrlStr])``: given an issue number, return
698
- a URL to the issue on the remote vcs.
697
+ * ``issue_url (Callable[[IssueNumStr | IssueNumInt], UrlStr])``: given an issue
698
+ number, return a URL to the issue on the remote vcs. In v9.12.2, this filter
699
+ was updated to handle a string that has leading prefix symbols (ex. ``#29``)
700
+ and will strip the prefix before generating the URL.
699
701
 
700
- *Introduced in v9.6.0.*
702
+ *Introduced in v9.6.0, Modified in v9.12.2.*
701
703
 
702
704
  **Example Usage:**
703
705
 
@@ -712,9 +714,11 @@ The filters provided vary based on the VCS configured and available features:
712
714
  * ``merge_request_url (Callable[[MergeReqStr | MergeReqInt], UrlStr])``: given a
713
715
  merge request number, return a URL to the merge request in the remote. This is
714
716
  an alias to the ``pull_request_url`` but only available for the VCS that uses
715
- the merge request terminology.
717
+ the merge request terminology. In v9.12.2, this filter was updated to handle
718
+ a string that has leading prefix symbols (ex. ``#29``) and will strip the prefix
719
+ before generating the URL.
716
720
 
717
- *Introduced in v9.6.0.*
721
+ *Introduced in v9.6.0, Modified in v9.12.2.*
718
722
 
719
723
  **Example Usage:**
720
724
 
@@ -729,9 +733,11 @@ The filters provided vary based on the VCS configured and available features:
729
733
  * ``pull_request_url (Callable[[PullReqStr | PullReqInt], UrlStr])``: given a pull
730
734
  request number, return a URL to the pull request in the remote. For remote vcs'
731
735
  that use merge request terminology, this filter is an alias to the
732
- ``merge_request_url`` filter function.
736
+ ``merge_request_url`` filter function. In v9.12.2, this filter was updated to
737
+ handle a string that has leading prefix symbols (ex. ``#29``) and will strip
738
+ the prefix before generating the URL.
733
739
 
734
- *Introduced in v9.6.0.*
740
+ *Introduced in v9.6.0, Modified in v9.12.2.*
735
741
 
736
742
  **Example Usage:**
737
743
 
@@ -1009,7 +1015,7 @@ primarily you should review the embedded default templates in the PSR package
1009
1015
  for a full example. You can find the default templates at `data/templates/`__
1010
1016
  directory.
1011
1017
 
1012
- __ https://github.com/python-semantic-release/python-semantic-release/tree/master/semantic_release/data/templates
1018
+ __ https://github.com/python-semantic-release/python-semantic-release/tree/master/src/semantic_release/data/templates
1013
1019
 
1014
1020
  1. **Add a conditional to check the changelog_mode.** This will allow you
1015
1021
  to determine if you should render the entire changelog or just the new
@@ -1252,7 +1252,7 @@ specified in ``file:variable`` format. For example:
1252
1252
 
1253
1253
  [semantic_release]
1254
1254
  version_variables = [
1255
- "semantic_release/__init__.py:__version__",
1255
+ "src/semantic_release/__init__.py:__version__",
1256
1256
  "docs/conf.py:version",
1257
1257
  ]
1258
1258
 
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "python-semantic-release"
9
- version = "9.12.1"
9
+ version = "9.12.2"
10
10
  description = "Automatic Semantic Versioning for Python projects"
11
11
  requires-python = ">=3.8"
12
12
  license = { text = "MIT" }
@@ -37,8 +37,8 @@ dependencies = [
37
37
  ]
38
38
 
39
39
  [project.scripts]
40
- semantic-release = "semantic_release.cli.commands.main:main"
41
- psr = "semantic_release.cli.commands.main:main"
40
+ semantic-release = "semantic_release.__main__:main"
41
+ psr = "semantic_release.__main__:main"
42
42
 
43
43
  [project.urls]
44
44
  changelog = "https://github.com/python-semantic-release/python-semantic-release/blob/master/CHANGELOG.md"
@@ -83,8 +83,12 @@ mypy = [
83
83
  ]
84
84
 
85
85
 
86
- [tool.setuptools.package-dir]
87
- semantic_release = "semantic_release"
86
+ [tool.setuptools]
87
+ include-package-data = true
88
+
89
+
90
+ [tool.setuptools.packages.find]
91
+ where = ["src"]
88
92
 
89
93
 
90
94
  [tool.pytest.ini_options]
@@ -145,7 +149,7 @@ commands =
145
149
  [testenv:mypy]
146
150
  deps = .[mypy]
147
151
  commands =
148
- mypy semantic_release
152
+ mypy src/
149
153
 
150
154
  [testenv:coverage]
151
155
  deps = coverage[toml]
@@ -162,7 +166,6 @@ commands =
162
166
 
163
167
  [tool.mypy]
164
168
  python_version = "3.8"
165
- packages = ["semantic_release"]
166
169
  show_column_numbers = true
167
170
  show_error_context = true
168
171
  pretty = true
@@ -311,11 +314,11 @@ quote-style = "double"
311
314
  # Imported but unused
312
315
  "__init__.py" = ["F401"]
313
316
  # pydantic 1 can't handle __future__ annotations-enabled syntax on < 3.10
314
- "semantic_release/cli/config.py" = ["UP", "TCH"]
315
- "semantic_release/commit_parser/*" = ["UP", "FA", "TCH"]
317
+ "src/semantic_release/cli/config.py" = ["UP", "TCH"]
318
+ "src/semantic_release/commit_parser/*" = ["UP", "FA", "TCH"]
316
319
  # Method argument not used. This is mostly a base class
317
320
  # anyway
318
- "semantic_release/hvcs/_base.py" = ["ARG002"]
321
+ "src/semantic_release/hvcs/_base.py" = ["ARG002"]
319
322
  # from tests.fixtures import * is deliberate
320
323
  "tests/conftest.py" = ["F403"]
321
324
  "tests/fixtures/**/__init__.py" = ["F403"]
@@ -394,7 +397,7 @@ build_command = """
394
397
  python -m build .
395
398
  """
396
399
  major_on_zero = true
397
- version_variables = ["semantic_release/__init__.py:__version__"]
400
+ version_variables = ["src/semantic_release/__init__.py:__version__"]
398
401
  version_toml = ["pyproject.toml:project.version"]
399
402
 
400
403
  [tool.semantic_release.changelog]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-semantic-release
3
- Version: 9.12.1
3
+ Version: 9.12.2
4
4
  Summary: Automatic Semantic Versioning for Python projects
5
5
  Author-email: Rolf Erik Lekang <me@rolflekang.com>
6
6
  License: MIT
@@ -0,0 +1,170 @@
1
+ AUTHORS.rst
2
+ LICENSE
3
+ MANIFEST.in
4
+ README.rst
5
+ pyproject.toml
6
+ docs/Makefile
7
+ docs/algorithm.rst
8
+ docs/changelog_templates.rst
9
+ docs/commands.rst
10
+ docs/commit-parsing.rst
11
+ docs/conf.py
12
+ docs/configuration.rst
13
+ docs/contributing.rst
14
+ docs/contributors.rst
15
+ docs/index.rst
16
+ docs/make.bat
17
+ docs/migrating_from_v7.rst
18
+ docs/multibranch_releases.rst
19
+ docs/strict_mode.rst
20
+ docs/troubleshooting.rst
21
+ docs/automatic-releases/cronjobs.rst
22
+ docs/automatic-releases/github-actions.rst
23
+ docs/automatic-releases/index.rst
24
+ docs/automatic-releases/travis.rst
25
+ src/python_semantic_release.egg-info/PKG-INFO
26
+ src/python_semantic_release.egg-info/SOURCES.txt
27
+ src/python_semantic_release.egg-info/dependency_links.txt
28
+ src/python_semantic_release.egg-info/entry_points.txt
29
+ src/python_semantic_release.egg-info/requires.txt
30
+ src/python_semantic_release.egg-info/top_level.txt
31
+ src/semantic_release/__init__.py
32
+ src/semantic_release/__main__.py
33
+ src/semantic_release/const.py
34
+ src/semantic_release/enums.py
35
+ src/semantic_release/errors.py
36
+ src/semantic_release/gitproject.py
37
+ src/semantic_release/globals.py
38
+ src/semantic_release/helpers.py
39
+ src/semantic_release/changelog/__init__.py
40
+ src/semantic_release/changelog/context.py
41
+ src/semantic_release/changelog/release_history.py
42
+ src/semantic_release/changelog/template.py
43
+ src/semantic_release/cli/__init__.py
44
+ src/semantic_release/cli/changelog_writer.py
45
+ src/semantic_release/cli/cli_context.py
46
+ src/semantic_release/cli/config.py
47
+ src/semantic_release/cli/const.py
48
+ src/semantic_release/cli/github_actions_output.py
49
+ src/semantic_release/cli/masking_filter.py
50
+ src/semantic_release/cli/util.py
51
+ src/semantic_release/cli/commands/__init__.py
52
+ src/semantic_release/cli/commands/changelog.py
53
+ src/semantic_release/cli/commands/generate_config.py
54
+ src/semantic_release/cli/commands/main.py
55
+ src/semantic_release/cli/commands/publish.py
56
+ src/semantic_release/cli/commands/version.py
57
+ src/semantic_release/commit_parser/__init__.py
58
+ src/semantic_release/commit_parser/_base.py
59
+ src/semantic_release/commit_parser/angular.py
60
+ src/semantic_release/commit_parser/emoji.py
61
+ src/semantic_release/commit_parser/scipy.py
62
+ src/semantic_release/commit_parser/tag.py
63
+ src/semantic_release/commit_parser/token.py
64
+ src/semantic_release/commit_parser/util.py
65
+ src/semantic_release/data/templates/angular/md/.release_notes.md.j2
66
+ src/semantic_release/data/templates/angular/md/CHANGELOG.md.j2
67
+ src/semantic_release/data/templates/angular/md/.components/changelog_header.md.j2
68
+ src/semantic_release/data/templates/angular/md/.components/changelog_init.md.j2
69
+ src/semantic_release/data/templates/angular/md/.components/changelog_update.md.j2
70
+ src/semantic_release/data/templates/angular/md/.components/changes.md.j2
71
+ src/semantic_release/data/templates/angular/md/.components/unreleased_changes.md.j2
72
+ src/semantic_release/data/templates/angular/md/.components/versioned_changes.md.j2
73
+ src/semantic_release/data/templates/angular/rst/CHANGELOG.rst.j2
74
+ src/semantic_release/data/templates/angular/rst/.components/changelog_header.rst.j2
75
+ src/semantic_release/data/templates/angular/rst/.components/changelog_init.rst.j2
76
+ src/semantic_release/data/templates/angular/rst/.components/changelog_update.rst.j2
77
+ src/semantic_release/data/templates/angular/rst/.components/changes.rst.j2
78
+ src/semantic_release/data/templates/angular/rst/.components/macros.rst.j2
79
+ src/semantic_release/data/templates/angular/rst/.components/unreleased_changes.rst.j2
80
+ src/semantic_release/data/templates/angular/rst/.components/versioned_changes.rst.j2
81
+ src/semantic_release/hvcs/__init__.py
82
+ src/semantic_release/hvcs/_base.py
83
+ src/semantic_release/hvcs/bitbucket.py
84
+ src/semantic_release/hvcs/gitea.py
85
+ src/semantic_release/hvcs/github.py
86
+ src/semantic_release/hvcs/gitlab.py
87
+ src/semantic_release/hvcs/remote_hvcs_base.py
88
+ src/semantic_release/hvcs/token_auth.py
89
+ src/semantic_release/hvcs/util.py
90
+ src/semantic_release/version/__init__.py
91
+ src/semantic_release/version/algorithm.py
92
+ src/semantic_release/version/declaration.py
93
+ src/semantic_release/version/translator.py
94
+ src/semantic_release/version/version.py
95
+ tests/__init__.py
96
+ tests/conftest.py
97
+ tests/const.py
98
+ tests/util.py
99
+ tests/e2e/__init__.py
100
+ tests/e2e/conftest.py
101
+ tests/e2e/test_help.py
102
+ tests/e2e/test_main.py
103
+ tests/e2e/cmd_changelog/__init__.py
104
+ tests/e2e/cmd_changelog/test_changelog.py
105
+ tests/e2e/cmd_config/__init__.py
106
+ tests/e2e/cmd_config/test_generate_config.py
107
+ tests/e2e/cmd_publish/__init__.py
108
+ tests/e2e/cmd_publish/test_publish.py
109
+ tests/e2e/cmd_version/__init__.py
110
+ tests/e2e/cmd_version/test_version.py
111
+ tests/e2e/cmd_version/test_version_build.py
112
+ tests/e2e/cmd_version/test_version_bump.py
113
+ tests/e2e/cmd_version/test_version_changelog.py
114
+ tests/e2e/cmd_version/test_version_github_actions.py
115
+ tests/e2e/cmd_version/test_version_print.py
116
+ tests/e2e/cmd_version/test_version_release_notes.py
117
+ tests/e2e/cmd_version/test_version_stamp.py
118
+ tests/e2e/cmd_version/test_version_strict.py
119
+ tests/fixtures/__init__.py
120
+ tests/fixtures/commit_parsers.py
121
+ tests/fixtures/example_project.py
122
+ tests/fixtures/git_repo.py
123
+ tests/fixtures/scipy.py
124
+ tests/fixtures/repos/__init__.py
125
+ tests/fixtures/repos/repo_initial_commit.py
126
+ tests/fixtures/repos/git_flow/__init__.py
127
+ tests/fixtures/repos/git_flow/repo_w_2_release_channels.py
128
+ tests/fixtures/repos/git_flow/repo_w_3_release_channels.py
129
+ tests/fixtures/repos/github_flow/__init__.py
130
+ tests/fixtures/repos/github_flow/repo_w_release_channels.py
131
+ tests/fixtures/repos/trunk_based_dev/__init__.py
132
+ tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py
133
+ tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py
134
+ tests/fixtures/repos/trunk_based_dev/repo_w_tags.py
135
+ tests/unit/__init__.py
136
+ tests/unit/conftest.py
137
+ tests/unit/semantic_release/__init__.py
138
+ tests/unit/semantic_release/test_helpers.py
139
+ tests/unit/semantic_release/changelog/__init__.py
140
+ tests/unit/semantic_release/changelog/test_changelog_context.py
141
+ tests/unit/semantic_release/changelog/test_default_changelog.py
142
+ tests/unit/semantic_release/changelog/test_release_history.py
143
+ tests/unit/semantic_release/changelog/test_release_notes.py
144
+ tests/unit/semantic_release/changelog/test_template.py
145
+ tests/unit/semantic_release/changelog/test_template_render.py
146
+ tests/unit/semantic_release/cli/__init__.py
147
+ tests/unit/semantic_release/cli/test_config.py
148
+ tests/unit/semantic_release/cli/test_github_actions_output.py
149
+ tests/unit/semantic_release/cli/test_masking_filter.py
150
+ tests/unit/semantic_release/cli/test_util.py
151
+ tests/unit/semantic_release/cli/test_version.py
152
+ tests/unit/semantic_release/commit_parser/__init__.py
153
+ tests/unit/semantic_release/commit_parser/test_angular.py
154
+ tests/unit/semantic_release/commit_parser/test_emoji.py
155
+ tests/unit/semantic_release/commit_parser/test_parsed_commit.py
156
+ tests/unit/semantic_release/commit_parser/test_scipy.py
157
+ tests/unit/semantic_release/commit_parser/test_util.py
158
+ tests/unit/semantic_release/hvcs/__init__.py
159
+ tests/unit/semantic_release/hvcs/test__base.py
160
+ tests/unit/semantic_release/hvcs/test_bitbucket.py
161
+ tests/unit/semantic_release/hvcs/test_gitea.py
162
+ tests/unit/semantic_release/hvcs/test_github.py
163
+ tests/unit/semantic_release/hvcs/test_gitlab.py
164
+ tests/unit/semantic_release/hvcs/test_token_auth.py
165
+ tests/unit/semantic_release/hvcs/test_util.py
166
+ tests/unit/semantic_release/version/__init__.py
167
+ tests/unit/semantic_release/version/test_algorithm.py
168
+ tests/unit/semantic_release/version/test_declaration.py
169
+ tests/unit/semantic_release/version/test_translator.py
170
+ tests/unit/semantic_release/version/test_version.py
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ psr = semantic_release.__main__:main
3
+ semantic-release = semantic_release.__main__:main
@@ -24,7 +24,7 @@ from semantic_release.version import (
24
24
  tags_and_versions,
25
25
  )
26
26
 
27
- __version__ = "9.12.1"
27
+ __version__ = "9.12.2"
28
28
 
29
29
  __all__ = [
30
30
  "CommitParser",
@@ -0,0 +1,42 @@
1
+ """Entrypoint for the `semantic-release` module."""
2
+ # ruff: noqa: T201, print statements are fine here as this is for cli entry only
3
+
4
+ from __future__ import annotations
5
+
6
+ import sys
7
+ from traceback import format_exception
8
+
9
+ from semantic_release import globals
10
+ from semantic_release.cli.commands.main import main as cli_main
11
+
12
+
13
+ def main() -> None:
14
+ try:
15
+ cli_main(args=sys.argv[1:])
16
+ print("semantic-release completed successfully.", file=sys.stderr)
17
+ except KeyboardInterrupt:
18
+ print("\n-- User Abort! --", file=sys.stderr)
19
+ sys.exit(127)
20
+ except Exception as err: # noqa: BLE001, graceful error handling across application
21
+ if globals.debug:
22
+ print(f"{err.__class__.__name__}: {err}\n", file=sys.stderr)
23
+ etype, value, traceback = sys.exc_info()
24
+ print(
25
+ str.join(
26
+ "",
27
+ format_exception(
28
+ etype,
29
+ value,
30
+ traceback,
31
+ limit=None,
32
+ chain=True,
33
+ )[:-1],
34
+ ),
35
+ file=sys.stderr,
36
+ )
37
+ print(f"::ERROR:: {err}", file=sys.stderr)
38
+ sys.exit(1)
39
+
40
+
41
+ if __name__ == "__main__":
42
+ main()
@@ -10,6 +10,7 @@ from rich.console import Console
10
10
  from rich.logging import RichHandler
11
11
 
12
12
  import semantic_release
13
+ from semantic_release import globals
13
14
  from semantic_release.cli.cli_context import CliContextObj
14
15
  from semantic_release.cli.config import GlobalCommandLineOptions
15
16
  from semantic_release.cli.const import DEFAULT_CONFIG_FILE
@@ -122,6 +123,9 @@ def main(
122
123
  logger = logging.getLogger(__name__)
123
124
  logger.debug("logging level set to: %s", logging.getLevelName(log_level))
124
125
 
126
+ if log_level == logging.DEBUG:
127
+ globals.debug = True
128
+
125
129
  if noop:
126
130
  rprint(
127
131
  ":shield: [bold cyan]You are running in no-operation mode, because the "
@@ -0,0 +1,6 @@
1
+ """Semantic Release Global Variables."""
2
+
3
+ from __future__ import annotations
4
+
5
+ debug: bool = False
6
+ """bool: Enable debug level logging and runtime actions."""
@@ -9,6 +9,7 @@ import logging
9
9
  import os
10
10
  from functools import lru_cache
11
11
  from pathlib import PurePosixPath
12
+ from re import compile as regexp
12
13
  from typing import TYPE_CHECKING
13
14
 
14
15
  from urllib3.util.url import Url, parse_url
@@ -201,7 +202,19 @@ class Bitbucket(RemoteHvcsBase):
201
202
  return self.create_repo_url(repo_path=f"/commits/{commit_hash}")
202
203
 
203
204
  def pull_request_url(self, pr_number: str | int) -> str:
204
- return self.create_repo_url(repo_path=f"/pull-requests/{pr_number}")
205
+ # Strips off any character prefix like '#' that usually exists
206
+ if isinstance(pr_number, str) and (
207
+ match := regexp(r"(\d+)$").search(pr_number)
208
+ ):
209
+ try:
210
+ pr_number = int(match.group(1))
211
+ except ValueError:
212
+ return ""
213
+
214
+ if isinstance(pr_number, int):
215
+ return self.create_repo_url(repo_path=f"/pull-requests/{pr_number}")
216
+
217
+ return ""
205
218
 
206
219
  def get_changelog_context_filters(self) -> tuple[Callable[..., Any], ...]:
207
220
  return (
@@ -6,6 +6,7 @@ import glob
6
6
  import logging
7
7
  import os
8
8
  from pathlib import PurePosixPath
9
+ from re import compile as regexp
9
10
  from typing import TYPE_CHECKING
10
11
 
11
12
  from requests import HTTPError, JSONDecodeError
@@ -350,10 +351,34 @@ class Gitea(RemoteHvcsBase):
350
351
  return self.create_repo_url(repo_path=f"/commit/{commit_hash}")
351
352
 
352
353
  def issue_url(self, issue_num: str | int) -> str:
353
- return self.create_repo_url(repo_path=f"/issues/{issue_num}")
354
+ # Strips off any character prefix like '#' that usually exists
355
+ if isinstance(issue_num, str) and (
356
+ match := regexp(r"(\d+)$").search(issue_num)
357
+ ):
358
+ try:
359
+ issue_num = int(match.group(1))
360
+ except ValueError:
361
+ return ""
362
+
363
+ if isinstance(issue_num, int):
364
+ return self.create_repo_url(repo_path=f"/issues/{issue_num}")
365
+
366
+ return ""
354
367
 
355
368
  def pull_request_url(self, pr_number: str | int) -> str:
356
- return self.create_repo_url(repo_path=f"/pulls/{pr_number}")
369
+ # Strips off any character prefix like '#' that usually exists
370
+ if isinstance(pr_number, str) and (
371
+ match := regexp(r"(\d+)$").search(pr_number)
372
+ ):
373
+ try:
374
+ pr_number = int(match.group(1))
375
+ except ValueError:
376
+ return ""
377
+
378
+ if isinstance(pr_number, int):
379
+ return self.create_repo_url(repo_path=f"/pulls/{pr_number}")
380
+
381
+ return ""
357
382
 
358
383
  def get_changelog_context_filters(self) -> tuple[Callable[..., Any], ...]:
359
384
  return (
@@ -8,6 +8,7 @@ import mimetypes
8
8
  import os
9
9
  from functools import lru_cache
10
10
  from pathlib import PurePosixPath
11
+ from re import compile as regexp
11
12
  from typing import TYPE_CHECKING
12
13
 
13
14
  from requests import HTTPError, JSONDecodeError
@@ -501,10 +502,34 @@ class Github(RemoteHvcsBase):
501
502
  return self.create_repo_url(repo_path=f"/commit/{commit_hash}")
502
503
 
503
504
  def issue_url(self, issue_num: str | int) -> str:
504
- return self.create_repo_url(repo_path=f"/issues/{issue_num}")
505
+ # Strips off any character prefix like '#' that usually exists
506
+ if isinstance(issue_num, str) and (
507
+ match := regexp(r"(\d+)$").search(issue_num)
508
+ ):
509
+ try:
510
+ issue_num = int(match.group(1))
511
+ except ValueError:
512
+ return ""
513
+
514
+ if isinstance(issue_num, int):
515
+ return self.create_repo_url(repo_path=f"/issues/{issue_num}")
516
+
517
+ return ""
505
518
 
506
519
  def pull_request_url(self, pr_number: str | int) -> str:
507
- return self.create_repo_url(repo_path=f"/pull/{pr_number}")
520
+ # Strips off any character prefix like '#' that usually exists
521
+ if isinstance(pr_number, str) and (
522
+ match := regexp(r"(\d+)$").search(pr_number)
523
+ ):
524
+ try:
525
+ pr_number = int(match.group(1))
526
+ except ValueError:
527
+ return ""
528
+
529
+ if isinstance(pr_number, int):
530
+ return self.create_repo_url(repo_path=f"/pull/{pr_number}")
531
+
532
+ return ""
508
533
 
509
534
  def get_changelog_context_filters(self) -> tuple[Callable[..., Any], ...]:
510
535
  return (
@@ -6,6 +6,7 @@ import logging
6
6
  import os
7
7
  from functools import lru_cache
8
8
  from pathlib import PurePosixPath
9
+ from re import compile as regexp
9
10
  from typing import TYPE_CHECKING
10
11
 
11
12
  import gitlab
@@ -239,14 +240,37 @@ class Gitlab(RemoteHvcsBase):
239
240
  def commit_hash_url(self, commit_hash: str) -> str:
240
241
  return self.create_repo_url(repo_path=f"/-/commit/{commit_hash}")
241
242
 
242
- def issue_url(self, issue_number: str | int) -> str:
243
- return self.create_repo_url(repo_path=f"/-/issues/{issue_number}")
243
+ def issue_url(self, issue_num: str | int) -> str:
244
+ # Strips off any character prefix like '#' that usually exists
245
+ if isinstance(issue_num, str) and (
246
+ match := regexp(r"(\d+)$").search(issue_num)
247
+ ):
248
+ try:
249
+ issue_num = int(match.group(1))
250
+ except ValueError:
251
+ return ""
252
+
253
+ if isinstance(issue_num, int):
254
+ return self.create_repo_url(repo_path=f"/-/issues/{issue_num}")
255
+
256
+ return ""
244
257
 
245
258
  def merge_request_url(self, mr_number: str | int) -> str:
246
- return self.create_repo_url(repo_path=f"/-/merge_requests/{mr_number}")
259
+ # Strips off any character prefix like '!' that usually exists
260
+ if isinstance(mr_number, str) and (
261
+ match := regexp(r"(\d+)$").search(mr_number)
262
+ ):
263
+ try:
264
+ mr_number = int(match.group(1))
265
+ except ValueError:
266
+ return ""
267
+
268
+ if isinstance(mr_number, int):
269
+ return self.create_repo_url(repo_path=f"/-/merge_requests/{mr_number}")
270
+
271
+ return ""
247
272
 
248
273
  def pull_request_url(self, pr_number: str | int) -> str:
249
- # TODO: deprecate in v11, add warning in v10
250
274
  return self.merge_request_url(mr_number=pr_number)
251
275
 
252
276
  def upload_dists(self, tag: str, dist_glob: str) -> int:
@@ -301,13 +301,13 @@ def test_commit_hash_url(default_bitbucket_client: Bitbucket):
301
301
  assert expected_url == default_bitbucket_client.commit_hash_url(sha)
302
302
 
303
303
 
304
- @pytest.mark.parametrize("pr_number", (420, "420"))
304
+ @pytest.mark.parametrize("pr_number", (666, "666", "#666"))
305
305
  def test_pull_request_url(default_bitbucket_client: Bitbucket, pr_number: int | str):
306
306
  expected_url = "{server}/{owner}/{repo}/pull-requests/{pr_number}".format(
307
307
  server=default_bitbucket_client.hvcs_domain,
308
308
  owner=default_bitbucket_client.owner,
309
309
  repo=default_bitbucket_client.repo_name,
310
- pr_number=pr_number,
310
+ pr_number=str(pr_number).lstrip("#"),
311
311
  )
312
312
  actual_url = default_bitbucket_client.pull_request_url(pr_number=pr_number)
313
313
  assert expected_url == actual_url