python-semantic-release 9.3.0__tar.gz → 9.3.1__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.3.0/python_semantic_release.egg-info → python-semantic-release-9.3.1}/PKG-INFO +2 -2
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/pyproject.toml +2 -2
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1/python_semantic_release.egg-info}/PKG-INFO +2 -2
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/python_semantic_release.egg-info/requires.txt +1 -1
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/__init__.py +1 -1
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/commands/version.py +7 -2
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/errors.py +7 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/version/algorithm.py +84 -60
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/AUTHORS.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/LICENSE +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/MANIFEST.in +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/README.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/Makefile +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/algorithm.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/automatic-releases/cronjobs.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/automatic-releases/github-actions.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/automatic-releases/index.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/automatic-releases/travis.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/changelog_templates.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/commands.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/commit-parsing.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/conf.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/configuration.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/contributing.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/contributors.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/github-action.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/index.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/make.bat +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/migrating_from_v7.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/multibranch_releases.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/strict_mode.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/troubleshooting.rst +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/python_semantic_release.egg-info/SOURCES.txt +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/python_semantic_release.egg-info/dependency_links.txt +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/python_semantic_release.egg-info/entry_points.txt +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/python_semantic_release.egg-info/top_level.txt +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/__main__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/changelog/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/changelog/context.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/changelog/release_history.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/changelog/template.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/commands/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/commands/changelog.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/commands/cli_context.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/commands/generate_config.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/commands/main.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/commands/publish.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/common.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/config.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/const.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/github_actions_output.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/masking_filter.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/util.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/commit_parser/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/commit_parser/_base.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/commit_parser/angular.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/commit_parser/emoji.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/commit_parser/scipy.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/commit_parser/tag.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/commit_parser/token.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/commit_parser/util.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/const.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/data/templates/CHANGELOG.md.j2 +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/data/templates/release_notes.md.j2 +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/enums.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/helpers.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/hvcs/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/hvcs/_base.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/hvcs/bitbucket.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/hvcs/gitea.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/hvcs/github.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/hvcs/gitlab.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/hvcs/token_auth.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/hvcs/util.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/version/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/version/declaration.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/version/translator.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/version/version.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/setup.cfg +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/command_line/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/command_line/conftest.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/command_line/test_changelog.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/command_line/test_generate_config.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/command_line/test_help.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/command_line/test_main.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/command_line/test_publish.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/command_line/test_version.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/conftest.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/const.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/commit_parsers.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/example_project.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/git_repo.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/repos/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/repos/git_flow/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/repos/github_flow/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/repos/github_flow/repo_w_release_channels.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/repos/trunk_based_dev/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/scipy.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/scenario/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/scenario/test_next_version.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/scenario/test_release_history.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/scenario/test_template_render.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/changelog/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/changelog/test_default_changelog.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/changelog/test_release_notes.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/changelog/test_template.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/cli/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/cli/test_config.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/cli/test_github_actions_output.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/cli/test_masking_filter.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/cli/test_util.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/cli/test_version.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/commit_parser/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/commit_parser/helper.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/commit_parser/test_angular.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/commit_parser/test_emoji.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/commit_parser/test_scipy.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/commit_parser/test_tag.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/commit_parser/test_token.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/commit_parser/test_util.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/hvcs/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/hvcs/test__base.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/hvcs/test_bitbucket.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/hvcs/test_gitea.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/hvcs/test_github.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/hvcs/test_gitlab.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/hvcs/test_token_auth.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/hvcs/test_util.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/test_helpers.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/version/__init__.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/version/test_algorithm.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/version/test_declaration.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/version/test_translator.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/unit/semantic_release/version/test_version.py +0 -0
- {python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/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.
|
|
3
|
+
Version: 9.3.1
|
|
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.3; extra == "test"
|
|
|
53
53
|
Provides-Extra: dev
|
|
54
54
|
Requires-Dist: pre-commit; extra == "dev"
|
|
55
55
|
Requires-Dist: tox; extra == "dev"
|
|
56
|
-
Requires-Dist: ruff==0.3.
|
|
56
|
+
Requires-Dist: ruff==0.3.3; extra == "dev"
|
|
57
57
|
Provides-Extra: mypy
|
|
58
58
|
Requires-Dist: mypy; extra == "mypy"
|
|
59
59
|
Requires-Dist: types-requests; extra == "mypy"
|
|
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "python-semantic-release"
|
|
9
|
-
version = "9.3.
|
|
9
|
+
version = "9.3.1"
|
|
10
10
|
description = "Automatic Semantic Versioning for Python projects"
|
|
11
11
|
requires-python = ">=3.8"
|
|
12
12
|
license = { text = "MIT" }
|
|
@@ -68,7 +68,7 @@ test = [
|
|
|
68
68
|
"requests-mock>=1.10.0,<2",
|
|
69
69
|
"types-pytest-lazy-fixture>=0.6.3.3",
|
|
70
70
|
]
|
|
71
|
-
dev = ["pre-commit", "tox", "ruff==0.3.
|
|
71
|
+
dev = ["pre-commit", "tox", "ruff==0.3.3"]
|
|
72
72
|
mypy = ["mypy", "types-requests"]
|
|
73
73
|
|
|
74
74
|
[tool.pytest.ini_options]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-semantic-release
|
|
3
|
-
Version: 9.3.
|
|
3
|
+
Version: 9.3.1
|
|
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.3; extra == "test"
|
|
|
53
53
|
Provides-Extra: dev
|
|
54
54
|
Requires-Dist: pre-commit; extra == "dev"
|
|
55
55
|
Requires-Dist: tox; extra == "dev"
|
|
56
|
-
Requires-Dist: ruff==0.3.
|
|
56
|
+
Requires-Dist: ruff==0.3.3; extra == "dev"
|
|
57
57
|
Provides-Extra: mypy
|
|
58
58
|
Requires-Dist: mypy; extra == "mypy"
|
|
59
59
|
Requires-Dist: types-requests; extra == "mypy"
|
|
@@ -585,12 +585,17 @@ def version( # noqa: C901
|
|
|
585
585
|
indented(
|
|
586
586
|
f"""
|
|
587
587
|
would have run:
|
|
588
|
-
git push
|
|
588
|
+
git push {runtime.masker.mask(remote_url)} tag {new_version.as_tag()}
|
|
589
589
|
""" # noqa: E501
|
|
590
590
|
)
|
|
591
591
|
)
|
|
592
592
|
elif create_tag:
|
|
593
|
-
|
|
593
|
+
# push specific tag refspec (that we made) to remote
|
|
594
|
+
# ---------------
|
|
595
|
+
# Resolves issue #803 where a tag that already existed was pushed and caused
|
|
596
|
+
# a failure. Its not clear why there was an incorrect tag (likely user error change)
|
|
597
|
+
# but we will avoid possibly pushing an separate tag that we didn't create.
|
|
598
|
+
repo.git.push(remote_url, "tag", new_version.as_tag())
|
|
594
599
|
|
|
595
600
|
gha_output.released = True
|
|
596
601
|
|
|
@@ -31,3 +31,10 @@ class CommitParseError(SemanticReleaseBaseError):
|
|
|
31
31
|
Raised when a commit cannot be parsed by a commit parser. Custom commit parsers
|
|
32
32
|
should also raise this Exception
|
|
33
33
|
"""
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class MissingMergeBaseError(SemanticReleaseBaseError):
|
|
37
|
+
"""
|
|
38
|
+
Raised when the merge base cannot be found with the current history. Generally
|
|
39
|
+
because of a shallow git clone.
|
|
40
|
+
"""
|
|
@@ -4,12 +4,10 @@ import logging
|
|
|
4
4
|
from queue import Queue
|
|
5
5
|
from typing import TYPE_CHECKING, Iterable
|
|
6
6
|
|
|
7
|
-
from semantic_release.commit_parser import
|
|
8
|
-
ParsedCommit,
|
|
9
|
-
)
|
|
7
|
+
from semantic_release.commit_parser import ParsedCommit
|
|
10
8
|
from semantic_release.const import DEFAULT_VERSION
|
|
11
9
|
from semantic_release.enums import LevelBump
|
|
12
|
-
from semantic_release.errors import InvalidVersion
|
|
10
|
+
from semantic_release.errors import InvalidVersion, MissingMergeBaseError
|
|
13
11
|
from semantic_release.version.version import Version
|
|
14
12
|
|
|
15
13
|
if TYPE_CHECKING:
|
|
@@ -278,9 +276,9 @@ def next_version(
|
|
|
278
276
|
"""
|
|
279
277
|
# Step 1. All tags, sorted descending by semver ordering rules
|
|
280
278
|
all_git_tags_as_versions = tags_and_versions(repo.tags, translator)
|
|
281
|
-
all_full_release_tags_and_versions =
|
|
282
|
-
(
|
|
283
|
-
|
|
279
|
+
all_full_release_tags_and_versions = list(
|
|
280
|
+
filter(lambda t_v: not t_v[1].is_prerelease, all_git_tags_as_versions)
|
|
281
|
+
)
|
|
284
282
|
log.info(
|
|
285
283
|
"Found %s full releases (excluding prereleases)",
|
|
286
284
|
len(all_full_release_tags_and_versions),
|
|
@@ -291,30 +289,59 @@ def next_version(
|
|
|
291
289
|
iter(all_full_release_tags_and_versions),
|
|
292
290
|
(None, translator.from_string(DEFAULT_VERSION)),
|
|
293
291
|
)
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
292
|
+
|
|
293
|
+
# we can safely scan the extra commits on this
|
|
294
|
+
# branch if it's never been released, but we have no other
|
|
295
|
+
# guarantees that other branches exist
|
|
296
|
+
# Note the merge_base might be on our current branch, it's not
|
|
297
|
+
# necessarily the merge base of the current branch with `main`
|
|
298
|
+
other_ref = (
|
|
299
|
+
repo.active_branch
|
|
300
|
+
if latest_full_release_tag is None
|
|
301
|
+
else latest_full_release_tag.name
|
|
302
|
+
)
|
|
303
|
+
|
|
304
|
+
# Conditional log message to inform what was chosen as the comparison point
|
|
305
|
+
# to find the merge base of the current branch with the latest full release
|
|
306
|
+
log_msg = (
|
|
307
|
+
str.join(
|
|
308
|
+
", ",
|
|
309
|
+
[
|
|
310
|
+
"No full releases have been made yet",
|
|
311
|
+
f"the default version to use is {latest_full_release_version}",
|
|
312
|
+
],
|
|
301
313
|
)
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
latest_full_release_tag,
|
|
314
|
+
if latest_full_release_tag is None
|
|
315
|
+
else str.join(
|
|
316
|
+
", ",
|
|
317
|
+
[
|
|
318
|
+
f"The last full release was {latest_full_release_version}",
|
|
319
|
+
f"tagged as {latest_full_release_tag!r}",
|
|
320
|
+
],
|
|
310
321
|
)
|
|
311
|
-
|
|
322
|
+
)
|
|
323
|
+
|
|
324
|
+
log.info(log_msg)
|
|
325
|
+
merge_bases = repo.merge_base(other_ref, repo.active_branch)
|
|
326
|
+
|
|
327
|
+
if len(merge_bases) < 1:
|
|
328
|
+
raise MissingMergeBaseError(
|
|
329
|
+
f"Unable to find merge-base between {other_ref} and {repo.active_branch.name}"
|
|
330
|
+
)
|
|
331
|
+
|
|
312
332
|
if len(merge_bases) > 1:
|
|
313
333
|
raise NotImplementedError(
|
|
314
|
-
|
|
315
|
-
|
|
334
|
+
str.join(
|
|
335
|
+
" ",
|
|
336
|
+
[
|
|
337
|
+
"This branch has more than one merge-base with the",
|
|
338
|
+
"latest version, which is not yet supported",
|
|
339
|
+
],
|
|
340
|
+
)
|
|
316
341
|
)
|
|
342
|
+
|
|
317
343
|
merge_base = merge_bases[0]
|
|
344
|
+
|
|
318
345
|
if merge_base is None:
|
|
319
346
|
str_tag_name = (
|
|
320
347
|
"None" if latest_full_release_tag is None else latest_full_release_tag.name
|
|
@@ -350,6 +377,23 @@ def next_version(
|
|
|
350
377
|
tag_format=translator.tag_format,
|
|
351
378
|
)
|
|
352
379
|
|
|
380
|
+
# We only include pre-releases here if doing a prerelease.
|
|
381
|
+
# If it's not a prerelease, we need to include commits back
|
|
382
|
+
# to the last full version in consideration for what kind of
|
|
383
|
+
# bump to produce. However if we're doing a prerelease, we can
|
|
384
|
+
# include prereleases here to potentially consider a smaller portion
|
|
385
|
+
# of history (from a prerelease since the last full release, onwards)
|
|
386
|
+
|
|
387
|
+
# Note that a side-effect of this is, if at some point the configuration
|
|
388
|
+
# for a particular branch pattern changes w.r.t. prerelease=True/False,
|
|
389
|
+
# the new kind of version will be produced from the commits already
|
|
390
|
+
# included in a prerelease since the last full release on the branch
|
|
391
|
+
tag_sha_2_version_lookup = {
|
|
392
|
+
tag.commit.hexsha: (tag, version)
|
|
393
|
+
for tag, version in all_git_tags_as_versions
|
|
394
|
+
if prerelease or not version.is_prerelease
|
|
395
|
+
}
|
|
396
|
+
|
|
353
397
|
# N.B. these should be sorted so long as we iterate the commits in reverse order
|
|
354
398
|
for commit in commits_since_last_full_release:
|
|
355
399
|
parse_result = commit_parser.parse(commit)
|
|
@@ -360,44 +404,24 @@ def next_version(
|
|
|
360
404
|
)
|
|
361
405
|
parsed_levels.add(parse_result.bump)
|
|
362
406
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
# include prereleases here to potentially consider a smaller portion
|
|
368
|
-
# of history (from a prerelease since the last full release, onwards)
|
|
369
|
-
|
|
370
|
-
# Note that a side-effect of this is, if at some point the configuration
|
|
371
|
-
# for a particular branch pattern changes w.r.t. prerelease=True/False,
|
|
372
|
-
# the new kind of version will be produced from the commits already
|
|
373
|
-
# included in a prerelease since the last full release on the branch
|
|
374
|
-
for tag, version in (
|
|
375
|
-
(tag, version)
|
|
376
|
-
for tag, version in all_git_tags_as_versions
|
|
377
|
-
if prerelease or not version.is_prerelease
|
|
378
|
-
):
|
|
379
|
-
log.debug(
|
|
380
|
-
"testing if tag %r (%s) matches commit %s",
|
|
381
|
-
tag.name,
|
|
382
|
-
tag.commit.hexsha,
|
|
383
|
-
commit.hexsha,
|
|
384
|
-
)
|
|
385
|
-
if tag.commit == commit:
|
|
386
|
-
latest_version = version
|
|
387
|
-
log.debug(
|
|
388
|
-
"tag %r (%s) matches commit %s. the latest version is %s",
|
|
389
|
-
tag.name,
|
|
390
|
-
tag.commit.hexsha,
|
|
391
|
-
commit.hexsha,
|
|
392
|
-
latest_version,
|
|
393
|
-
)
|
|
394
|
-
break
|
|
395
|
-
else:
|
|
407
|
+
log.debug("checking if commit %s matches any tags", commit.hexsha)
|
|
408
|
+
t_v = tag_sha_2_version_lookup.get(commit.hexsha, None)
|
|
409
|
+
|
|
410
|
+
if t_v is None:
|
|
396
411
|
# If we haven't found the latest prerelease on the branch,
|
|
397
|
-
# keep the
|
|
412
|
+
# keep the loop going to look for it
|
|
398
413
|
log.debug("no tags correspond to commit %s", commit.hexsha)
|
|
399
414
|
continue
|
|
400
|
-
|
|
415
|
+
|
|
416
|
+
# Unpack the tuple
|
|
417
|
+
tag, latest_version = t_v
|
|
418
|
+
log.debug(
|
|
419
|
+
"tag %r (%s) matches commit %s. the latest version is %s",
|
|
420
|
+
tag.name,
|
|
421
|
+
tag.commit.hexsha,
|
|
422
|
+
commit.hexsha,
|
|
423
|
+
latest_version,
|
|
424
|
+
)
|
|
401
425
|
break
|
|
402
426
|
|
|
403
427
|
log.debug(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/automatic-releases/cronjobs.rst
RENAMED
|
File without changes
|
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/automatic-releases/index.rst
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/automatic-releases/travis.rst
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/changelog_templates.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/docs/multibranch_releases.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/__main__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/common.py
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/config.py
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/const.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/cli/util.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/hvcs/__init__.py
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/hvcs/_base.py
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/hvcs/bitbucket.py
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/hvcs/gitea.py
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/hvcs/github.py
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/hvcs/gitlab.py
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/hvcs/token_auth.py
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/hvcs/util.py
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/version/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/semantic_release/version/version.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/command_line/__init__.py
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/command_line/conftest.py
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/command_line/test_changelog.py
RENAMED
|
File without changes
|
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/command_line/test_help.py
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/command_line/test_main.py
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/command_line/test_publish.py
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/command_line/test_version.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/commit_parsers.py
RENAMED
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/example_project.py
RENAMED
|
File without changes
|
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/fixtures/repos/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-semantic-release-9.3.0 → python-semantic-release-9.3.1}/tests/scenario/test_next_version.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|