python-semantic-release 9.5.0__tar.gz → 9.7.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 (152) hide show
  1. {python_semantic_release-9.5.0/python_semantic_release.egg-info → python_semantic_release-9.7.0}/PKG-INFO +3 -3
  2. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/changelog_templates.rst +43 -5
  3. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/commands.rst +85 -14
  4. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/configuration.rst +28 -4
  5. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/github-action.rst +5 -2
  6. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/multibranch_releases.rst +1 -1
  7. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/pyproject.toml +13 -10
  8. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0/python_semantic_release.egg-info}/PKG-INFO +3 -3
  9. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/python_semantic_release.egg-info/SOURCES.txt +3 -2
  10. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/python_semantic_release.egg-info/requires.txt +2 -2
  11. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/__init__.py +1 -1
  12. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/changelog/context.py +3 -1
  13. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/cli/commands/changelog.py +2 -1
  14. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/cli/commands/publish.py +8 -0
  15. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/cli/commands/version.py +113 -43
  16. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/cli/config.py +94 -19
  17. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/commit_parser/_base.py +13 -4
  18. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/commit_parser/angular.py +7 -2
  19. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/commit_parser/emoji.py +5 -0
  20. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/commit_parser/scipy.py +12 -13
  21. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/commit_parser/tag.py +5 -0
  22. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/errors.py +22 -1
  23. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/hvcs/__init__.py +10 -1
  24. python_semantic_release-9.7.0/semantic_release/hvcs/_base.py +83 -0
  25. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/hvcs/bitbucket.py +87 -140
  26. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/hvcs/gitea.py +61 -71
  27. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/hvcs/github.py +120 -156
  28. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/hvcs/gitlab.py +34 -76
  29. python_semantic_release-9.7.0/semantic_release/hvcs/remote_hvcs_base.py +193 -0
  30. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/command_line/test_version.py +109 -55
  31. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/conftest.py +12 -0
  32. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/const.py +1 -30
  33. python_semantic_release-9.7.0/tests/fixtures/commit_parsers.py +46 -0
  34. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/fixtures/example_project.py +54 -10
  35. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/fixtures/git_repo.py +4 -2
  36. python_semantic_release-9.7.0/tests/fixtures/scipy.py +437 -0
  37. python_semantic_release-9.7.0/tests/unit/semantic_release/changelog/test_changelog_context.py +337 -0
  38. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/changelog/test_default_changelog.py +16 -16
  39. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/cli/test_config.py +99 -5
  40. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/cli/test_util.py +12 -7
  41. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/commit_parser/test_angular.py +53 -37
  42. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/commit_parser/test_emoji.py +23 -23
  43. python_semantic_release-9.7.0/tests/unit/semantic_release/commit_parser/test_parsed_commit.py +27 -0
  44. python_semantic_release-9.7.0/tests/unit/semantic_release/commit_parser/test_scipy.py +126 -0
  45. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/commit_parser/test_tag.py +25 -20
  46. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/hvcs/test__base.py +18 -3
  47. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/hvcs/test_bitbucket.py +76 -76
  48. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/hvcs/test_gitea.py +21 -10
  49. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/hvcs/test_github.py +22 -11
  50. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/util.py +27 -3
  51. python_semantic_release-9.5.0/semantic_release/hvcs/_base.py +0 -160
  52. python_semantic_release-9.5.0/tests/fixtures/commit_parsers.py +0 -39
  53. python_semantic_release-9.5.0/tests/fixtures/scipy.py +0 -163
  54. python_semantic_release-9.5.0/tests/unit/semantic_release/commit_parser/helper.py +0 -5
  55. python_semantic_release-9.5.0/tests/unit/semantic_release/commit_parser/test_scipy.py +0 -13
  56. python_semantic_release-9.5.0/tests/unit/semantic_release/commit_parser/test_token.py +0 -22
  57. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/AUTHORS.rst +0 -0
  58. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/LICENSE +0 -0
  59. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/MANIFEST.in +0 -0
  60. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/README.rst +0 -0
  61. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/Makefile +0 -0
  62. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/algorithm.rst +0 -0
  63. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/automatic-releases/cronjobs.rst +0 -0
  64. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/automatic-releases/github-actions.rst +0 -0
  65. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/automatic-releases/index.rst +0 -0
  66. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/automatic-releases/travis.rst +0 -0
  67. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/commit-parsing.rst +0 -0
  68. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/conf.py +0 -0
  69. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/contributing.rst +0 -0
  70. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/contributors.rst +0 -0
  71. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/index.rst +0 -0
  72. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/make.bat +0 -0
  73. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/migrating_from_v7.rst +0 -0
  74. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/strict_mode.rst +0 -0
  75. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/docs/troubleshooting.rst +0 -0
  76. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/python_semantic_release.egg-info/dependency_links.txt +0 -0
  77. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/python_semantic_release.egg-info/entry_points.txt +0 -0
  78. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/python_semantic_release.egg-info/top_level.txt +0 -0
  79. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/__main__.py +0 -0
  80. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/changelog/__init__.py +0 -0
  81. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/changelog/release_history.py +0 -0
  82. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/changelog/template.py +0 -0
  83. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/cli/__init__.py +0 -0
  84. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/cli/commands/__init__.py +0 -0
  85. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/cli/commands/cli_context.py +0 -0
  86. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/cli/commands/generate_config.py +0 -0
  87. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/cli/commands/main.py +0 -0
  88. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/cli/common.py +0 -0
  89. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/cli/const.py +0 -0
  90. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/cli/github_actions_output.py +0 -0
  91. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/cli/masking_filter.py +0 -0
  92. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/cli/util.py +0 -0
  93. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/commit_parser/__init__.py +0 -0
  94. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/commit_parser/token.py +0 -0
  95. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/commit_parser/util.py +0 -0
  96. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/const.py +0 -0
  97. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/data/templates/CHANGELOG.md.j2 +0 -0
  98. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/data/templates/release_notes.md.j2 +0 -0
  99. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/enums.py +0 -0
  100. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/helpers.py +0 -0
  101. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/hvcs/token_auth.py +0 -0
  102. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/hvcs/util.py +0 -0
  103. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/version/__init__.py +0 -0
  104. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/version/algorithm.py +0 -0
  105. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/version/declaration.py +0 -0
  106. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/version/translator.py +0 -0
  107. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/semantic_release/version/version.py +0 -0
  108. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/setup.cfg +0 -0
  109. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/__init__.py +0 -0
  110. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/command_line/__init__.py +0 -0
  111. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/command_line/conftest.py +0 -0
  112. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/command_line/test_changelog.py +0 -0
  113. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/command_line/test_generate_config.py +0 -0
  114. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/command_line/test_help.py +0 -0
  115. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/command_line/test_main.py +0 -0
  116. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/command_line/test_publish.py +0 -0
  117. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/fixtures/__init__.py +0 -0
  118. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/fixtures/repos/__init__.py +0 -0
  119. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/fixtures/repos/git_flow/__init__.py +0 -0
  120. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py +0 -0
  121. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py +0 -0
  122. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/fixtures/repos/github_flow/__init__.py +0 -0
  123. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/fixtures/repos/github_flow/repo_w_release_channels.py +0 -0
  124. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/fixtures/repos/trunk_based_dev/__init__.py +0 -0
  125. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py +0 -0
  126. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py +0 -0
  127. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py +0 -0
  128. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/scenario/__init__.py +0 -0
  129. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/scenario/test_next_version.py +0 -0
  130. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/scenario/test_release_history.py +0 -0
  131. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/scenario/test_template_render.py +0 -0
  132. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/__init__.py +0 -0
  133. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/__init__.py +0 -0
  134. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/changelog/__init__.py +0 -0
  135. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/changelog/test_release_notes.py +0 -0
  136. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/changelog/test_template.py +0 -0
  137. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/cli/__init__.py +0 -0
  138. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/cli/test_github_actions_output.py +0 -0
  139. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/cli/test_masking_filter.py +0 -0
  140. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/cli/test_version.py +0 -0
  141. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/commit_parser/__init__.py +0 -0
  142. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/commit_parser/test_util.py +0 -0
  143. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/hvcs/__init__.py +0 -0
  144. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/hvcs/test_gitlab.py +0 -0
  145. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/hvcs/test_token_auth.py +0 -0
  146. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/hvcs/test_util.py +0 -0
  147. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/test_helpers.py +0 -0
  148. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/version/__init__.py +0 -0
  149. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/version/test_algorithm.py +0 -0
  150. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/version/test_declaration.py +0 -0
  151. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/version/test_translator.py +0 -0
  152. {python_semantic_release-9.5.0 → python_semantic_release-9.7.0}/tests/unit/semantic_release/version/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-semantic-release
