python-semantic-release 9.15.1__tar.gz → 9.16.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.15.1/src/python_semantic_release.egg-info → python_semantic_release-9.16.0}/PKG-INFO +2 -2
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/automatic-releases/github-actions.rst +5 -5
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/commit_parsing.rst +34 -13
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/configuration.rst +1 -1
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/pyproject.toml +2 -2
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0/src/python_semantic_release.egg-info}/PKG-INFO +2 -2
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/python_semantic_release.egg-info/SOURCES.txt +18 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/python_semantic_release.egg-info/requires.txt +1 -1
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/__init__.py +1 -1
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/__main__.py +8 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/changelog/template.py +2 -2
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/cli/commands/main.py +11 -2
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/cli/commands/version.py +17 -8
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/cli/config.py +46 -13
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/enums.py +30 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/gitproject.py +50 -20
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/helpers.py +41 -4
- python_semantic_release-9.16.0/src/semantic_release/version/algorithm.py +383 -0
- python_semantic_release-9.16.0/tests/e2e/cmd_config/test_generate_config.py +161 -0
- python_semantic_release-9.16.0/tests/e2e/cmd_version/bump_version/conftest.py +60 -0
- python_semantic_release-9.16.0/tests/e2e/cmd_version/bump_version/git_flow/test_repo_1_channel.py +176 -0
- python_semantic_release-9.16.0/tests/e2e/cmd_version/bump_version/git_flow/test_repo_2_channels.py +176 -0
- python_semantic_release-9.16.0/tests/e2e/cmd_version/bump_version/git_flow/test_repo_3_channels.py +178 -0
- python_semantic_release-9.16.0/tests/e2e/cmd_version/bump_version/git_flow/test_repo_4_channels.py +176 -0
- python_semantic_release-9.16.0/tests/e2e/cmd_version/bump_version/github_flow/test_repo_1_channel.py +176 -0
- python_semantic_release-9.16.0/tests/e2e/cmd_version/bump_version/github_flow/test_repo_2_channels.py +176 -0
- python_semantic_release-9.16.0/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk.py +176 -0
- python_semantic_release-9.16.0/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_dual_version_support.py +182 -0
- python_semantic_release-9.16.0/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_dual_version_support_w_prereleases.py +202 -0
- python_semantic_release-9.16.0/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_w_prereleases.py +196 -0
- python_semantic_release-9.16.0/tests/e2e/cmd_version/test_version_changelog_custom_commit_msg.py +218 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/cmd_version/test_version_print.py +425 -9
- python_semantic_release-9.16.0/tests/e2e/conftest.py +191 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/example_project.py +62 -22
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/git_repo.py +138 -24
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/repos/git_flow/repo_w_1_release_channel.py +1 -1
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py +1 -1
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py +1 -1
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/repos/git_flow/repo_w_4_release_channels.py +2 -1
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/repos/trunk_based_dev/__init__.py +2 -0
- python_semantic_release-9.16.0/tests/fixtures/repos/trunk_based_dev/repo_w_dual_version_support.py +460 -0
- python_semantic_release-9.16.0/tests/fixtures/repos/trunk_based_dev/repo_w_dual_version_support_w_prereleases.py +545 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py +44 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py +39 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/cli/test_config.py +86 -6
- python_semantic_release-9.16.0/tests/unit/semantic_release/commit_parser/__init__.py +0 -0
- python_semantic_release-9.16.0/tests/unit/semantic_release/hvcs/__init__.py +0 -0
- python_semantic_release-9.16.0/tests/unit/semantic_release/hvcs/test_util.py +0 -0
- python_semantic_release-9.16.0/tests/unit/semantic_release/version/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/version/test_algorithm.py +167 -186
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/util.py +8 -3
- python_semantic_release-9.15.1/src/semantic_release/version/algorithm.py +0 -457
- python_semantic_release-9.15.1/tests/e2e/cmd_config/test_generate_config.py +0 -76
- python_semantic_release-9.15.1/tests/e2e/conftest.py +0 -107
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/AUTHORS.rst +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/LICENSE +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/MANIFEST.in +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/README.rst +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/Makefile +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/algorithm.rst +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/automatic-releases/cronjobs.rst +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/automatic-releases/index.rst +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/automatic-releases/travis.rst +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/changelog_templates.rst +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/commands.rst +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/conf.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/contributing.rst +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/contributors.rst +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/index.rst +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/make.bat +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/migrating_from_v7.rst +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/multibranch_releases.rst +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/strict_mode.rst +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/docs/troubleshooting.rst +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/setup.cfg +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/python_semantic_release.egg-info/dependency_links.txt +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/python_semantic_release.egg-info/entry_points.txt +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/python_semantic_release.egg-info/top_level.txt +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/changelog/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/changelog/context.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/changelog/release_history.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/cli/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/cli/changelog_writer.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/cli/cli_context.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/cli/commands/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/cli/commands/changelog.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/cli/commands/generate_config.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/cli/commands/publish.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/cli/const.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/cli/github_actions_output.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/cli/masking_filter.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/cli/util.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/commit_parser/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/commit_parser/_base.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/commit_parser/angular.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/commit_parser/emoji.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/commit_parser/scipy.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/commit_parser/tag.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/commit_parser/token.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/commit_parser/util.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/const.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/md/.components/changelog_header.md.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/md/.components/changelog_init.md.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/md/.components/changelog_update.md.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/md/.components/changes.md.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/md/.components/first_release.md.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/md/.components/macros.md.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/md/.components/unreleased_changes.md.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/md/.components/versioned_changes.md.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/md/.release_notes.md.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/md/CHANGELOG.md.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/rst/.components/changelog_header.rst.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/rst/.components/changelog_init.rst.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/rst/.components/changelog_update.rst.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/rst/.components/changes.rst.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/rst/.components/first_release.rst.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/rst/.components/macros.rst.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/rst/.components/unreleased_changes.rst.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/rst/.components/versioned_changes.rst.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/data/templates/angular/rst/CHANGELOG.rst.j2 +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/errors.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/globals.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/hvcs/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/hvcs/_base.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/hvcs/bitbucket.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/hvcs/gitea.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/hvcs/github.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/hvcs/gitlab.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/hvcs/remote_hvcs_base.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/hvcs/token_auth.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/hvcs/util.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/py.typed +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/version/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/version/declaration.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/version/translator.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/version/version.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/conftest.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/const.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/cmd_changelog/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/cmd_changelog/test_changelog.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/cmd_changelog/test_changelog_custom_parser.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/cmd_config/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/cmd_publish/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/cmd_publish/test_publish.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/cmd_version/__init__.py +0 -0
- {python_semantic_release-9.15.1/tests/unit → python_semantic_release-9.16.0/tests/e2e/cmd_version/bump_version}/__init__.py +0 -0
- {python_semantic_release-9.15.1/tests/unit/semantic_release → python_semantic_release-9.16.0/tests/e2e/cmd_version/bump_version/git_flow}/__init__.py +0 -0
- {python_semantic_release-9.15.1/tests/unit/semantic_release/changelog → python_semantic_release-9.16.0/tests/e2e/cmd_version/bump_version/github_flow}/__init__.py +0 -0
- {python_semantic_release-9.15.1/tests/unit/semantic_release/cli → python_semantic_release-9.16.0/tests/e2e/cmd_version/bump_version/trunk_based_dev}/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/cmd_version/test_version.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/cmd_version/test_version_build.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/cmd_version/test_version_bump.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/cmd_version/test_version_changelog.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/cmd_version/test_version_github_actions.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/cmd_version/test_version_release_notes.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/cmd_version/test_version_stamp.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/cmd_version/test_version_strict.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/test_help.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/e2e/test_main.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/commit_parsers.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/repos/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/repos/git_flow/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/repos/github_flow/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/repos/github_flow/repo_w_default_release.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/repos/github_flow/repo_w_release_channels.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/repos/repo_initial_commit.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/fixtures/scipy.py +0 -0
- {python_semantic_release-9.15.1/tests/unit/semantic_release/commit_parser → python_semantic_release-9.16.0/tests/unit}/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/conftest.py +0 -0
- {python_semantic_release-9.15.1/tests/unit/semantic_release/hvcs → python_semantic_release-9.16.0/tests/unit/semantic_release}/__init__.py +0 -0
- {python_semantic_release-9.15.1/tests/unit/semantic_release/version → python_semantic_release-9.16.0/tests/unit/semantic_release/changelog}/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/changelog/conftest.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/changelog/test_changelog_context.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/changelog/test_default_changelog.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/changelog/test_release_history.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/changelog/test_release_notes.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/changelog/test_template.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/changelog/test_template_render.py +0 -0
- /python_semantic_release-9.15.1/tests/unit/semantic_release/hvcs/test_util.py → /python_semantic_release-9.16.0/tests/unit/semantic_release/cli/__init__.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/cli/test_github_actions_output.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/cli/test_masking_filter.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/cli/test_util.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/cli/test_version.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/commit_parser/test_angular.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/commit_parser/test_emoji.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/commit_parser/test_parsed_commit.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/commit_parser/test_scipy.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/commit_parser/test_util.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/hvcs/test__base.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/hvcs/test_bitbucket.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/hvcs/test_gitea.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/hvcs/test_github.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/hvcs/test_gitlab.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/hvcs/test_token_auth.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/test_helpers.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/version/test_declaration.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/tests/unit/semantic_release/version/test_translator.py +0 -0
- {python_semantic_release-9.15.1 → python_semantic_release-9.16.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.16.0
|
|
4
4
|
Summary: Automatic Semantic Versioning for Python projects
|
|
5
5
|
Author-email: Rolf Erik Lekang <me@rolflekang.com>
|
|
6
6
|
License: MIT
|
|
@@ -62,7 +62,7 @@ Requires-Dist: pre-commit~=3.5; extra == "dev"
|
|
|
62
62
|
Requires-Dist: tox~=4.11; extra == "dev"
|
|
63
63
|
Requires-Dist: ruff==0.6.1; extra == "dev"
|
|
64
64
|
Provides-Extra: mypy
|
|
65
|
-
Requires-Dist: mypy==1.
|
|
65
|
+
Requires-Dist: mypy==1.14.1; extra == "mypy"
|
|
66
66
|
Requires-Dist: types-requests~=2.32.0; extra == "mypy"
|
|
67
67
|
Requires-Dist: types-pyyaml~=6.0; extra == "mypy"
|
|
68
68
|
|
|
@@ -337,7 +337,7 @@ before the :ref:`version <cmd-version>` subcommand.
|
|
|
337
337
|
|
|
338
338
|
.. code:: yaml
|
|
339
339
|
|
|
340
|
-
- uses: python-semantic-release/python-semantic-release@v9.
|
|
340
|
+
- uses: python-semantic-release/python-semantic-release@v9.16.0
|
|
341
341
|
with:
|
|
342
342
|
root_options: "-vv --noop"
|
|
343
343
|
|
|
@@ -684,7 +684,7 @@ to the GitHub Release Assets as well.
|
|
|
684
684
|
- name: Action | Semantic Version Release
|
|
685
685
|
id: release
|
|
686
686
|
# Adjust tag with desired version if applicable.
|
|
687
|
-
uses: python-semantic-release/python-semantic-release@v9.
|
|
687
|
+
uses: python-semantic-release/python-semantic-release@v9.16.0
|
|
688
688
|
with:
|
|
689
689
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
690
690
|
git_committer_name: "github-actions"
|
|
@@ -744,7 +744,7 @@ The equivalent GitHub Action configuration would be:
|
|
|
744
744
|
|
|
745
745
|
- name: Action | Semantic Version Release
|
|
746
746
|
# Adjust tag with desired version if applicable.
|
|
747
|
-
uses: python-semantic-release/python-semantic-release@v9.
|
|
747
|
+
uses: python-semantic-release/python-semantic-release@v9.16.0
|
|
748
748
|
with:
|
|
749
749
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
750
750
|
force: patch
|
|
@@ -772,13 +772,13 @@ Publish Action.
|
|
|
772
772
|
.. code:: yaml
|
|
773
773
|
|
|
774
774
|
- name: Release Project 1
|
|
775
|
-
uses: python-semantic-release/python-semantic-release@v9.
|
|
775
|
+
uses: python-semantic-release/python-semantic-release@v9.16.0
|
|
776
776
|
with:
|
|
777
777
|
directory: ./project1
|
|
778
778
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
779
779
|
|
|
780
780
|
- name: Release Project 2
|
|
781
|
-
uses: python-semantic-release/python-semantic-release@v9.
|
|
781
|
+
uses: python-semantic-release/python-semantic-release@v9.16.0
|
|
782
782
|
with:
|
|
783
783
|
directory: ./project2
|
|
784
784
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -334,19 +334,40 @@ where appropriate to assist with static type-checking.
|
|
|
334
334
|
|
|
335
335
|
The :ref:`commit_parser <config-commit_parser>` option, if set to a string which
|
|
336
336
|
does not match one of Python Semantic Release's built-in commit parsers, will be
|
|
337
|
-
used to attempt to dynamically import a custom commit parser class.
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
337
|
+
used to attempt to dynamically import a custom commit parser class.
|
|
338
|
+
|
|
339
|
+
In order to use your custom parser, you must provide how to import the module and class
|
|
340
|
+
via the configuration option. There are two ways to provide the import string:
|
|
341
|
+
|
|
342
|
+
1. **File Path & Class**: The format is ``"path/to/module_file.py:ClassName"``. This
|
|
343
|
+
is the easiest way to provide a custom parser. This method allows you to store your
|
|
344
|
+
custom parser directly in the repository with no additional installation steps. PSR
|
|
345
|
+
will locate the file, load the module, and instantiate the class. Relative paths are
|
|
346
|
+
recommended and it should be provided relative to the current working directory. This
|
|
347
|
+
import variant is available in v9.16.0 and later.
|
|
348
|
+
|
|
349
|
+
2. **Module Path & Class**: The format is ``"package.module_name:ClassName"``. This
|
|
350
|
+
method allows you to store your custom parser in a package that is installed in the
|
|
351
|
+
same environment as PSR. This method is useful if you want to share your custom parser
|
|
352
|
+
across multiple repositories. To share it across multiple repositories generally you will
|
|
353
|
+
need to publish the parser as its own separate package and then ``pip install`` it into
|
|
354
|
+
the current virtual environment. You can also keep it in the same repository as your
|
|
355
|
+
project as long as it is in the current directory of the virtual environment and is
|
|
356
|
+
locatable by the Python import system. You may need to set the ``PYTHONPATH`` environment
|
|
357
|
+
variable if you have a more complex directory structure. This import variant is available
|
|
358
|
+
in v8.0.0 and later.
|
|
359
|
+
|
|
360
|
+
To test that your custom parser is importable, you can run the following command in the
|
|
361
|
+
directory where PSR will be executed:
|
|
362
|
+
|
|
363
|
+
.. code-block:: bash
|
|
364
|
+
|
|
365
|
+
python -c "from package.module_name import ClassName"
|
|
366
|
+
|
|
367
|
+
.. note::
|
|
368
|
+
Remember this is basic python import rules so the package name is optional and generally
|
|
369
|
+
packages are defined by a directory with ``__init__.py`` files.
|
|
370
|
+
|
|
350
371
|
|
|
351
372
|
.. _commit_parser-tokens:
|
|
352
373
|
|
|
@@ -796,7 +796,7 @@ Built-in parsers:
|
|
|
796
796
|
* ``tag`` - :ref:`TagCommitParser <commit_parser-builtin-tag>` *(deprecated in v9.12.0)*
|
|
797
797
|
|
|
798
798
|
You can set any of the built-in parsers by their keyword but you can also specify
|
|
799
|
-
your own commit parser in ``module:
|
|
799
|
+
your own commit parser in ``path/to/module_file.py:Class`` or ``module:Class`` form.
|
|
800
800
|
|
|
801
801
|
For more information see :ref:`commit-parsing`.
|
|
802
802
|
|
|
@@ -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.16.0"
|
|
10
10
|
description = "Automatic Semantic Versioning for Python projects"
|
|
11
11
|
requires-python = ">=3.8"
|
|
12
12
|
license = { text = "MIT" }
|
|
@@ -82,7 +82,7 @@ dev = [
|
|
|
82
82
|
"ruff == 0.6.1"
|
|
83
83
|
]
|
|
84
84
|
mypy = [
|
|
85
|
-
"mypy == 1.
|
|
85
|
+
"mypy == 1.14.1",
|
|
86
86
|
"types-requests ~= 2.32.0",
|
|
87
87
|
"types-pyyaml ~= 6.0",
|
|
88
88
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-semantic-release
|
|
3
|
-
Version: 9.
|
|
3
|
+
Version: 9.16.0
|
|
4
4
|
Summary: Automatic Semantic Versioning for Python projects
|
|
5
5
|
Author-email: Rolf Erik Lekang <me@rolflekang.com>
|
|
6
6
|
License: MIT
|
|
@@ -62,7 +62,7 @@ Requires-Dist: pre-commit~=3.5; extra == "dev"
|
|
|
62
62
|
Requires-Dist: tox~=4.11; extra == "dev"
|
|
63
63
|
Requires-Dist: ruff==0.6.1; extra == "dev"
|
|
64
64
|
Provides-Extra: mypy
|
|
65
|
-
Requires-Dist: mypy==1.
|
|
65
|
+
Requires-Dist: mypy==1.14.1; extra == "mypy"
|
|
66
66
|
Requires-Dist: types-requests~=2.32.0; extra == "mypy"
|
|
67
67
|
Requires-Dist: types-pyyaml~=6.0; extra == "mypy"
|
|
68
68
|
|
|
@@ -116,11 +116,27 @@ tests/e2e/cmd_version/test_version.py
|
|
|
116
116
|
tests/e2e/cmd_version/test_version_build.py
|
|
117
117
|
tests/e2e/cmd_version/test_version_bump.py
|
|
118
118
|
tests/e2e/cmd_version/test_version_changelog.py
|
|
119
|
+
tests/e2e/cmd_version/test_version_changelog_custom_commit_msg.py
|
|
119
120
|
tests/e2e/cmd_version/test_version_github_actions.py
|
|
120
121
|
tests/e2e/cmd_version/test_version_print.py
|
|
121
122
|
tests/e2e/cmd_version/test_version_release_notes.py
|
|
122
123
|
tests/e2e/cmd_version/test_version_stamp.py
|
|
123
124
|
tests/e2e/cmd_version/test_version_strict.py
|
|
125
|
+
tests/e2e/cmd_version/bump_version/__init__.py
|
|
126
|
+
tests/e2e/cmd_version/bump_version/conftest.py
|
|
127
|
+
tests/e2e/cmd_version/bump_version/git_flow/__init__.py
|
|
128
|
+
tests/e2e/cmd_version/bump_version/git_flow/test_repo_1_channel.py
|
|
129
|
+
tests/e2e/cmd_version/bump_version/git_flow/test_repo_2_channels.py
|
|
130
|
+
tests/e2e/cmd_version/bump_version/git_flow/test_repo_3_channels.py
|
|
131
|
+
tests/e2e/cmd_version/bump_version/git_flow/test_repo_4_channels.py
|
|
132
|
+
tests/e2e/cmd_version/bump_version/github_flow/__init__.py
|
|
133
|
+
tests/e2e/cmd_version/bump_version/github_flow/test_repo_1_channel.py
|
|
134
|
+
tests/e2e/cmd_version/bump_version/github_flow/test_repo_2_channels.py
|
|
135
|
+
tests/e2e/cmd_version/bump_version/trunk_based_dev/__init__.py
|
|
136
|
+
tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk.py
|
|
137
|
+
tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_dual_version_support.py
|
|
138
|
+
tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_dual_version_support_w_prereleases.py
|
|
139
|
+
tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_w_prereleases.py
|
|
124
140
|
tests/fixtures/__init__.py
|
|
125
141
|
tests/fixtures/commit_parsers.py
|
|
126
142
|
tests/fixtures/example_project.py
|
|
@@ -137,6 +153,8 @@ tests/fixtures/repos/github_flow/__init__.py
|
|
|
137
153
|
tests/fixtures/repos/github_flow/repo_w_default_release.py
|
|
138
154
|
tests/fixtures/repos/github_flow/repo_w_release_channels.py
|
|
139
155
|
tests/fixtures/repos/trunk_based_dev/__init__.py
|
|
156
|
+
tests/fixtures/repos/trunk_based_dev/repo_w_dual_version_support.py
|
|
157
|
+
tests/fixtures/repos/trunk_based_dev/repo_w_dual_version_support_w_prereleases.py
|
|
140
158
|
tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py
|
|
141
159
|
tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py
|
|
142
160
|
tests/fixtures/repos/trunk_based_dev/repo_w_tags.py
|
{python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/__main__.py
RENAMED
|
@@ -34,7 +34,15 @@ def main() -> None:
|
|
|
34
34
|
),
|
|
35
35
|
file=sys.stderr,
|
|
36
36
|
)
|
|
37
|
+
|
|
37
38
|
print(f"::ERROR:: {err}", file=sys.stderr)
|
|
39
|
+
|
|
40
|
+
if not globals.debug:
|
|
41
|
+
print(
|
|
42
|
+
"Run semantic-release in very verbose mode (-vv) to see the full traceback.",
|
|
43
|
+
file=sys.stderr,
|
|
44
|
+
)
|
|
45
|
+
|
|
38
46
|
sys.exit(1)
|
|
39
47
|
|
|
40
48
|
|
|
@@ -124,9 +124,9 @@ def recursive_render(
|
|
|
124
124
|
# is used for inserting into a current changelog. When using stream rendering
|
|
125
125
|
# of the same file, it always came back empty
|
|
126
126
|
log.debug("rendering %s to %s", src_file_path, output_file_path)
|
|
127
|
-
rendered_file = environment.get_template(src_file_path).render()
|
|
127
|
+
rendered_file = environment.get_template(src_file_path).render().rstrip()
|
|
128
128
|
with open(output_file_path, "w", encoding="utf-8") as output_file:
|
|
129
|
-
output_file.write(rendered_file)
|
|
129
|
+
output_file.write(f"{rendered_file}\n")
|
|
130
130
|
|
|
131
131
|
rendered_paths.append(output_file_path)
|
|
132
132
|
else:
|
|
@@ -15,6 +15,7 @@ from semantic_release.cli.cli_context import CliContextObj
|
|
|
15
15
|
from semantic_release.cli.config import GlobalCommandLineOptions
|
|
16
16
|
from semantic_release.cli.const import DEFAULT_CONFIG_FILE
|
|
17
17
|
from semantic_release.cli.util import rprint
|
|
18
|
+
from semantic_release.enums import SemanticReleaseLogLevels
|
|
18
19
|
|
|
19
20
|
# if TYPE_CHECKING:
|
|
20
21
|
# pass
|
|
@@ -108,7 +109,15 @@ def main(
|
|
|
108
109
|
"""
|
|
109
110
|
console = Console(stderr=True)
|
|
110
111
|
|
|
111
|
-
|
|
112
|
+
log_levels = [
|
|
113
|
+
SemanticReleaseLogLevels.WARNING,
|
|
114
|
+
SemanticReleaseLogLevels.INFO,
|
|
115
|
+
SemanticReleaseLogLevels.DEBUG,
|
|
116
|
+
SemanticReleaseLogLevels.SILLY,
|
|
117
|
+
]
|
|
118
|
+
|
|
119
|
+
log_level = log_levels[verbosity]
|
|
120
|
+
|
|
112
121
|
logging.basicConfig(
|
|
113
122
|
level=log_level,
|
|
114
123
|
format=FORMAT,
|
|
@@ -123,7 +132,7 @@ def main(
|
|
|
123
132
|
logger = logging.getLogger(__name__)
|
|
124
133
|
logger.debug("logging level set to: %s", logging.getLevelName(log_level))
|
|
125
134
|
|
|
126
|
-
if log_level
|
|
135
|
+
if log_level <= logging.DEBUG:
|
|
127
136
|
globals.debug = True
|
|
128
137
|
|
|
129
138
|
if noop:
|
|
@@ -26,6 +26,7 @@ from semantic_release.enums import LevelBump
|
|
|
26
26
|
from semantic_release.errors import (
|
|
27
27
|
BuildDistributionsError,
|
|
28
28
|
GitCommitEmptyIndexError,
|
|
29
|
+
InternalError,
|
|
29
30
|
UnexpectedResponse,
|
|
30
31
|
)
|
|
31
32
|
from semantic_release.gitproject import GitProject
|
|
@@ -35,7 +36,6 @@ from semantic_release.version.algorithm import (
|
|
|
35
36
|
tags_and_versions,
|
|
36
37
|
)
|
|
37
38
|
from semantic_release.version.translator import VersionTranslator
|
|
38
|
-
from semantic_release.version.version import Version
|
|
39
39
|
|
|
40
40
|
if TYPE_CHECKING: # pragma: no cover
|
|
41
41
|
from pathlib import Path
|
|
@@ -45,6 +45,7 @@ if TYPE_CHECKING: # pragma: no cover
|
|
|
45
45
|
|
|
46
46
|
from semantic_release.cli.cli_context import CliContextObj
|
|
47
47
|
from semantic_release.version.declaration import VersionDeclarationABC
|
|
48
|
+
from semantic_release.version.version import Version
|
|
48
49
|
|
|
49
50
|
|
|
50
51
|
log = logging.getLogger(__name__)
|
|
@@ -90,7 +91,18 @@ def version_from_forced_level(
|
|
|
90
91
|
|
|
91
92
|
# If we have no tags, return the default version
|
|
92
93
|
if not ts_and_vs:
|
|
93
|
-
|
|
94
|
+
# Since the translator is configured by the user, we can't guarantee that it will
|
|
95
|
+
# be able to parse the default version. So we first cast it to a tag using the default
|
|
96
|
+
# value and the users configured tag format, then parse it back to a version object
|
|
97
|
+
default_initial_version = translator.from_tag(
|
|
98
|
+
translator.str_to_tag(DEFAULT_VERSION)
|
|
99
|
+
)
|
|
100
|
+
if default_initial_version is None:
|
|
101
|
+
# This should never happen, but if it does, it's a bug
|
|
102
|
+
raise InternalError(
|
|
103
|
+
"Translator was unable to parse the embedded default version"
|
|
104
|
+
)
|
|
105
|
+
return default_initial_version.bump(forced_level_bump)
|
|
94
106
|
|
|
95
107
|
_, latest_version = ts_and_vs[0]
|
|
96
108
|
if forced_level_bump is not LevelBump.PRERELEASE_REVISION:
|
|
@@ -516,12 +528,8 @@ def version( # noqa: C901
|
|
|
516
528
|
gha_output.version = new_version
|
|
517
529
|
ctx.call_on_close(gha_output.write_if_possible)
|
|
518
530
|
|
|
519
|
-
# Make string variant of version
|
|
520
|
-
version_to_print = (
|
|
521
|
-
str(new_version)
|
|
522
|
-
if not print_only_tag
|
|
523
|
-
else translator.str_to_tag(str(new_version))
|
|
524
|
-
)
|
|
531
|
+
# Make string variant of version or appropriate tag as necessary
|
|
532
|
+
version_to_print = str(new_version) if not print_only_tag else new_version.as_tag()
|
|
525
533
|
|
|
526
534
|
# Print the new version so that command-line output capture will work
|
|
527
535
|
click.echo(version_to_print)
|
|
@@ -653,6 +661,7 @@ def version( # noqa: C901
|
|
|
653
661
|
project.git_tag(
|
|
654
662
|
tag_name=new_version.as_tag(),
|
|
655
663
|
message=new_version.as_tag(),
|
|
664
|
+
isotimestamp=commit_date.isoformat(),
|
|
656
665
|
noop=opts.noop,
|
|
657
666
|
)
|
|
658
667
|
|
{python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/cli/config.py
RENAMED
|
@@ -2,11 +2,17 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
4
|
import os
|
|
5
|
-
import re
|
|
6
5
|
from collections.abc import Mapping
|
|
7
6
|
from dataclasses import dataclass, is_dataclass
|
|
8
7
|
from enum import Enum
|
|
8
|
+
from functools import reduce
|
|
9
9
|
from pathlib import Path
|
|
10
|
+
from re import (
|
|
11
|
+
Pattern,
|
|
12
|
+
compile as regexp,
|
|
13
|
+
error as RegExpError, # noqa: N812
|
|
14
|
+
escape as regex_escape,
|
|
15
|
+
)
|
|
10
16
|
from typing import Any, ClassVar, Dict, List, Literal, Optional, Tuple, Type, Union
|
|
11
17
|
|
|
12
18
|
from git import Actor, InvalidGitRepositoryError
|
|
@@ -157,6 +163,20 @@ class ChangelogConfig(BaseModel):
|
|
|
157
163
|
insertion_flag: str = ""
|
|
158
164
|
template_dir: str = "templates"
|
|
159
165
|
|
|
166
|
+
@field_validator("exclude_commit_patterns", mode="after")
|
|
167
|
+
@classmethod
|
|
168
|
+
def validate_match(cls, patterns: Tuple[str, ...]) -> Tuple[str, ...]:
|
|
169
|
+
curr_index = 0
|
|
170
|
+
try:
|
|
171
|
+
for i, pattern in enumerate(patterns):
|
|
172
|
+
curr_index = i
|
|
173
|
+
regexp(pattern)
|
|
174
|
+
except RegExpError as err:
|
|
175
|
+
raise ValueError(
|
|
176
|
+
f"exclude_commit_patterns[{curr_index}]: Invalid regular expression"
|
|
177
|
+
) from err
|
|
178
|
+
return patterns
|
|
179
|
+
|
|
160
180
|
@field_validator("changelog_file", mode="after")
|
|
161
181
|
@classmethod
|
|
162
182
|
def changelog_file_deprecation_warning(cls, val: str) -> str:
|
|
@@ -228,8 +248,8 @@ class BranchConfig(BaseModel):
|
|
|
228
248
|
return ".*"
|
|
229
249
|
|
|
230
250
|
try:
|
|
231
|
-
|
|
232
|
-
except
|
|
251
|
+
regexp(match)
|
|
252
|
+
except RegExpError as err:
|
|
233
253
|
raise ValueError(f"Invalid regex {match!r}") from err
|
|
234
254
|
return match
|
|
235
255
|
|
|
@@ -360,9 +380,12 @@ class RawConfig(BaseModel):
|
|
|
360
380
|
try:
|
|
361
381
|
# Check for repository & walk up parent directories
|
|
362
382
|
with Repo(str(dir_path), search_parent_directories=True) as git_repo:
|
|
363
|
-
found_path =
|
|
364
|
-
git_repo.working_tree_dir or git_repo.working_dir
|
|
365
|
-
|
|
383
|
+
found_path = (
|
|
384
|
+
Path(git_repo.working_tree_dir or git_repo.working_dir)
|
|
385
|
+
.expanduser()
|
|
386
|
+
.absolute()
|
|
387
|
+
)
|
|
388
|
+
|
|
366
389
|
except InvalidGitRepositoryError as err:
|
|
367
390
|
raise InvalidGitRepositoryError("No valid git repository found!") from err
|
|
368
391
|
|
|
@@ -370,7 +393,8 @@ class RawConfig(BaseModel):
|
|
|
370
393
|
logging.warning(
|
|
371
394
|
"Found .git/ in higher parent directory rather than provided in configuration."
|
|
372
395
|
)
|
|
373
|
-
|
|
396
|
+
|
|
397
|
+
return found_path.resolve()
|
|
374
398
|
|
|
375
399
|
@field_validator("commit_parser", mode="after")
|
|
376
400
|
@classmethod
|
|
@@ -509,7 +533,7 @@ class RuntimeContext:
|
|
|
509
533
|
assets: List[str]
|
|
510
534
|
commit_author: Actor
|
|
511
535
|
commit_message: str
|
|
512
|
-
changelog_excluded_commit_patterns: Tuple[
|
|
536
|
+
changelog_excluded_commit_patterns: Tuple[Pattern[str], ...]
|
|
513
537
|
version_declarations: Tuple[VersionDeclarationABC, ...]
|
|
514
538
|
hvcs_client: hvcs.HvcsBase
|
|
515
539
|
changelog_insertion_flag: str
|
|
@@ -541,7 +565,7 @@ class RuntimeContext:
|
|
|
541
565
|
choices: Dict[str, BranchConfig], active_branch: str
|
|
542
566
|
) -> BranchConfig:
|
|
543
567
|
for group, options in choices.items():
|
|
544
|
-
if
|
|
568
|
+
if regexp(options.match).match(active_branch):
|
|
545
569
|
log.info(
|
|
546
570
|
"Using group %r options, as %r matches %r",
|
|
547
571
|
group,
|
|
@@ -635,12 +659,21 @@ class RuntimeContext:
|
|
|
635
659
|
|
|
636
660
|
# We always exclude PSR's own release commits from the Changelog
|
|
637
661
|
# when parsing commits
|
|
638
|
-
|
|
639
|
-
|
|
662
|
+
psr_release_commit_regex = regexp(
|
|
663
|
+
reduce(
|
|
664
|
+
lambda regex_str, pattern: str(regex_str).replace(*pattern),
|
|
665
|
+
(
|
|
666
|
+
# replace the version holder with a regex pattern to match various versions
|
|
667
|
+
(regex_escape("{version}"), r"(?P<version>\d+\.\d+\.\d+\S*)"),
|
|
668
|
+
# TODO: add any other placeholders here
|
|
669
|
+
),
|
|
670
|
+
# We use re.escape to ensure that the commit message is treated as a literal
|
|
671
|
+
regex_escape(raw.commit_message),
|
|
672
|
+
)
|
|
640
673
|
)
|
|
641
674
|
changelog_excluded_commit_patterns = (
|
|
642
|
-
|
|
643
|
-
*(
|
|
675
|
+
psr_release_commit_regex,
|
|
676
|
+
*(regexp(pattern) for pattern in raw.changelog.exclude_commit_patterns),
|
|
644
677
|
)
|
|
645
678
|
|
|
646
679
|
_commit_author_str = cls.resolve_from_env(raw.commit_author) or ""
|
{python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/enums.py
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import logging
|
|
3
4
|
from enum import IntEnum, unique
|
|
4
5
|
|
|
5
6
|
|
|
@@ -37,3 +38,32 @@ class LevelBump(IntEnum):
|
|
|
37
38
|
>>> LevelBump.from_string("minor") == LevelBump.MINOR
|
|
38
39
|
"""
|
|
39
40
|
return cls[val.upper().replace("-", "_")]
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class SemanticReleaseLogLevels(IntEnum):
|
|
44
|
+
"""IntEnum representing the log levels used by semantic-release."""
|
|
45
|
+
|
|
46
|
+
FATAL = logging.FATAL
|
|
47
|
+
CRITICAL = logging.CRITICAL
|
|
48
|
+
ERROR = logging.ERROR
|
|
49
|
+
WARNING = logging.WARNING
|
|
50
|
+
INFO = logging.INFO
|
|
51
|
+
DEBUG = logging.DEBUG
|
|
52
|
+
SILLY = 5
|
|
53
|
+
|
|
54
|
+
def __str__(self) -> str:
|
|
55
|
+
"""
|
|
56
|
+
Return the level name rather than 'SemanticReleaseLogLevels.<level>'
|
|
57
|
+
E.g.
|
|
58
|
+
>>> str(SemanticReleaseLogLevels.DEBUG)
|
|
59
|
+
'DEBUG'
|
|
60
|
+
>>> str(SemanticReleaseLogLevels.CRITICAL)
|
|
61
|
+
'CRITICAL'
|
|
62
|
+
"""
|
|
63
|
+
return self.name.upper()
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
logging.addLevelName(
|
|
67
|
+
SemanticReleaseLogLevels.SILLY,
|
|
68
|
+
str(SemanticReleaseLogLevels.SILLY),
|
|
69
|
+
)
|
{python_semantic_release-9.15.1 → python_semantic_release-9.16.0}/src/semantic_release/gitproject.py
RENAMED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from contextlib import nullcontext
|
|
6
|
+
from datetime import datetime
|
|
6
7
|
from logging import getLogger
|
|
7
8
|
from pathlib import Path
|
|
8
9
|
from typing import TYPE_CHECKING
|
|
@@ -48,7 +49,9 @@ class GitProject:
|
|
|
48
49
|
return self._logger
|
|
49
50
|
|
|
50
51
|
def _get_custom_environment(
|
|
51
|
-
self,
|
|
52
|
+
self,
|
|
53
|
+
repo: Repo,
|
|
54
|
+
custom_vars: dict[str, str] | None = None,
|
|
52
55
|
) -> nullcontext[None] | _GeneratorContextManager[None]:
|
|
53
56
|
"""
|
|
54
57
|
git.custom_environment is a context manager but
|
|
@@ -56,15 +59,26 @@ class GitProject:
|
|
|
56
59
|
we need to throw it away and re-create it in
|
|
57
60
|
order to use it again
|
|
58
61
|
"""
|
|
62
|
+
author_vars = (
|
|
63
|
+
{
|
|
64
|
+
"GIT_AUTHOR_NAME": self._commit_author.name,
|
|
65
|
+
"GIT_AUTHOR_EMAIL": self._commit_author.email,
|
|
66
|
+
"GIT_COMMITTER_NAME": self._commit_author.name,
|
|
67
|
+
"GIT_COMMITTER_EMAIL": self._commit_author.email,
|
|
68
|
+
}
|
|
69
|
+
if self._commit_author
|
|
70
|
+
else {}
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
custom_env_vars = {
|
|
74
|
+
**author_vars,
|
|
75
|
+
**(custom_vars or {}),
|
|
76
|
+
}
|
|
77
|
+
|
|
59
78
|
return (
|
|
60
79
|
nullcontext()
|
|
61
|
-
if not
|
|
62
|
-
else repo.git.custom_environment(
|
|
63
|
-
GIT_AUTHOR_NAME=self._commit_author.name,
|
|
64
|
-
GIT_AUTHOR_EMAIL=self._commit_author.email,
|
|
65
|
-
GIT_COMMITTER_NAME=self._commit_author.name,
|
|
66
|
-
GIT_COMMITTER_EMAIL=self._commit_author.email,
|
|
67
|
-
)
|
|
80
|
+
if not custom_env_vars
|
|
81
|
+
else repo.git.custom_environment(**custom_env_vars)
|
|
68
82
|
)
|
|
69
83
|
|
|
70
84
|
def is_dirty(self) -> bool:
|
|
@@ -182,19 +196,32 @@ class GitProject:
|
|
|
182
196
|
self.logger.exception(str(err))
|
|
183
197
|
raise GitCommitError("Failed to commit changes") from err
|
|
184
198
|
|
|
185
|
-
def git_tag(
|
|
199
|
+
def git_tag(
|
|
200
|
+
self, tag_name: str, message: str, isotimestamp: str, noop: bool = False
|
|
201
|
+
) -> None:
|
|
202
|
+
try:
|
|
203
|
+
datetime.fromisoformat(isotimestamp)
|
|
204
|
+
except ValueError as err:
|
|
205
|
+
raise ValueError("Invalid timestamp format") from err
|
|
206
|
+
|
|
186
207
|
if noop:
|
|
187
|
-
command = (
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
208
|
+
command = str.join(
|
|
209
|
+
" ",
|
|
210
|
+
[
|
|
211
|
+
f"GIT_COMMITTER_DATE={isotimestamp}",
|
|
212
|
+
*(
|
|
213
|
+
[
|
|
214
|
+
f"GIT_AUTHOR_NAME={self._commit_author.name}",
|
|
215
|
+
f"GIT_AUTHOR_EMAIL={self._commit_author.email}",
|
|
216
|
+
f"GIT_COMMITTER_NAME={self._commit_author.name}",
|
|
217
|
+
f"GIT_COMMITTER_EMAIL={self._commit_author.email}",
|
|
218
|
+
]
|
|
219
|
+
if self._commit_author
|
|
220
|
+
else [""]
|
|
221
|
+
),
|
|
222
|
+
f"git tag -a {tag_name} -m '{message}'",
|
|
223
|
+
],
|
|
196
224
|
)
|
|
197
|
-
command += f"git tag -a {tag_name} -m '{message}'"
|
|
198
225
|
|
|
199
226
|
noop_report(
|
|
200
227
|
indented(
|
|
@@ -206,7 +233,10 @@ class GitProject:
|
|
|
206
233
|
)
|
|
207
234
|
return
|
|
208
235
|
|
|
209
|
-
with Repo(str(self.project_root)) as repo, self._get_custom_environment(
|
|
236
|
+
with Repo(str(self.project_root)) as repo, self._get_custom_environment(
|
|
237
|
+
repo,
|
|
238
|
+
{"GIT_COMMITTER_DATE": isotimestamp},
|
|
239
|
+
):
|
|
210
240
|
try:
|
|
211
241
|
repo.git.tag("-a", tag_name, m=message)
|
|
212
242
|
except GitCommandError as err:
|