python-semantic-release 9.7.2__tar.gz → 9.8.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.7.2/python_semantic_release.egg-info → python_semantic_release-9.8.0}/PKG-INFO +2 -2
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/configuration.rst +18 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/migrating_from_v7.rst +4 -4
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/pyproject.toml +2 -2
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0/python_semantic_release.egg-info}/PKG-INFO +2 -2
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/python_semantic_release.egg-info/requires.txt +1 -1
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/__init__.py +1 -1
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/cli/commands/version.py +3 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/cli/config.py +3 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/hvcs/github.py +5 -4
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/hvcs/gitlab.py +127 -27
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/command_line/test_version.py +51 -1
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/hvcs/test_gitlab.py +193 -43
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/AUTHORS.rst +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/LICENSE +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/MANIFEST.in +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/README.rst +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/Makefile +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/algorithm.rst +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/automatic-releases/cronjobs.rst +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/automatic-releases/github-actions.rst +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/automatic-releases/index.rst +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/automatic-releases/travis.rst +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/changelog_templates.rst +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/commands.rst +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/commit-parsing.rst +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/conf.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/contributing.rst +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/contributors.rst +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/github-action.rst +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/index.rst +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/make.bat +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/multibranch_releases.rst +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/strict_mode.rst +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/docs/troubleshooting.rst +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/python_semantic_release.egg-info/SOURCES.txt +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/python_semantic_release.egg-info/dependency_links.txt +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/python_semantic_release.egg-info/entry_points.txt +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/python_semantic_release.egg-info/top_level.txt +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/__main__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/changelog/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/changelog/context.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/changelog/release_history.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/changelog/template.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/cli/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/cli/commands/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/cli/commands/changelog.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/cli/commands/cli_context.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/cli/commands/generate_config.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/cli/commands/main.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/cli/commands/publish.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/cli/common.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/cli/const.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/cli/github_actions_output.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/cli/masking_filter.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/cli/util.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/commit_parser/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/commit_parser/_base.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/commit_parser/angular.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/commit_parser/emoji.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/commit_parser/scipy.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/commit_parser/tag.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/commit_parser/token.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/commit_parser/util.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/const.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/data/templates/CHANGELOG.md.j2 +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/data/templates/release_notes.md.j2 +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/enums.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/errors.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/helpers.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/hvcs/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/hvcs/_base.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/hvcs/bitbucket.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/hvcs/gitea.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/hvcs/remote_hvcs_base.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/hvcs/token_auth.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/hvcs/util.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/version/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/version/algorithm.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/version/declaration.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/version/translator.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/version/version.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/setup.cfg +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/command_line/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/command_line/conftest.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/command_line/test_changelog.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/command_line/test_generate_config.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/command_line/test_help.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/command_line/test_main.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/command_line/test_publish.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/conftest.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/const.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/fixtures/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/fixtures/commit_parsers.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/fixtures/example_project.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/fixtures/git_repo.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/fixtures/repos/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/fixtures/repos/git_flow/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/fixtures/repos/github_flow/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/fixtures/repos/github_flow/repo_w_release_channels.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/fixtures/repos/trunk_based_dev/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/fixtures/scipy.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/scenario/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/scenario/test_next_version.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/scenario/test_release_history.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/scenario/test_template_render.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/changelog/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/changelog/test_changelog_context.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/changelog/test_default_changelog.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/changelog/test_release_notes.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/changelog/test_template.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/cli/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/cli/test_config.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/cli/test_github_actions_output.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/cli/test_masking_filter.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/cli/test_util.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/cli/test_version.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/commit_parser/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/commit_parser/test_angular.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/commit_parser/test_emoji.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/commit_parser/test_parsed_commit.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/commit_parser/test_scipy.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/commit_parser/test_tag.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/commit_parser/test_util.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/hvcs/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/hvcs/test__base.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/hvcs/test_bitbucket.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/hvcs/test_gitea.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/hvcs/test_github.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/hvcs/test_token_auth.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/hvcs/test_util.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/test_helpers.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/version/__init__.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/version/test_algorithm.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/version/test_declaration.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/version/test_translator.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/unit/semantic_release/version/test_version.py +0 -0
- {python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/util.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-semantic-release
|
|
3
|
-
Version: 9.
|
|
3
|
+
Version: 9.8.0
|
|
4
4
|
Summary: Automatic Semantic Versioning for Python projects
|
|
5
5
|
Author-email: Rolf Erik Lekang <me@rolflekang.com>
|
|
6
6
|
License: MIT
|
|
@@ -55,7 +55,7 @@ Requires-Dist: types-pytest-lazy-fixture~=0.6.3; extra == "test"
|
|
|
55
55
|
Provides-Extra: dev
|
|
56
56
|
Requires-Dist: pre-commit~=3.5; extra == "dev"
|
|
57
57
|
Requires-Dist: tox~=4.11; extra == "dev"
|
|
58
|
-
Requires-Dist: ruff==0.4.
|
|
58
|
+
Requires-Dist: ruff==0.4.4; extra == "dev"
|
|
59
59
|
Provides-Extra: mypy
|
|
60
60
|
Requires-Dist: mypy==1.10.0; extra == "mypy"
|
|
61
61
|
Requires-Dist: types-requests~=2.31.0; extra == "mypy"
|
|
@@ -702,6 +702,24 @@ When :ref:`config-allow_zero_version` is set to ``false``, this setting is ignor
|
|
|
702
702
|
|
|
703
703
|
----
|
|
704
704
|
|
|
705
|
+
.. _config-no_git_verify:
|
|
706
|
+
|
|
707
|
+
``no_git_verify``
|
|
708
|
+
"""""""""""""""""
|
|
709
|
+
|
|
710
|
+
**Type:** ``bool``
|
|
711
|
+
|
|
712
|
+
This flag is passed along to ``git`` upon performing a ``git commit`` during :ref:`cmd-version`.
|
|
713
|
+
|
|
714
|
+
When true, it will bypass any git hooks that are set for the repository when Python Semantic
|
|
715
|
+
Release makes a version commit. When false, the commit is performed as normal. This option
|
|
716
|
+
has no effect when there are not any git hooks configured nor when the ``--no-commit`` option
|
|
717
|
+
is passed.
|
|
718
|
+
|
|
719
|
+
**Default:** ``false``
|
|
720
|
+
|
|
721
|
+
----
|
|
722
|
+
|
|
705
723
|
.. _config-publish:
|
|
706
724
|
|
|
707
725
|
``publish``
|
|
@@ -74,7 +74,7 @@ GitHub Action:
|
|
|
74
74
|
on:
|
|
75
75
|
push:
|
|
76
76
|
branches:
|
|
77
|
-
-
|
|
77
|
+
- main
|
|
78
78
|
|
|
79
79
|
jobs:
|
|
80
80
|
release:
|
|
@@ -91,18 +91,18 @@ GitHub Action:
|
|
|
91
91
|
# This action uses Python Semantic Release v8
|
|
92
92
|
- name: Python Semantic Release
|
|
93
93
|
id: release
|
|
94
|
-
uses: python-semantic-release/python-semantic-release@v8.
|
|
94
|
+
uses: python-semantic-release/python-semantic-release@v8.7.0
|
|
95
95
|
with:
|
|
96
96
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
97
97
|
|
|
98
98
|
- name: Publish package distributions to PyPI
|
|
99
|
-
uses: pypa/gh-action-pypi-publish@
|
|
99
|
+
uses: pypa/gh-action-pypi-publish@v1
|
|
100
100
|
# NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true.
|
|
101
101
|
# See https://github.com/actions/runner/issues/1173
|
|
102
102
|
if: steps.release.outputs.released == 'true'
|
|
103
103
|
|
|
104
104
|
- name: Publish package distributions to GitHub Releases
|
|
105
|
-
uses: python-semantic-release/upload-to-gh-release@
|
|
105
|
+
uses: python-semantic-release/upload-to-gh-release@v8.7.0
|
|
106
106
|
if: steps.release.outputs.released == 'true'
|
|
107
107
|
with:
|
|
108
108
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -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.8.0"
|
|
10
10
|
description = "Automatic Semantic Versioning for Python projects"
|
|
11
11
|
requires-python = ">=3.8"
|
|
12
12
|
license = { text = "MIT" }
|
|
@@ -74,7 +74,7 @@ test = [
|
|
|
74
74
|
dev = [
|
|
75
75
|
"pre-commit ~= 3.5",
|
|
76
76
|
"tox ~= 4.11",
|
|
77
|
-
"ruff == 0.4.
|
|
77
|
+
"ruff == 0.4.4"
|
|
78
78
|
]
|
|
79
79
|
mypy = [
|
|
80
80
|
"mypy == 1.10.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-semantic-release
|
|
3
|
-
Version: 9.
|
|
3
|
+
Version: 9.8.0
|
|
4
4
|
Summary: Automatic Semantic Versioning for Python projects
|
|
5
5
|
Author-email: Rolf Erik Lekang <me@rolflekang.com>
|
|
6
6
|
License: MIT
|
|
@@ -55,7 +55,7 @@ Requires-Dist: types-pytest-lazy-fixture~=0.6.3; extra == "test"
|
|
|
55
55
|
Provides-Extra: dev
|
|
56
56
|
Requires-Dist: pre-commit~=3.5; extra == "dev"
|
|
57
57
|
Requires-Dist: tox~=4.11; extra == "dev"
|
|
58
|
-
Requires-Dist: ruff==0.4.
|
|
58
|
+
Requires-Dist: ruff==0.4.4; extra == "dev"
|
|
59
59
|
Provides-Extra: mypy
|
|
60
60
|
Requires-Dist: mypy==1.10.0; extra == "mypy"
|
|
61
61
|
Requires-Dist: types-requests~=2.31.0; extra == "mypy"
|
|
@@ -330,6 +330,7 @@ def version( # noqa: C901
|
|
|
330
330
|
commit_author = runtime.commit_author
|
|
331
331
|
commit_message = runtime.commit_message
|
|
332
332
|
major_on_zero = runtime.major_on_zero
|
|
333
|
+
no_verify = runtime.no_git_verify
|
|
333
334
|
build_command = runtime.build_command
|
|
334
335
|
opts = runtime.global_cli_options
|
|
335
336
|
gha_output = VersionGitHubActionsOutput()
|
|
@@ -613,6 +614,7 @@ def version( # noqa: C901
|
|
|
613
614
|
)
|
|
614
615
|
|
|
615
616
|
command += f"git commit -m '{indented_commit_message}'"
|
|
617
|
+
command += "--no-verify" if no_verify else ""
|
|
616
618
|
|
|
617
619
|
noop_report(
|
|
618
620
|
indented(
|
|
@@ -628,6 +630,7 @@ def version( # noqa: C901
|
|
|
628
630
|
repo.git.commit(
|
|
629
631
|
m=commit_message.format(version=new_version),
|
|
630
632
|
date=int(commit_date.timestamp()),
|
|
633
|
+
no_verify=no_verify,
|
|
631
634
|
)
|
|
632
635
|
|
|
633
636
|
# Run the tagging after potentially creating a new HEAD commit.
|
{python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/cli/config.py
RENAMED
|
@@ -225,6 +225,7 @@ class RawConfig(BaseModel):
|
|
|
225
225
|
major_on_zero: bool = True
|
|
226
226
|
allow_zero_version: bool = True
|
|
227
227
|
remote: RemoteConfig = RemoteConfig()
|
|
228
|
+
no_git_verify: bool = False
|
|
228
229
|
tag_format: str = "v{version}"
|
|
229
230
|
publish: PublishConfig = PublishConfig()
|
|
230
231
|
version_toml: Optional[Tuple[str, ...]] = None
|
|
@@ -347,6 +348,7 @@ class RuntimeContext:
|
|
|
347
348
|
major_on_zero: bool
|
|
348
349
|
allow_zero_version: bool
|
|
349
350
|
prerelease: bool
|
|
351
|
+
no_git_verify: bool
|
|
350
352
|
assets: List[str]
|
|
351
353
|
commit_author: Actor
|
|
352
354
|
commit_message: str
|
|
@@ -596,6 +598,7 @@ class RuntimeContext:
|
|
|
596
598
|
upload_to_vcs_release=raw.publish.upload_to_vcs_release,
|
|
597
599
|
global_cli_options=global_cli_options,
|
|
598
600
|
masker=masker,
|
|
601
|
+
no_git_verify=raw.no_git_verify,
|
|
599
602
|
)
|
|
600
603
|
# credential masker
|
|
601
604
|
self.apply_log_masking(self.masker)
|
{python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/hvcs/github.py
RENAMED
|
@@ -304,7 +304,7 @@ class Github(RemoteHvcsBase):
|
|
|
304
304
|
"""
|
|
305
305
|
Edit a release with updated change notes
|
|
306
306
|
https://docs.github.com/rest/reference/repos#update-a-release
|
|
307
|
-
:param
|
|
307
|
+
:param release_id: ID of release to update
|
|
308
308
|
:param release_notes: The release notes for this version
|
|
309
309
|
:return: The ID of the release that was edited
|
|
310
310
|
"""
|
|
@@ -329,8 +329,9 @@ class Github(RemoteHvcsBase):
|
|
|
329
329
|
) -> int:
|
|
330
330
|
"""
|
|
331
331
|
Post release changelog
|
|
332
|
-
:param
|
|
332
|
+
:param tag: The version number
|
|
333
333
|
:param release_notes: The release notes for this version
|
|
334
|
+
:param prerelease: Whether or not this release should be created as a prerelease
|
|
334
335
|
:return: The status of the request
|
|
335
336
|
"""
|
|
336
337
|
log.info("Creating release for %s", tag)
|
|
@@ -427,8 +428,8 @@ class Github(RemoteHvcsBase):
|
|
|
427
428
|
def upload_dists(self, tag: str, dist_glob: str) -> int:
|
|
428
429
|
"""
|
|
429
430
|
Upload distributions to a release
|
|
430
|
-
:param
|
|
431
|
-
:param
|
|
431
|
+
:param tag: Version to upload for
|
|
432
|
+
:param dist_glob: Path to the dist directory
|
|
432
433
|
:return: The number of distributions successfully uploaded
|
|
433
434
|
"""
|
|
434
435
|
# Find the release corresponding to this version
|
{python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/semantic_release/hvcs/gitlab.py
RENAMED
|
@@ -9,14 +9,21 @@ from pathlib import PurePosixPath
|
|
|
9
9
|
from typing import TYPE_CHECKING
|
|
10
10
|
|
|
11
11
|
import gitlab
|
|
12
|
+
import gitlab.exceptions
|
|
13
|
+
import gitlab.v4
|
|
14
|
+
import gitlab.v4.objects
|
|
12
15
|
from urllib3.util.url import Url, parse_url
|
|
13
16
|
|
|
17
|
+
from semantic_release.errors import UnexpectedResponse
|
|
14
18
|
from semantic_release.helpers import logged_function
|
|
15
19
|
from semantic_release.hvcs.remote_hvcs_base import RemoteHvcsBase
|
|
20
|
+
from semantic_release.hvcs.util import suppress_not_found
|
|
16
21
|
|
|
17
22
|
if TYPE_CHECKING:
|
|
18
23
|
from typing import Any, Callable
|
|
19
24
|
|
|
25
|
+
from gitlab.v4.objects import Project as GitLabProject
|
|
26
|
+
|
|
20
27
|
|
|
21
28
|
log = logging.getLogger(__name__)
|
|
22
29
|
|
|
@@ -45,6 +52,8 @@ class Gitlab(RemoteHvcsBase):
|
|
|
45
52
|
) -> None:
|
|
46
53
|
super().__init__(remote_url)
|
|
47
54
|
self.token = token
|
|
55
|
+
self.project_namespace = f"{self.owner}/{self.repo_name}"
|
|
56
|
+
self._project: GitLabProject | None = None
|
|
48
57
|
|
|
49
58
|
domain_url = self._normalize_url(
|
|
50
59
|
hvcs_domain
|
|
@@ -63,8 +72,14 @@ class Gitlab(RemoteHvcsBase):
|
|
|
63
72
|
).url.rstrip("/")
|
|
64
73
|
)
|
|
65
74
|
|
|
66
|
-
self._client = gitlab.Gitlab(self.hvcs_domain.url)
|
|
67
|
-
self._api_url = parse_url(self._client.
|
|
75
|
+
self._client = gitlab.Gitlab(self.hvcs_domain.url, private_token=self.token)
|
|
76
|
+
self._api_url = parse_url(self._client.api_url)
|
|
77
|
+
|
|
78
|
+
@property
|
|
79
|
+
def project(self) -> GitLabProject:
|
|
80
|
+
if self._project is None:
|
|
81
|
+
self._project = self._client.projects.get(self.project_namespace)
|
|
82
|
+
return self._project
|
|
68
83
|
|
|
69
84
|
@lru_cache(maxsize=1)
|
|
70
85
|
def _get_repository_owner_and_name(self) -> tuple[str, str]:
|
|
@@ -87,61 +102,146 @@ class Gitlab(RemoteHvcsBase):
|
|
|
87
102
|
assets: list[str] | None = None, # noqa: ARG002
|
|
88
103
|
) -> str:
|
|
89
104
|
"""
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
:
|
|
93
|
-
|
|
94
|
-
|
|
105
|
+
Create a release in a remote VCS, adding any release notes and assets to it
|
|
106
|
+
|
|
107
|
+
Arguments:
|
|
108
|
+
---------
|
|
109
|
+
tag(str): The tag to create the release for
|
|
110
|
+
release_notes(str): The changelog description for this version only
|
|
111
|
+
prerelease(bool): This parameter has no effect in GitLab
|
|
112
|
+
assets(list[str]): A list of paths to files to upload as assets (TODO: not implemented)
|
|
113
|
+
|
|
114
|
+
Returns:
|
|
115
|
+
-------
|
|
116
|
+
str: The tag of the release
|
|
117
|
+
|
|
118
|
+
Raises:
|
|
119
|
+
------
|
|
120
|
+
GitlabAuthenticationError: If authentication is not correct
|
|
121
|
+
GitlabCreateError: If the server cannot perform the request
|
|
122
|
+
|
|
95
123
|
"""
|
|
96
|
-
client = gitlab.Gitlab(self.hvcs_domain.url, private_token=self.token)
|
|
97
|
-
client.auth()
|
|
98
124
|
log.info("Creating release for %s", tag)
|
|
99
125
|
# ref: https://docs.gitlab.com/ee/api/releases/index.html#create-a-release
|
|
100
|
-
|
|
126
|
+
self.project.releases.create(
|
|
101
127
|
{
|
|
102
|
-
"name":
|
|
128
|
+
"name": tag,
|
|
103
129
|
"tag_name": tag,
|
|
130
|
+
"tag_message": tag,
|
|
104
131
|
"description": release_notes,
|
|
105
132
|
}
|
|
106
133
|
)
|
|
107
134
|
log.info("Successfully created release for %s", tag)
|
|
108
135
|
return tag
|
|
109
136
|
|
|
110
|
-
|
|
137
|
+
@logged_function(log)
|
|
138
|
+
@suppress_not_found
|
|
139
|
+
def get_release_by_tag(self, tag: str) -> gitlab.v4.objects.ProjectRelease | None:
|
|
140
|
+
"""
|
|
141
|
+
Get a release by its tag name
|
|
142
|
+
|
|
143
|
+
Arguments:
|
|
144
|
+
---------
|
|
145
|
+
tag(str): The tag name to get the release for
|
|
146
|
+
|
|
147
|
+
Returns:
|
|
148
|
+
-------
|
|
149
|
+
gitlab.v4.objects.ProjectRelease | None: The release object or None if not found
|
|
150
|
+
|
|
151
|
+
Raises:
|
|
152
|
+
------
|
|
153
|
+
gitlab.exceptions.GitlabAuthenticationError: If the user is not authenticated
|
|
154
|
+
|
|
155
|
+
"""
|
|
156
|
+
try:
|
|
157
|
+
return self.project.releases.get(tag)
|
|
158
|
+
except gitlab.exceptions.GitlabGetError:
|
|
159
|
+
log.debug("Release %s not found", tag)
|
|
160
|
+
return None
|
|
161
|
+
except KeyError as err:
|
|
162
|
+
raise UnexpectedResponse("JSON response is missing commit.id") from err
|
|
163
|
+
|
|
111
164
|
@logged_function(log)
|
|
112
165
|
def edit_release_notes( # type: ignore[override]
|
|
113
166
|
self,
|
|
114
|
-
|
|
167
|
+
release: gitlab.v4.objects.ProjectRelease,
|
|
115
168
|
release_notes: str,
|
|
116
169
|
) -> str:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
log.info("Updating release %s", release_id)
|
|
170
|
+
"""
|
|
171
|
+
Update the release notes for a given release
|
|
120
172
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
173
|
+
Arguments:
|
|
174
|
+
---------
|
|
175
|
+
release(gitlab.v4.objects.ProjectRelease): The release object to update
|
|
176
|
+
release_notes(str): The new release notes
|
|
177
|
+
|
|
178
|
+
Returns:
|
|
179
|
+
-------
|
|
180
|
+
str: The release id
|
|
181
|
+
|
|
182
|
+
Raises:
|
|
183
|
+
------
|
|
184
|
+
GitlabAuthenticationError: If authentication is not correct
|
|
185
|
+
GitlabUpdateError: If the server cannot perform the request
|
|
186
|
+
|
|
187
|
+
"""
|
|
188
|
+
log.info(
|
|
189
|
+
"Updating release %s [%s]",
|
|
190
|
+
release.name,
|
|
191
|
+
release.attributes.get("commit", {}).get("id"),
|
|
126
192
|
)
|
|
127
|
-
|
|
193
|
+
release.description = release_notes
|
|
194
|
+
release.save()
|
|
195
|
+
return str(release.get_id())
|
|
128
196
|
|
|
129
197
|
@logged_function(log)
|
|
130
198
|
def create_or_update_release(
|
|
131
199
|
self, tag: str, release_notes: str, prerelease: bool = False
|
|
132
200
|
) -> str:
|
|
201
|
+
"""
|
|
202
|
+
Create or update a release for the given tag in a remote VCS
|
|
203
|
+
|
|
204
|
+
Arguments:
|
|
205
|
+
---------
|
|
206
|
+
tag(str): The tag to create or update the release for
|
|
207
|
+
release_notes(str): The changelog description for this version only
|
|
208
|
+
prerelease(bool): This parameter has no effect in GitLab
|
|
209
|
+
|
|
210
|
+
Returns:
|
|
211
|
+
-------
|
|
212
|
+
str: The release id
|
|
213
|
+
|
|
214
|
+
Raises:
|
|
215
|
+
------
|
|
216
|
+
ValueError: If the release could not be created or updated
|
|
217
|
+
gitlab.exceptions.GitlabAuthenticationError: If the user is not authenticated
|
|
218
|
+
GitlabUpdateError: If the server cannot perform the request
|
|
219
|
+
|
|
220
|
+
"""
|
|
133
221
|
try:
|
|
134
222
|
return self.create_release(
|
|
135
223
|
tag=tag, release_notes=release_notes, prerelease=prerelease
|
|
136
224
|
)
|
|
137
225
|
except gitlab.GitlabCreateError:
|
|
138
226
|
log.info(
|
|
139
|
-
"
|
|
227
|
+
"New release %s could not be created for project %s",
|
|
140
228
|
tag,
|
|
141
|
-
self.
|
|
142
|
-
|
|
229
|
+
self.project_namespace,
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
if (release_obj := self.get_release_by_tag(tag)) is None:
|
|
233
|
+
raise ValueError(
|
|
234
|
+
f"release for tag {tag} could not be found, and could not be created"
|
|
143
235
|
)
|
|
144
|
-
|
|
236
|
+
|
|
237
|
+
log.debug(
|
|
238
|
+
"Found existing release commit %s, updating", release_obj.commit.get("id")
|
|
239
|
+
)
|
|
240
|
+
# If this errors we let it die
|
|
241
|
+
return self.edit_release_notes(
|
|
242
|
+
release=release_obj,
|
|
243
|
+
release_notes=release_notes,
|
|
244
|
+
)
|
|
145
245
|
|
|
146
246
|
def remote_url(self, use_token: bool = True) -> str:
|
|
147
247
|
"""Get the remote url including the token for authentication if requested"""
|
|
@@ -150,7 +250,7 @@ class Gitlab(RemoteHvcsBase):
|
|
|
150
250
|
|
|
151
251
|
return self.create_server_url(
|
|
152
252
|
auth=f"gitlab-ci-token:{self.token}",
|
|
153
|
-
path=f"{self.
|
|
253
|
+
path=f"{self.project_namespace}.git",
|
|
154
254
|
)
|
|
155
255
|
|
|
156
256
|
def compare_url(self, from_rev: str, to_rev: str) -> str:
|
{python_semantic_release-9.7.2 → python_semantic_release-9.8.0}/tests/command_line/test_version.py
RENAMED
|
@@ -5,7 +5,9 @@ import filecmp
|
|
|
5
5
|
import os
|
|
6
6
|
import re
|
|
7
7
|
import shutil
|
|
8
|
+
from pathlib import Path
|
|
8
9
|
from subprocess import CompletedProcess
|
|
10
|
+
from textwrap import dedent
|
|
9
11
|
from typing import TYPE_CHECKING
|
|
10
12
|
from unittest import mock
|
|
11
13
|
|
|
@@ -24,7 +26,6 @@ from tests.util import (
|
|
|
24
26
|
)
|
|
25
27
|
|
|
26
28
|
if TYPE_CHECKING:
|
|
27
|
-
from pathlib import Path
|
|
28
29
|
from unittest.mock import MagicMock
|
|
29
30
|
|
|
30
31
|
from click.testing import CliRunner
|
|
@@ -547,6 +548,55 @@ def test_version_prints_current_version_if_no_new_version(
|
|
|
547
548
|
assert result.stdout == "1.2.0-alpha.2\n"
|
|
548
549
|
|
|
549
550
|
|
|
551
|
+
def test_version_version_no_verify(
|
|
552
|
+
repo_with_single_branch_angular_commits: Repo,
|
|
553
|
+
cli_runner: CliRunner,
|
|
554
|
+
update_pyproject_toml: UpdatePyprojectTomlFn,
|
|
555
|
+
):
|
|
556
|
+
# setup: set configuration setting
|
|
557
|
+
update_pyproject_toml("tool.semantic_release.no_git_verify", True)
|
|
558
|
+
repo_with_single_branch_angular_commits.git.commit(
|
|
559
|
+
m="chore: adjust project configuration for --no-verify release commits", a=True
|
|
560
|
+
)
|
|
561
|
+
# create executable pre-commit script
|
|
562
|
+
precommit_hook = Path(
|
|
563
|
+
repo_with_single_branch_angular_commits.git_dir, "hooks", "pre-commit"
|
|
564
|
+
)
|
|
565
|
+
precommit_hook.parent.mkdir(parents=True, exist_ok=True)
|
|
566
|
+
precommit_hook.write_text(
|
|
567
|
+
dedent(
|
|
568
|
+
"""\
|
|
569
|
+
#!/bin/sh
|
|
570
|
+
echo >&2 "Always fail pre-commit" && exit 1;
|
|
571
|
+
"""
|
|
572
|
+
)
|
|
573
|
+
)
|
|
574
|
+
precommit_hook.chmod(0o754)
|
|
575
|
+
repo_with_single_branch_angular_commits.git.config(
|
|
576
|
+
"core.hookspath",
|
|
577
|
+
str(
|
|
578
|
+
precommit_hook.parent.relative_to(
|
|
579
|
+
repo_with_single_branch_angular_commits.working_dir
|
|
580
|
+
)
|
|
581
|
+
),
|
|
582
|
+
local=True,
|
|
583
|
+
)
|
|
584
|
+
# Take measurement beforehand
|
|
585
|
+
head_before = repo_with_single_branch_angular_commits.head.commit
|
|
586
|
+
|
|
587
|
+
# Execute
|
|
588
|
+
result = cli_runner.invoke(
|
|
589
|
+
main, [version_subcmd, "--patch", "--no-tag", "--no-push"]
|
|
590
|
+
)
|
|
591
|
+
|
|
592
|
+
# Evaluate
|
|
593
|
+
head_after = repo_with_single_branch_angular_commits.head.commit
|
|
594
|
+
|
|
595
|
+
assert head_before != head_after # A commit has been made
|
|
596
|
+
assert head_before in repo_with_single_branch_angular_commits.head.commit.parents
|
|
597
|
+
assert result.exit_code == 0
|
|
598
|
+
|
|
599
|
+
|
|
550
600
|
@pytest.mark.parametrize("shell", ("/usr/bin/bash", "/usr/bin/zsh", "powershell"))
|
|
551
601
|
def test_version_runs_build_command(
|
|
552
602
|
repo_with_git_flow_angular_commits: Repo,
|