3
- Version: 9.5.0
3
+ Version: 9.7.0
4
4
  Summary: Automatic Semantic Versioning for Python projects
5
5
  Author-email: Rolf Erik Lekang <me@rolflekang.com>
6
6
  License: MIT
@@ -53,9 +53,9 @@ Requires-Dist: types-pytest-lazy-fixture~=0.6.3; extra == "test"
53
53
  Provides-Extra: dev
54
54
  Requires-Dist: pre-commit~=3.5; extra == "dev"
55
55
  Requires-Dist: tox~=4.11; extra == "dev"
56
- Requires-Dist: ruff==0.4.1; extra == "dev"
56
+ Requires-Dist: ruff==0.4.2; extra == "dev"
57
57
  Provides-Extra: mypy
58
- Requires-Dist: mypy==1.9.0; extra == "mypy"
58
+ Requires-Dist: mypy==1.10.0; extra == "mypy"
59
59
  Requires-Dist: types-requests~=2.31.0; extra == "mypy"
60
60
 
61
61
  Python Semantic Release
@@ -144,8 +144,8 @@ project.
144
144
 
145
145
  .. _changelog-templates-template-rendering-template-context:
146
146
 
147
- Template Context:
148
- ^^^^^^^^^^^^^^^^^
147
+ Template Context
148
+ ^^^^^^^^^^^^^^^^
149
149
 
