python-semantic-release 9.4.2__tar.gz → 9.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_semantic_release-9.4.2/python_semantic_release.egg-info → python_semantic_release-9.6.0}/PKG-INFO +2 -2
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/changelog_templates.rst +43 -5
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/commands.rst +85 -14
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/multibranch_releases.rst +1 -1
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/pyproject.toml +17 -45
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0/python_semantic_release.egg-info}/PKG-INFO +2 -2
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/python_semantic_release.egg-info/SOURCES.txt +3 -2
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/python_semantic_release.egg-info/requires.txt +1 -1
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/__init__.py +1 -1
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/changelog/context.py +3 -1
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/cli/commands/changelog.py +2 -1
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/cli/commands/publish.py +8 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/cli/commands/version.py +79 -40
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/cli/config.py +94 -19
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/commit_parser/_base.py +13 -4
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/commit_parser/angular.py +7 -2
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/commit_parser/emoji.py +5 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/commit_parser/scipy.py +12 -13
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/commit_parser/tag.py +5 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/errors.py +22 -1
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/hvcs/__init__.py +10 -1
- python_semantic_release-9.6.0/semantic_release/hvcs/_base.py +83 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/hvcs/bitbucket.py +87 -140
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/hvcs/gitea.py +61 -71
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/hvcs/github.py +152 -109
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/hvcs/gitlab.py +34 -76
- python_semantic_release-9.6.0/semantic_release/hvcs/remote_hvcs_base.py +193 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/command_line/test_changelog.py +1 -3
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/command_line/test_version.py +79 -53
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/conftest.py +12 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/const.py +1 -30
- python_semantic_release-9.6.0/tests/fixtures/commit_parsers.py +46 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/fixtures/example_project.py +54 -10
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/fixtures/git_repo.py +4 -2
- python_semantic_release-9.6.0/tests/fixtures/scipy.py +437 -0
- python_semantic_release-9.6.0/tests/unit/semantic_release/changelog/test_changelog_context.py +337 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/changelog/test_default_changelog.py +16 -16
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/cli/test_config.py +99 -5
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/cli/test_util.py +12 -7
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/commit_parser/test_angular.py +53 -37
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/commit_parser/test_emoji.py +23 -23
- python_semantic_release-9.6.0/tests/unit/semantic_release/commit_parser/test_parsed_commit.py +27 -0
- python_semantic_release-9.6.0/tests/unit/semantic_release/commit_parser/test_scipy.py +126 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/commit_parser/test_tag.py +25 -20
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/hvcs/test__base.py +18 -3
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/hvcs/test_bitbucket.py +76 -76
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/hvcs/test_gitea.py +21 -10
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/hvcs/test_github.py +87 -27
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/util.py +27 -3
- python_semantic_release-9.4.2/semantic_release/hvcs/_base.py +0 -160
- python_semantic_release-9.4.2/tests/fixtures/commit_parsers.py +0 -39
- python_semantic_release-9.4.2/tests/fixtures/scipy.py +0 -163
- python_semantic_release-9.4.2/tests/unit/semantic_release/commit_parser/helper.py +0 -5
- python_semantic_release-9.4.2/tests/unit/semantic_release/commit_parser/test_scipy.py +0 -13
- python_semantic_release-9.4.2/tests/unit/semantic_release/commit_parser/test_token.py +0 -22
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/AUTHORS.rst +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/LICENSE +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/MANIFEST.in +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/README.rst +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/Makefile +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/algorithm.rst +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/automatic-releases/cronjobs.rst +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/automatic-releases/github-actions.rst +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/automatic-releases/index.rst +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/automatic-releases/travis.rst +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/commit-parsing.rst +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/conf.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/configuration.rst +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/contributing.rst +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/contributors.rst +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/github-action.rst +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/index.rst +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/make.bat +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/migrating_from_v7.rst +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/strict_mode.rst +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/troubleshooting.rst +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/python_semantic_release.egg-info/dependency_links.txt +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/python_semantic_release.egg-info/entry_points.txt +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/python_semantic_release.egg-info/top_level.txt +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/__main__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/changelog/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/changelog/release_history.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/changelog/template.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/cli/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/cli/commands/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/cli/commands/cli_context.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/cli/commands/generate_config.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/cli/commands/main.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/cli/common.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/cli/const.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/cli/github_actions_output.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/cli/masking_filter.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/cli/util.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/commit_parser/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/commit_parser/token.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/commit_parser/util.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/const.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/data/templates/CHANGELOG.md.j2 +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/data/templates/release_notes.md.j2 +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/enums.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/helpers.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/hvcs/token_auth.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/hvcs/util.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/version/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/version/algorithm.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/version/declaration.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/version/translator.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/semantic_release/version/version.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/setup.cfg +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/command_line/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/command_line/conftest.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/command_line/test_generate_config.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/command_line/test_help.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/command_line/test_main.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/command_line/test_publish.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/fixtures/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/fixtures/repos/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/fixtures/repos/git_flow/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/fixtures/repos/github_flow/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/fixtures/repos/github_flow/repo_w_release_channels.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/fixtures/repos/trunk_based_dev/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/scenario/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/scenario/test_next_version.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/scenario/test_release_history.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/scenario/test_template_render.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/changelog/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/changelog/test_release_notes.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/changelog/test_template.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/cli/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/cli/test_github_actions_output.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/cli/test_masking_filter.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/cli/test_version.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/commit_parser/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/commit_parser/test_util.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/hvcs/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/hvcs/test_gitlab.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/hvcs/test_token_auth.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/hvcs/test_util.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/test_helpers.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/version/__init__.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/version/test_algorithm.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/version/test_declaration.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/tests/unit/semantic_release/version/test_translator.py +0 -0
- {python_semantic_release-9.4.2 → python_semantic_release-9.6.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.
|
|
3
|
+
Version: 9.6.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,7 +53,7 @@ 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.
|
|
56
|
+
Requires-Dist: ruff==0.4.1; extra == "dev"
|
|
57
57
|
Provides-Extra: mypy
|
|
58
58
|
Requires-Dist: mypy==1.9.0; extra == "mypy"
|
|
59
59
|
Requires-Dist: types-requests~=2.31.0; extra == "mypy"
|
{python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/changelog_templates.rst
RENAMED
|
@@ -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
|
-
|
|
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
|
|
180
|
-
These flags are optional but mutually exclusive, so only one may be supplied, or
|
|
181
|
-
Using these flags overrides the usual calculation for the next version; this can
|
|
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
|
-
|
|
186
|
-
|
|
187
|
-
|
|
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
|
-
|
|
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]``
|
{python_semantic_release-9.4.2 → python_semantic_release-9.6.0}/docs/multibranch_releases.rst
RENAMED
|
@@ -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.
|
|
9
|
+
version = "9.6.0"
|
|
10
10
|
description = "Automatic Semantic Versioning for Python projects"
|
|
11
11
|
requires-python = ">=3.8"
|
|
12
12
|
license = { text = "MIT" }
|
|
@@ -71,7 +71,7 @@ test = [
|
|
|
71
71
|
dev = [
|
|
72
72
|
"pre-commit ~= 3.5",
|
|
73
73
|
"tox ~= 4.11",
|
|
74
|
-
"ruff == 0.
|
|
74
|
+
"ruff == 0.4.1"
|
|
75
75
|
]
|
|
76
76
|
mypy = [
|
|
77
77
|
"mypy == 1.9.0",
|
|
@@ -363,70 +363,42 @@ ignore_names = ["change_to_ex_proj_dir", "init_example_project"]
|
|
|
363
363
|
|
|
364
364
|
[tool.semantic_release]
|
|
365
365
|
logging_use_named_masks = true
|
|
366
|
-
tag_format = "v{version}"
|
|
367
366
|
commit_parser = "angular"
|
|
368
|
-
commit_author = "semantic-release <semantic-release>"
|
|
369
|
-
commit_message = "{version}\n\nAutomatically generated by python-semantic-release"
|
|
370
367
|
build_command = """
|
|
371
368
|
python -m pip install build~=0.10.0
|
|
372
369
|
python -m build .
|
|
373
370
|
"""
|
|
374
371
|
major_on_zero = true
|
|
375
|
-
assets = []
|
|
376
372
|
version_variables = ["semantic_release/__init__.py:__version__"]
|
|
377
373
|
version_toml = ["pyproject.toml:project.version"]
|
|
378
374
|
|
|
379
|
-
[tool.semantic_release.commit_parser_options]
|
|
380
|
-
allowed_tags = [
|
|
381
|
-
"build",
|
|
382
|
-
"chore",
|
|
383
|
-
"ci",
|
|
384
|
-
"docs",
|
|
385
|
-
"feat",
|
|
386
|
-
"fix",
|
|
387
|
-
"perf",
|
|
388
|
-
"style",
|
|
389
|
-
"refactor",
|
|
390
|
-
"test",
|
|
391
|
-
]
|
|
392
|
-
minor_tags = ["feat"]
|
|
393
|
-
patch_tags = ["fix", "perf"]
|
|
394
|
-
|
|
395
375
|
[tool.semantic_release.changelog]
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
[
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
lstrip_blocks = false
|
|
409
|
-
newline_sequence = "\n"
|
|
410
|
-
keep_trailing_newline = false
|
|
411
|
-
extensions = []
|
|
412
|
-
autoescape = true
|
|
376
|
+
exclude_commit_patterns = [
|
|
377
|
+
'''chore(?:\([^)]*?\))?: .+''',
|
|
378
|
+
'''ci(?:\([^)]*?\))?: .+''',
|
|
379
|
+
'''refactor(?:\([^)]*?\))?: .+''',
|
|
380
|
+
'''style(?:\([^)]*?\))?: .+''',
|
|
381
|
+
'''test(?:\([^)]*?\))?: .+''',
|
|
382
|
+
'''build\((?!deps\): .+)''',
|
|
383
|
+
'''Merged? .*''',
|
|
384
|
+
'''Initial Commit.*''',
|
|
385
|
+
# Old semantic-release version commits
|
|
386
|
+
'''^\d+\.\d+\.\d+''',
|
|
387
|
+
]
|
|
413
388
|
|
|
414
389
|
[tool.semantic_release.branches.main]
|
|
415
390
|
match = "(main|master)"
|
|
416
391
|
prerelease = false
|
|
417
392
|
prerelease_token = "rc"
|
|
418
393
|
|
|
419
|
-
[tool.semantic_release.branches.
|
|
420
|
-
match = "
|
|
394
|
+
[tool.semantic_release.branches.alpha]
|
|
395
|
+
match = "^(feat|fix|perf)/.+"
|
|
421
396
|
prerelease = true
|
|
422
|
-
prerelease_token = "
|
|
397
|
+
prerelease_token = "alpha"
|
|
423
398
|
|
|
424
399
|
[tool.semantic_release.remote]
|
|
425
|
-
name = "origin"
|
|
426
400
|
type = "github"
|
|
427
|
-
ignore_token_for_push = false
|
|
428
401
|
token = { env = "GH_TOKEN" }
|
|
429
402
|
|
|
430
403
|
[tool.semantic_release.publish]
|
|
431
|
-
dist_glob_patterns = ["dist/*"]
|
|
432
404
|
upload_to_vcs_release = true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-semantic-release
|
|
3
|
-
Version: 9.
|
|
3
|
+
Version: 9.6.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,7 +53,7 @@ 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.
|
|
56
|
+
Requires-Dist: ruff==0.4.1; extra == "dev"
|
|
57
57
|
Provides-Extra: mypy
|
|
58
58
|
Requires-Dist: mypy==1.9.0; extra == "mypy"
|
|
59
59
|
Requires-Dist: types-requests~=2.31.0; extra == "mypy"
|
|
@@ -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,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
|
-
|
|
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 "
|