150
150
  Alongside the rendering of a directory tree, Python Semantic Release makes information
151
151
  about the history of the project available within the templating environment in order
@@ -156,19 +156,57 @@ Python terms, ``context`` is a `dataclass`_ with the following attributes:
156
156
 
157
157
  * ``repo_name: str``: the name of the current repository parsed from the Git url.
158
158
  * ``repo_owner: str``: the owner of the current repository parsed from the Git url.
159
+ * ``hvcs_type: str``: the name of the VCS server type currently configured.
159
160
  * ``history: ReleaseHistory``: a :py:class:`semantic_release.changelog.ReleaseHistory` instance.
160
161
  (See :ref:`changelog-templates-template-rendering-template-context-release-history`)
161
162
  * ``filters: Tuple[Callable[..., Any], ...]``: a tuple of filters for the template environment.
162
163
  These are added to the environment's ``filters``, and therefore there should be no need to
163
164
  access these from the ``context`` object inside the template.
164
165
 
165
- Currently, two filters are defined:
166
+ The filters provided vary based on the VCS configured and available features:
167
+
168
+ * ``create_server_url: Callable[[str, str | None, str | None, str | None], str]``: when given
169
+ a path, prepend the configured vcs server host and url scheme. Optionally you can provide,
170
+ a auth string, a query string or a url fragment to be normalized into the resulting url.
171
+ Parameter order is as described above respectively.
172
+
173
+ * ``create_repo_url: Callable[[str, str | None, str | None], str]``: when given a repository
174
+ path, prepend the configured vcs server host, and repo namespace. Optionally you can provide,
175
+ an additional query string and/or a url fragment to also put in the url. Parameter order is
176
+ as described above respectively. This is similar to ``create_server_url`` but includes the repo
177
+ namespace and owner automatically.
166
178
 
167
- * ``pull_request_url: Callable[[str], str]``: given a pull request number, return a URL
168
- to the pull request in the remote.
169
179
  * ``commit_hash_url: Callable[[str], str]``: given a commit hash, return a URL to the
170
180
  commit in the remote.
171
181
 
182
+ * ``compare_url: Callable[[str, str], str]``: given a starting git reference and a ending git
183
+ reference create a comparison url between the two references that can be opened on the remote
184
+
185
+ * ``issue_url: Callable[[str | int], str]``: given an issue number, return a URL to the issue
186
+ on the remote vcs.
187
+
188
+ * ``merge_request_url: Callable[[str | int], str]``: given a merge request number, return a URL
189
+ to the merge request in the remote. This is an alias to the ``pull_request_url`` but only
190
+ available for the VCS that uses the merge request terminology.
191
+
192
+ * ``pull_request_url: Callable[[str | int], str]``: given a pull request number, return a URL
193
+ to the pull request in the remote. For remote vcs' that use merge request terminology, this
194
+ filter is an alias to the ``merge_request_url`` filter function.
195
+
196
+ Availability of the documented filters can be found in the table below:
197
+
198
+ ====================== ========= ===== ====== ======
199
+ **filter - hvcs_type** bitbucket gitea github gitlab
200
+ ====================== ========= ===== ====== ======
201
+ create_server_url ✅ ✅ ✅ ✅
202
+ create_repo_url ✅ ✅ ✅ ✅
203
+ commit_hash_url ✅ ✅ ✅ ✅
204
+ compare_url ✅ ❌ ✅ ✅
205
+ issue_url ❌ ✅ ✅ ✅
206
+ merge_request_url ❌ ❌ ❌ ✅
207
+ pull_request_url ✅ ✅ ✅ ✅
208
+ ====================== ========= ===== ====== ======
209
+
172
210
  .. seealso::
173
211
  * `Filters <https://jinja.palletsprojects.com/en/3.1.x/templates/#filters>`_
174
212
 
@@ -173,39 +173,110 @@ number (``1.0.0``).
173
173
 
174
174
  .. _cmd-version-option-force-level:
175
175
 
176
- ``--major/--minor/--patch``
177
- ***************************
176
+ ``--major/--minor/--patch/--prerelease``
177
+ ****************************************
178
178
 
179
- Force the next version to increment the major, minor or patch digit, respectively.
180
- These flags are optional but mutually exclusive, so only one may be supplied, or none at all.
181
- Using these flags overrides the usual calculation for the next version; this can be useful, say,
182
- when a project wants to release its initial 1.0.0 version.
179
+ Force the next version to increment the major, minor or patch digits, or the prerelease revision,
180
+ respectively. These flags are optional but mutually exclusive, so only one may be supplied, or
181
+ none at all. Using these flags overrides the usual calculation for the next version; this can
182
+ be useful, say, when a project wants to release its initial 1.0.0 version.
183
183
 
184
184
  .. warning::
185
- Using these flags will override the value of prerelease, **regardless of your configuration or the
186
- current version**. To produce a prerelease with the appropriate digit incremented you should also
187
- supply the :ref:`cmd-version-option-prerelease` flag. If you do not, using these flags will force
185
+
186
+ Using these flags will override the configured value of ``prerelease`` (configured
187
+ in your :ref:`Release Group<multibranch-releases-configuring>`),
188
+ **regardless of your configuration or the current version**.
189
+
190
+ To produce a prerelease with the appropriate digit incremented you should also
191
+ supply the :ref:`cmd-version-option-as-prerelease` flag. If you do not, using these flags will force
188
192
  a full (non-prerelease) version to be created.
189
193
 
194
+ For example, suppose your project's current version is ``0.2.1-rc.1``. The following
195
+ shows how these options can be combined with ``--as-prerelease`` to force different
196
+ versions:
197
+
198
+ .. code-block:: bash
199
+
200
+ semantic-release version --prerelease --print
201
+ # 0.2.1-rc.2
202
+
203
+ semantic-release version --patch --print
204
+ # 0.2.2
205
+
206
+ semantic-release version --minor --print
207
+ # 0.3.0
208
+
209
+ semantic-release version --major --print
210
+ # 1.0.0
211
+
212
+ semantic-release version --minor --as-prerelease --print
213
+ # 0.3.0-rc.1
214
+
215
+ semantic-release version --prerelease --as-prerelease --print
216
+ # 0.2.1-rc.2
217
+
190
218
  These options are forceful overrides, but there is no action required for subsequent releases
191
219
  performed using the usual calculation algorithm.
192
220
 
221
+ Supplying ``--prerelease`` will cause Python Semantic Release to scan your project history
222
+ for any previous prereleases with the same major, minor and patch versions as the latest
223
+ version and the same :ref:`prerelease token<cmd-version-option-prerelease-token>` as the
224
+ one passed by command-line or configuration. If one is not found, ``--prerelease`` will
225
+ produce the next version according to the following format:
226
+
227
+ .. code-block:: python
228
+
229
+ f"{latest_version.major}.{latest_version.minor}.{latest_version.patch}-{prerelease_token}.1"
230
+
231
+ However, if Python Semantic Release identifies a previous *prerelease* version with the same
232
+ major, minor and patch digits as the latest version, *and* the same prerelease token as the
233
+ one supplied by command-line or configuration, then Python Semantic Release will increment
234
+ the revision found on that previous prerelease version in its new version.
235
+
236
+ For example, if ``"0.2.1-rc.1"`` and already exists as a previous version, and the latest version
237
+ is ``"0.2.1"``, invoking the following command will produce ``"0.2.1-rc.2"``:
238
+
239
+ .. code-block:: bash
240
+
241
+ semantic-release version --prerelease --prerelease-token "rc" --print
242
+
243
+ .. warning::
244
+
245
+ This is true irrespective of the branch from which ``"0.2.1-rc.1"`` was released from.
246
+ The check for previous prereleases "leading up to" this normal version is intended to
247
+ help prevent collisions in git tags to an extent, but isn't foolproof. As the example
248
+ shows it is possible to release a prerelease for a normal version that's already been
249
+ released when using this flag, which would in turn be ignored by tools selecting
250
+ versions by `SemVer precedence rules`_.
251
+
252
+
253
+ .. _SemVer precedence rules: https://semver.org/#spec-item-11
254
+
255
+
193
256
  .. seealso::
194
257
  - :ref:`configuration`
195
258
  - :ref:`config-branches`
196
259
 
197
- .. _cmd-version-option-prerelease:
260
+ .. _cmd-version-option-as-prerelease:
198
261
 
199
- ``--prerelease``
200
- ****************
262
+ ``--as-prerelease``
263
+ *******************
201
264
 
202
- Force the next version to be a prerelease. As with :ref:`cmd-version-option-force-level`, this option
265
+ After performing the normal calculation of the next version, convert the resulting next version
266
+ to a prerelease before applying it. As with :ref:`cmd-version-option-force-level`, this option
203
267
  is a forceful override, but no action is required to resume calculating versions as normal on the
204
- subsequent releases.
268
+ subsequent releases. The main distinction between ``--prerelease`` and ``--as-prerelease`` is that
269
+ the latter will not *force* a new version if one would not have been released without supplying
270
+ the flag.
271
+
272
+ This can be useful when making a single prerelease on a branch that would typically release
273
+ normal versions.
205
274
 
206
275
  If not specified in :ref:`cmd-version-option-prerelease-token`, the prerelease token is idenitified using the
207
276
  :ref:`Multibranch Release Configuration <multibranch-releases-configuring>`
208
277
 
278
+ See the examples alongside :ref:`cmd-version-option-force-level` for how to use this flag.
279
+
209
280
  .. _cmd-version-option-prerelease-token:
210
281
 
211
282
  ``--prerelease-token [VALUE]``
@@ -141,10 +141,34 @@ This setting is discussed in more detail at :ref:`multibranch-releases`
141
141
 
142
142
  .. _config-build-command:
143
143
 
144
- ``build_command (Optional[str])``
145
- """""""""""""""""""""""""""""""""
146
-
147
- Command to use when building the current project during :ref:`cmd-version`
144
+ ``build_command``
145
+ """""""""""""""""
146
+
147
+ **Type:** ``Optional[str]``
148
+
149
+ Command to use to build the current project during :ref:`cmd-version`.
150
+
151
+ Python Semantic Release will execute the build command in the OS default
152
+ shell with a subset of environment variables. PSR provides the variable
153
+ ``NEW_VERSION`` in the environment with the value of the next determined
154
+ version. The following table summarizes all the environment variables that
155
+ are passed on to the ``build_command`` runtime if they exist in the parent
156
+ process.
157
+
158
+ ======================== ======================================================================
159
+ Variable Name Description
160
+ ======================== ======================================================================
161
+ CI Pass-through ``true`` if exists in process env, unset otherwise
162
+ BITBUCKET_CI ``true`` if Bitbucket CI variables exist in env, unset otherwise
163
+ GITHUB_ACTIONS Pass-through ``true`` if exists in process env, unset otherwise
164
+ GITEA_ACTIONS Pass-through ``true`` if exists in process env, unset otherwise
165
+ GITLAB_CI Pass-through ``true`` if exists in process env, unset otherwise
166
+ HOME Pass-through ``HOME`` of parent process
167
+ NEW_VERSION Semantically determined next version (ex. ``1.2.3``)
168
+ PATH Pass-through ``PATH`` of parent process
169
+ PSR_DOCKER_GITHUB_ACTION Pass-through ``true`` if exists in process env, unset otherwise
170
+ VIRTUAL_ENV Pass-through ``VIRTUAL_ENV`` if exists in process env, unset otherwise
171
+ ======================== ======================================================================
148
172
 
149
173
  **Default:** ``None`` (not specified)
150
174
 
@@ -106,8 +106,8 @@ defaults as their corresponding command line option.
106
106
  In general, the input for an action corresponding to a command line option has the same
107
107
  name, with dashes (``-``) replaced by underscores.
108
108
 
109
- The command line arguments ``--patch``, ``--minor`` and ``--major`` are mutually
110
- exclusive, and are supplied via the ``force`` input.
109
+ The command line arguments ``--prerelease``, ``--patch``, ``--minor`` and ``--major``
110
+ are mutually exclusive, and are supplied via the ``force`` input.
111
111
 
112
112
  Flags, which require either ``--<option>`` or ``--no-<option>`` to be passed on the
113
113
  command-line, should be specified using the option name (with dashes replaced by
@@ -115,6 +115,9 @@ underscores), and set to the value ``"true"`` to supply ``--<option>`` on the
115
115
  command-line, and ``"false"`` to specify ``--no-<option>``.
116
116
  Any other values are not accepted.
117
117
 
118
+ The flag ``--as-prerelease`` is uniquely provided as just the ``prerelease`` flag value.
119
+ This is for compatibility reasons.
120
+
118
121
  For command line options requiring a value, set the input to the required value.
119
122
 
120
123
  For example, to specify ``--patch --no-push --build-metadata abc123``, you should
@@ -163,5 +163,5 @@ This would lead to versions such as ``1.1.1+main.20221127`` or ``2.0.0-rc.4+2.x.
163
163
 
164
164
  .. note::
165
165
  Remember that is always possible to override the release rules configured by using
166
- the :ref:`cmd-version-option-force-level` and :ref:`cmd-version-option-prerelease`
166
+ the :ref:`cmd-version-option-force-level` and :ref:`cmd-version-option-as-prerelease`
167
167
  flags.
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "python-semantic-release"
9
- version = "9.5.0"
9
+ version = "9.7.0"
10
10
  description = "Automatic Semantic Versioning for Python projects"
11
11
  requires-python = ">=3.8"
12
12
  license = { text = "MIT" }
@@ -71,10 +71,10 @@ test = [
71
71
  dev = [
72
72
  "pre-commit ~= 3.5",
73
73
  "tox ~= 4.11",
74
- "ruff == 0.4.1"
74
+ "ruff == 0.4.2"
75
75
  ]
76
76
  mypy = [
77
- "mypy == 1.9.0",
77
+ "mypy == 1.10.0",
78
78
  "types-requests ~= 2.31.0"
79
79
  ]
80
80
 
@@ -83,18 +83,21 @@ env = [
83
83
  "PYTHONHASHSEED = 123456"
84
84
  ]
85
85
  addopts = [
86
+ # TO DEBUG in single process, swap auto to 0
86
87
  "-nauto",
88
+ # "-n0",
87
89
  "-ra",
88
90
  "--diff-symbols",
89
91
  "--cache-clear",
90
- "--cov=semantic_release",
91
- "--cov-context=test",
92
- "--cov-report",
93
- "html:coverage-html",
94
- "--cov-report",
95
- "term",
92
+ # No default coverage - causes problems with debuggers
93
+ # "--cov=semantic_release",
94
+ # "--cov-context=test",
95
+ # "--cov-report=html:coverage-html",
96
+ # "--cov-report=term-missing",
97
+ ]
98
+ testpaths = [
99
+ "tests"
96
100
  ]
97
- python_files = ["tests/test_*.py", "tests/**/test_*.py"]
98
101
 
99
102
  [tool.coverage.html]
100
103
  show_contexts = true
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-semantic-release
3
- Version: 9.5.0
3
+ Version: 9.7.0
4
4
  Summary: Automatic Semantic Versioning for Python projects
5
5
  Author-email: Rolf Erik Lekang <me@rolflekang.com>
6
6
  License: MIT
@@ -53,9 +53,9 @@ Requires-Dist: types-pytest-lazy-fixture~=0.6.3; extra == "test"
53
53
  Provides-Extra: dev
54
54
  Requires-Dist: pre-commit~=3.5; extra == "dev"
55
55
  Requires-Dist: tox~=4.11; extra == "dev"
56
- Requires-Dist: ruff==0.4.1; extra == "dev"
56
+ Requires-Dist: ruff==0.4.2; extra == "dev"
57
57
  Provides-Extra: mypy
58
- Requires-Dist: mypy==1.9.0; extra == "mypy"
58
+ Requires-Dist: mypy==1.10.0; extra == "mypy"
59
59
  Requires-Dist: types-requests~=2.31.0; extra == "mypy"
60
60
 
61
61
  Python Semantic Release
@@ -71,6 +71,7 @@ semantic_release/hvcs/bitbucket.py
71
71
  semantic_release/hvcs/gitea.py
72
72
  semantic_release/hvcs/github.py
73
73
  semantic_release/hvcs/gitlab.py
74
+ semantic_release/hvcs/remote_hvcs_base.py
74
75
  semantic_release/hvcs/token_auth.py
75
76
  semantic_release/hvcs/util.py
76
77
  semantic_release/version/__init__.py
@@ -113,6 +114,7 @@ tests/unit/__init__.py
113
114
  tests/unit/semantic_release/__init__.py
114
115
  tests/unit/semantic_release/test_helpers.py
115
116
  tests/unit/semantic_release/changelog/__init__.py
117
+ tests/unit/semantic_release/changelog/test_changelog_context.py
116
118
  tests/unit/semantic_release/changelog/test_default_changelog.py
117
119
  tests/unit/semantic_release/changelog/test_release_notes.py
118
120
  tests/unit/semantic_release/changelog/test_template.py
@@ -123,12 +125,11 @@ tests/unit/semantic_release/cli/test_masking_filter.py
123
125
  tests/unit/semantic_release/cli/test_util.py
124
126
  tests/unit/semantic_release/cli/test_version.py
125
127
  tests/unit/semantic_release/commit_parser/__init__.py
126
- tests/unit/semantic_release/commit_parser/helper.py
127
128
  tests/unit/semantic_release/commit_parser/test_angular.py
128
129
  tests/unit/semantic_release/commit_parser/test_emoji.py
130
+ tests/unit/semantic_release/commit_parser/test_parsed_commit.py
129
131
  tests/unit/semantic_release/commit_parser/test_scipy.py
130
132
  tests/unit/semantic_release/commit_parser/test_tag.py
131
- tests/unit/semantic_release/commit_parser/test_token.py
132
133
  tests/unit/semantic_release/commit_parser/test_util.py
133
134
  tests/unit/semantic_release/hvcs/__init__.py
134
135
  tests/unit/semantic_release/hvcs/test__base.py
@@ -14,7 +14,7 @@ shellingham~=1.5
14
14
  [dev]
15
15
  pre-commit~=3.5
16
16
  tox~=4.11
17
- ruff==0.4.1
17
+ ruff==0.4.2
18
18
 
19
19
  [docs]
20
20
  Sphinx~=6.0
@@ -23,7 +23,7 @@ sphinx-autobuild==2024.2.4
23
23
  furo~=2024.1
24
24
 
25
25
  [mypy]
26
- mypy==1.9.0
26
+ mypy==1.10.0
27
27
  types-requests~=2.31.0
28
28
 
29
29
  [test]
@@ -24,7 +24,7 @@ from semantic_release.version import (
24
24
  tags_and_versions,
25
25
  )
26
26
 
27
- __version__ = "9.5.0"
27
+ __version__ = "9.7.0"
28
28
 
29
29
 
30
30
  def setup_hook(argv: list[str]) -> None:
@@ -14,6 +14,7 @@ if TYPE_CHECKING:
14
14
  class ChangelogContext:
15
15
  repo_name: str
16
16
  repo_owner: str
17
+ hvcs_type: str
17
18
  history: ReleaseHistory
18
19
  filters: tuple[Callable[..., Any], ...] = ()
19
20
 
@@ -31,5 +32,6 @@ def make_changelog_context(
31
32
  repo_name=hvcs_client.repo_name,
32
33
  repo_owner=hvcs_client.owner,
33
34
  history=release_history,
34
- filters=(hvcs_client.pull_request_url, hvcs_client.commit_hash_url),
35
+ hvcs_type=hvcs_client.__class__.__name__.lower(),
36
+ filters=(*hvcs_client.get_changelog_context_filters(),),
35
37
  )
@@ -14,6 +14,7 @@ from semantic_release.cli.common import (
14
14
  render_release_notes,
15
15
  )
16
16
  from semantic_release.cli.util import noop_report
17
+ from semantic_release.hvcs.remote_hvcs_base import RemoteHvcsBase
17
18
 
18
19
  if TYPE_CHECKING:
19
20
  from semantic_release.cli.commands.cli_context import CliContextObj
@@ -79,7 +80,7 @@ def changelog(cli_ctx: CliContextObj, release_tag: str | None = None) -> None:
79
80
  else:
80
81
  recursive_render(template_dir, environment=env, _root_dir=repo.working_dir)
81
82
 
82
- if release_tag:
83
+ if release_tag and isinstance(hvcs_client, RemoteHvcsBase):
83
84
  if runtime.global_cli_options.noop:
84
85
  noop_report(
85
86
  f"would have posted changelog to the release for tag {release_tag}"
@@ -6,6 +6,7 @@ from typing import TYPE_CHECKING
6
6
  import click
7
7
 
8
8
  from semantic_release.cli.util import noop_report
9
+ from semantic_release.hvcs.remote_hvcs_base import RemoteHvcsBase
9
10
  from semantic_release.version import tags_and_versions
10
11
 
11
12
  if TYPE_CHECKING:
@@ -45,6 +46,13 @@ def publish(cli_ctx: CliContextObj, tag: str = "latest") -> None:
45
46
  f"No tags found with format {translator.tag_format!r}, couldn't "
46
47
  "identify latest version"
47
48
  )
49
+
50
+ if not isinstance(hvcs_client, RemoteHvcsBase):
51
+ log.info(
52
+ "Remote does not support artifact upload. Exiting with no action taken..."
53
+ )
54
+ ctx.exit(0)
55
+
48
56
  if runtime.global_cli_options.noop:
49
57
  noop_report(
50
58
  "would have uploaded files matching any of the globs "