From 154d17c1c810b58eeb14e64be0ab157c1380b5f6 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Fri, 7 Feb 2025 23:01:54 -0500 Subject: [PATCH 01/15] chore(config): set release branch to generate dev variants (#1174) --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index b3cbed3ce..65aa99d94 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -436,6 +436,11 @@ match = "^(feat|fix|perf)/.+" prerelease = true prerelease_token = "alpha" +[tool.semantic_release.branches.dev] +match = ".+" +prerelease = true +prerelease_token = "dev" + [tool.semantic_release.remote] type = "github" token = { env = "GH_TOKEN" } From 7b09eb04686f96d6226edcd85c9545955709ba0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 23:18:52 -0500 Subject: [PATCH 02/15] ci(deps): bump `python-semantic-release/publish-action@v9.18.0` to 9.18.1 (#1175) --- .github/workflows/cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 03c537ccc..8ad586c6a 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -138,7 +138,7 @@ jobs: build: false - name: Release | Add distribution artifacts to GitHub Release Assets - uses: python-semantic-release/publish-action@v9.18.0 + uses: python-semantic-release/publish-action@v9.18.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ steps.release.outputs.tag }} From 600777c465a87620579fc8ad15e394640a2d9faf Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Sun, 9 Feb 2025 09:26:50 -0700 Subject: [PATCH 03/15] chore(pr): add completion checklist to PR template (#1176) --- .github/PULL_REQUEST_TEMPLATE.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 88a8d5807..85b471448 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -20,7 +20,7 @@ also more difficult to evaluate for edge cases. @@ -29,3 +29,21 @@ mention the rationale here. ## How to Verify + + +--- + +## PR Completion Checklist + +- [ ] Reviewed & followed the [Contributor Guidelines](https://python-semantic-release.readthedocs.io/en/latest/contributing.html) + +- [ ] Changes Implemented & Validation pipeline succeeds + +- [ ] Commits follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard + and are separated into the proper commit type and scope (recommended order: test, build, feat/fix, docs) + +- [ ] Appropriate Unit tests added/updated + +- [ ] Appropriate End-to-End tests added/updated + +- [ ] Appropriate Documentation added/updated and syntax validated for sphinx build (see Contributor Guidelines) From 27ddf840f8c812361c60bac9cf0b110d401f33d6 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Sun, 9 Feb 2025 20:42:06 -0700 Subject: [PATCH 04/15] feat(parser-conventional): add official `conventional-commits` parser (#1177) NOTICE: The 'angular' commit parser has been renamed to 'conventional' to match the official conventional-commits standard for which the 'angular' parser has evolved into. Please update your configurations to specify 'conventional' as the 'commit_parser' value in place of 'angular'. The 'angular' type will be removed in v11. * test: refactor angular references to conventional * docs: update references to Angular parser to Conventional Commit Parser * chore(config): change psr parser over to conventional-commits * chore(psr-changelog-tpls): correct error preventing additional info section --- CONTRIBUTING.rst | 12 +- .../.components/changes.rst.j2 | 2 +- docs/changelog_templates.rst | 8 +- docs/commit_parsing.rst | 118 +++++++-- docs/configuration.rst | 5 +- docs/index.rst | 7 +- docs/migrating_from_v7.rst | 30 +-- pyproject.toml | 2 +- src/semantic_release/cli/config.py | 21 +- .../commit_parser/__init__.py | 4 + .../commit_parser/conventional.py | 31 +++ tests/const.py | 14 +- tests/e2e/cmd_changelog/test_changelog.py | 88 +++---- .../test_changelog_custom_parser.py | 12 +- .../cmd_changelog/test_changelog_parsing.py | 4 +- .../test_changelog_release_notes.py | 24 +- tests/e2e/cmd_config/test_generate_config.py | 8 +- tests/e2e/cmd_publish/test_publish.py | 8 +- .../git_flow/test_repo_1_channel.py | 4 +- .../git_flow/test_repo_2_channels.py | 4 +- .../git_flow/test_repo_3_channels.py | 8 +- .../git_flow/test_repo_4_channels.py | 4 +- .../github_flow/test_repo_1_channel.py | 4 +- .../github_flow/test_repo_2_channels.py | 4 +- .../trunk_based_dev/test_repo_trunk.py | 4 +- .../test_repo_trunk_dual_version_support.py | 4 +- ...runk_dual_version_support_w_prereleases.py | 4 +- .../test_repo_trunk_w_prereleases.py | 4 +- tests/e2e/cmd_version/test_version.py | 14 +- tests/e2e/cmd_version/test_version_build.py | 10 +- tests/e2e/cmd_version/test_version_bump.py | 234 +++++++++--------- .../e2e/cmd_version/test_version_changelog.py | 62 ++--- ...est_version_changelog_custom_commit_msg.py | 8 +- .../test_version_github_actions.py | 8 +- tests/e2e/cmd_version/test_version_print.py | 70 +++--- .../cmd_version/test_version_release_notes.py | 6 +- tests/e2e/cmd_version/test_version_stamp.py | 14 +- tests/e2e/cmd_version/test_version_strict.py | 6 +- tests/e2e/test_help.py | 8 +- tests/e2e/test_main.py | 24 +- tests/fixtures/commit_parsers.py | 40 +-- tests/fixtures/example_project.py | 14 +- tests/fixtures/git_repo.py | 45 ++-- .../git_flow/repo_w_1_release_channel.py | 32 +-- .../git_flow/repo_w_2_release_channels.py | 34 +-- .../git_flow/repo_w_3_release_channels.py | 38 +-- .../git_flow/repo_w_4_release_channels.py | 28 ++- .../github_flow/repo_w_default_release.py | 20 +- .../github_flow/repo_w_release_channels.py | 20 +- tests/fixtures/repos/repo_initial_commit.py | 4 +- .../repo_w_dual_version_support.py | 14 +- ...po_w_dual_version_support_w_prereleases.py | 18 +- .../repos/trunk_based_dev/repo_w_no_tags.py | 16 +- .../trunk_based_dev/repo_w_prereleases.py | 14 +- .../repos/trunk_based_dev/repo_w_tags.py | 14 +- .../changelog/test_release_history.py | 76 +++--- .../unit/semantic_release/cli/test_config.py | 14 +- .../{test_angular.py => test_conventional.py} | 126 +++++----- .../commit_parser/test_emoji.py | 8 +- .../commit_parser/test_scipy.py | 8 +- tests/util.py | 4 +- 61 files changed, 827 insertions(+), 666 deletions(-) create mode 100644 src/semantic_release/commit_parser/conventional.py rename tests/unit/semantic_release/commit_parser/{test_angular.py => test_conventional.py} (91%) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 27522ea0d..e546295cf 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -13,11 +13,15 @@ Commit messages ~~~~~~~~~~~~~~~ Since python-semantic-release is released with python-semantic-release we need the commit messages -to adhere to the `angular commit guidelines`_. If you are unsure how to describe the change correctly -just try and ask about it in your pr. If we think it should be something else or there is a -pull-request without tags we will help out in adding or changing them. +to adhere to the `Conventional Commits Specification`_. Although scopes are optional, scopes are +expected where applicable. Changes should be committed separately with the commit type they represent, +do not combine them all into one commit. -.. _angular commit guidelines: https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits +If you are unsure how to describe the change correctly just try and ask about it in your pr. If we +think it should be something else or there is a pull-request without tags we will help out in +adding or changing them. + +.. _Conventional Commits Specification: https://www.conventionalcommits.org/en/v1.0.0 Releases ~~~~~~~~ diff --git a/config/release-templates/.components/changes.rst.j2 b/config/release-templates/.components/changes.rst.j2 index a0c6e4037..ba9180e87 100644 --- a/config/release-templates/.components/changes.rst.j2 +++ b/config/release-templates/.components/changes.rst.j2 @@ -103,7 +103,7 @@ #}{% set breaking_commits = [] %}{% set notice_commits = [] %}{% for commits in commit_objects.values() -%}{% set valid_commits = commits | rejectattr("error", "defined") +%}{% set valid_commits = commits | rejectattr("error", "defined") | list %}{# # Filter out breaking change commits that have no breaking descriptions #}{% set _ = breaking_commits.extend( valid_commits | selectattr("breaking_descriptions.0") diff --git a/docs/changelog_templates.rst b/docs/changelog_templates.rst index b9bc3f0e9..08f5eec78 100644 --- a/docs/changelog_templates.rst +++ b/docs/changelog_templates.rst @@ -71,8 +71,8 @@ A common and *highly-recommended* configuration option is the :ref:`changelog.exclude_commit_patterns ` setting which allows the user to define regular expressions that will exclude commits from the changelog output. This is useful to filter out change messages that are not -relevant to your external consumers (ex. ``ci`` and ``test`` in the angular commit -convention) and only include the important changes that impact the consumer of your +relevant to your external consumers (ex. ``ci`` and ``test`` in the conventional commit +standard) and only include the important changes that impact the consumer of your software. Another important configuration option is the :ref:`changelog.mode ` @@ -228,7 +228,7 @@ Configuration Examples } } -3. Goal: Configure an initializing reStructuredText changelog with filtered angular +3. Goal: Configure an initializing reStructuredText changelog with filtered conventional commits patterns and merge commits within a custom config file ``releaserc.toml``. .. code:: toml @@ -282,7 +282,7 @@ for defining a custom template directory): semantic-release --noop changelog --post-to-release-tag v1.0.0 The default template provided by PSR will respect the -:ref:`` setting and +:ref:`config-changelog-default_templates-mask_initial_release` setting and will also add a comparison link to the previous release if one exists without customization. diff --git a/docs/commit_parsing.rst b/docs/commit_parsing.rst index b77b358d8..30cdf32b1 100644 --- a/docs/commit_parsing.rst +++ b/docs/commit_parsing.rst @@ -33,7 +33,7 @@ to handle your specific commit message style. features are added beyond the scope of the original commit message style guidelines. Other tools may not follow the same conventions as PSR's guideline extensions, so - if you plan to use any similar programs in tadem with PSR, you should be aware of the + if you plan to use any similar programs in tandem with PSR, you should be aware of the differences in feature support and fall back to the official format guidelines if necessary. @@ -48,27 +48,110 @@ Built-in Commit Parsers The following parsers are built in to Python Semantic Release: -- :ref:`AngularCommitParser ` +- :ref:`ConventionalCommitParser ` +- :ref:`AngularCommitParser ` *(deprecated in ${NEW_RELEASE_TAG})* - :ref:`EmojiCommitParser ` - :ref:`ScipyCommitParser ` - :ref:`TagCommitParser ` *(deprecated in v9.12.0)* ---- +.. _commit_parser-builtin-conventional: + +Conventional Commits Parser +""""""""""""""""""""""""""" + +*Introduced in ${NEW_RELEASE_TAG}* + +A parser that is designed to parse commits formatted according to the +`Conventional Commits Specification`_. The parser is implemented with the following +logic in relation to how PSR's core features: + +- **Version Bump Determination**: This parser extracts the commit type from the subject + line of the commit (the first line of a commit message). This type is matched against + the configuration mapping to determine the level bump for the specific commit. If the + commit type is not found in the configuration mapping, the commit is considered a + non-parsable commit and will return it as a ParseError object and ultimately a commit + of type ``"unknown"``. The configuration mapping contains lists of commit types that + correspond to the level bump for each commit type. Some commit types are still valid + do not trigger a level bump, such as ``"chore"`` or ``"docs"``. You can also configure + the default level bump + :ref:`commit_parser_options.default_level_bump ` if desired. + To trigger a major release, the commit message body must contain a paragraph that begins + with ``BREAKING CHANGE:``. This will override the level bump determined by the commit type. + +- **Changelog Generation**: PSR will group commits in the changelog by the commit type used + in the commit message. The commit type shorthand is converted to a more human-friendly + section heading and then used as the version section title of the changelog and release + notes. Under the section title, the parsed commit descriptions are listed out in full. If + the commit includes an optional scope, then the scope is prefixed on to the first line of + the commit description. If a commit has any breaking change prefixed paragraphs in the + commit message body, those paragraphs are separated out into a "Breaking Changes" section + in the changelog (Breaking Changes section is available from the default changelog in + v9.15.0). Each breaking change paragraph is listed in a bulleted list format across the + entire version. A single commit is allowed to have more than one breaking change + prefixed paragraph (as opposed to the `Conventional Commits Specification`_). Commits + with an optional scope and a breaking change will have the scope prefixed on to the + breaking change paragraph. Parsing errors will return a ParseError object and ultimately + a commit of type ``"unknown"``. Unknown commits are consolidated into an "Unknown" section + in the changelog by the default template. To remove unwanted commits from the changelog + that normally are placed in the "unknown" section, consider the use of the configuration + option :ref:`changelog.exclude_commit_patterns ` + to ignore those commit styles. + +- **Pull/Merge Request Identifier Detection**: This parser implements PSR's + :ref:`commit_parser-builtin-linked_merge_request_detection` to identify and extract + pull/merge request numbers. The parser will return a string value if a pull/merge + request number is found in the commit message. If no pull/merge request number is + found, the parser will return an empty string. + +- **Linked Issue Identifier Detection**: This parser implements PSR's + :ref:`commit_parser-builtin-issue_number_detection` to identify and extract issue numbers. + The parser will return a tuple of issue numbers as strings if any are found in the commit + message. If no issue numbers are found, the parser will return an empty tuple. + +- **Squash Commit Evaluation**: This parser implements PSR's + :ref:`commit_parser-builtin-squash_commit_evaluation` to identify and extract each commit + message as a separate commit message within a single squashed commit. You can toggle this + feature on/off via the :ref:`config-commit_parser_options` setting. + +- **Release Notice Footer Detection**: This parser implements PSR's + :ref:`commit_parser-builtin-release_notice_footer_detection`, which is a custom extension + to traditional `Conventional Commits Specification`_ to use the ``NOTICE`` keyword as a git + footer to document additional release information that is not considered a breaking change. + +**Limitations**: + +- Commits with the ``revert`` type are not currently supported. Track the implementation + of this feature in the issue `#402`_. + +If no commit parser options are provided via the configuration, the parser will use PSR's +built-in +:py:class:`defaults `. + +.. _#402: https://github.com/python-semantic-release/python-semantic-release/issues/402 +.. _Conventional Commits Specification: https://www.conventionalcommits.org/en/v1.0.0 + +---- + .. _commit_parser-builtin-angular: Angular Commit Parser """"""""""""""""""""" +.. warning:: + This parser was deprecated in ``${NEW_RELEASE_TAG}``. It will be removed in a future release. + This parser is being replaced by the :ref:`commit_parser-builtin-conventional`. + A parser that is designed to parse commits formatted according to the `Angular Commit Style Guidelines`_. The parser is implemented with the following logic in relation to how PSR's core features: - **Version Bump Determination**: This parser extracts the commit type from the subject - line of the commit (the first line of a commit messsage). This type is matched against + line of the commit (the first line of a commit message). This type is matched against the configuration mapping to determine the level bump for the specific commit. If the commit type is not found in the configuration mapping, the commit is considered a - non-conformative commit and will return it as a ParseError object and ultimately a commit + non-parsable commit and will return it as a ParseError object and ultimately a commit of type ``"unknown"``. The configuration mapping contains lists of commit types that correspond to the level bump for each commit type. Some commit types are still valid do not trigger a level bump, such as ``"chore"`` or ``"docs"``. You can also configure @@ -129,10 +212,7 @@ If no commit parser options are provided via the configuration, the parser will built-in :py:class:`defaults `. .. _#402: https://github.com/python-semantic-release/python-semantic-release/issues/402 -.. _#733: https://github.com/python-semantic-release/python-semantic-release/issues/733 -.. _#1085: https://github.com/python-semantic-release/python-semantic-release/issues/1085 .. _Angular Commit Style Guidelines: https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits -.. _PR#1112: https://github.com/python-semantic-release/python-semantic-release/pull/1112 ---- @@ -151,7 +231,7 @@ commit messages. The parser is implemented with the following logic in relation how PSR's core features: - **Version Bump Determination**: This parser only looks for emojis in the subject - line of the commit (the first line of a commit messsage). If more than one emoji is + line of the commit (the first line of a commit message). If more than one emoji is found, the emoji configured with the highest priority is selected for the change impact for the specific commit. The emoji with the highest priority is the one configured in the ``major`` configuration option, followed by the ``minor``, and ``patch`` in descending @@ -209,7 +289,7 @@ Scipy Commit Parser """"""""""""""""""" A parser that is designed to parse commits formatted according to the -`Scipy Commit Style Guidlines`_. This is essentially a variation of the `Angular Commit Style +`Scipy Commit Style Guidelines`_. This is essentially a variation of the `Angular Commit Style Guidelines`_ with all different commit types. Because of this small variance, this parser only extends our :ref:`commit_parser-builtin-angular` parser with pre-defined scipy commit types in the default Scipy Parser Options and all other features are inherited. @@ -217,7 +297,7 @@ in the default Scipy Parser Options and all other features are inherited. If no commit parser options are provided via the configuration, the parser will use PSR's built-in :py:class:`defaults `. -.. _Scipy Commit Style Guidlines: https://scipy.github.io/devdocs/dev/contributor/development_workflow.html#writing-the-commit-message +.. _Scipy Commit Style Guidelines: https://scipy.github.io/devdocs/dev/contributor/development_workflow.html#writing-the-commit-message ---- @@ -246,7 +326,7 @@ Common Linked Merge Request Detection All of the PSR built-in parsers implement common pull/merge request identifier detection logic to extract pull/merge request numbers from the commit message regardless of the -VCS platform. The parsers evaluate the subject line for a paranthesis-enclosed number +VCS platform. The parsers evaluate the subject line for a parenthesis-enclosed number at the end of the line. PSR's parsers will return a string value if a pull/merge request number is found in the commit message. If no pull/merge request number is found, the parsers will return an empty string. @@ -291,7 +371,7 @@ for your VCS. PSR supports the following case-insensitive prefixes and their con - implement (implements, implementing, implemented) PSR also allows for a more flexible approach to identifying more than one issue number without -the need of extra git trailors (although PSR does support multiple git trailors). PSR support +the need of extra git trailers (although PSR does support multiple git trailers). PSR support various list formats which can be used to identify more than one issue in a list. This format will not necessarily work on your VCS. PSR currently support the following list formats: @@ -364,7 +444,7 @@ will be evaluated individually for both the level bump and changelog generation. squash commits are found, a list with the single commit object will be returned. Currently, PSR has been tested against GitHub, BitBucket, and official ``git`` squash -merge commmit messages. GitLab does not have a default template for squash commit messages +merge commit messages. GitLab does not have a default template for squash commit messages but can be customized per project or server. If you are using GitLab, you will need to ensure that the squash commit message format is similar to the example below. @@ -381,10 +461,10 @@ formatted squash commit message of conventional commit style:* * docs(configuration): defined new config option for the project -When parsed with the default angular parser with squash commits toggled on, the version -bump will be determined by the highest level bump of the three commits (in this case, a -minor bump because of the feature commit) and the release notes would look similar to -the following: +When parsed with the default conventional-commit parser with squash commits toggled on, +the version bump will be determined by the highest level bump of the three commits (in +this case, a minor bump because of the feature commit) and the release notes would look +similar to the following: .. code-block:: markdown @@ -582,7 +662,8 @@ A subclass must implement the following: :py:class:`ParseResult `, or a subclass of this. -By default, the constructor for :py:class:`CommitParser ` +By default, the constructor for +:py:class:`CommitParser ` will set the ``options`` parameter on the ``options`` attribute of the parser, so there is no need to override this in order to access ``self.options`` during the ``parse`` method. However, if you have any parsing logic that needs to be done only once, it may @@ -610,5 +691,4 @@ Therefore, a custom commit parser could be implemented via: def parse(self, commit: git.objects.commit.Commit) -> semantic_release.ParseResult: ... -.. _angular commit guidelines: https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits .. _gitpython-commit-object: https://gitpython.readthedocs.io/en/stable/reference.html#module-git.objects.commit diff --git a/docs/configuration.rst b/docs/configuration.rst index 884a28915..35a3b821f 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -790,7 +790,8 @@ Specify which commit parser Python Semantic Release should use to parse the comm within the Git repository. Built-in parsers: - * ``angular`` - :ref:`AngularCommitParser ` + * ``angular`` - :ref:`AngularCommitParser ` *(deprecated in ${NEW_RELEASE_TAG})* + * ``conventional`` - :ref:`ConventionalCommitParser ` *(available in ${NEW_RELEASE_TAG}+)* * ``emoji`` - :ref:`EmojiCommitParser ` * ``scipy`` - :ref:`ScipyCommitParser ` * ``tag`` - :ref:`TagCommitParser ` *(deprecated in v9.12.0)* @@ -800,7 +801,7 @@ your own commit parser in ``path/to/module_file.py:Class`` or ``module:Class`` f For more information see :ref:`commit-parsing`. -**Default:** ``"angular"`` +**Default:** ``"conventional"`` ---- diff --git a/docs/index.rst b/docs/index.rst index 2b2228939..16eaabec0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -140,9 +140,8 @@ Setting up commit parsing ------------------------- We rely on commit messages to detect when a version bump is needed. -By default, Python Semantic Release uses the -`Angular style `_. -You can find out more about this in :ref:`commit-parsing`. +By default, Python Semantic Release uses the `Conventional Commits Specification`_ +to parse commit messages. You can find out more about this in :ref:`commit-parsing`. .. seealso:: - :ref:`config-branches` - Adding configuration for releases from multiple branches. @@ -150,6 +149,8 @@ You can find out more about this in :ref:`commit-parsing`. For example, Python Semantic Release also ships with emoji and scipy-style parsers. - :ref:`remote.type ` - specify the type of your remote VCS. +.. _Conventional Commits Specification: https://www.conventionalcommits.org/en/v1.0.0 + Setting up the changelog ------------------------ diff --git a/docs/migrating_from_v7.rst b/docs/migrating_from_v7.rst index b69038035..be4cbc14a 100644 --- a/docs/migrating_from_v7.rst +++ b/docs/migrating_from_v7.rst @@ -8,7 +8,7 @@ The internals have been changed significantly to better support highly-requested features and to streamline the maintenance of the project. As a result, certain things have been removed, reimplemented differently, or now -exhibit different behaviour to earlier versions of Python Semantic Release. This +exhibit different behavior to earlier versions of Python Semantic Release. This page is a guide to help projects to ``pip install python-semantic-release>=8.0.0`` with fewer surprises. @@ -19,12 +19,12 @@ Python Semantic Release GitHub Action .. _breaking-removed-artefact-upload: -GitHub Action no longer publishes artefacts to PyPI or GitHub Releases +GitHub Action no longer publishes artifacts to PyPI or GitHub Releases """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Python Semantic Release no longer uploads distributions to PyPI - see :ref:`breaking-commands-repurposed-version-and-publish`. If you are -using Python Semantic Release to publish release notes and artefacts to +using Python Semantic Release to publish release notes and artifacts to GitHub releases, there is a new GitHub Action `upload-to-gh-release`_ which will perform this action for you. @@ -143,7 +143,7 @@ Repurposing of ``version`` and ``publish`` commands """"""""""""""""""""""""""""""""""""""""""""""""""" Python Semantic Release's primary purpose is to enable automation of correct semantic versioning for software projects. Over the years, this automation has been extended to -include other actions such as building/publishing the project and its artefacts to +include other actions such as building/publishing the project and its artifacts to artefact repositories, creating releases in remote version control systems, and writing changelogs. @@ -152,9 +152,9 @@ performing every piece of automation provided. This has been changed - the ``ver command now handles determining the next version, applying the changes to the project metadata according to the configuration, writing a changelog, and committing/pushing changes to the remote Git repository. It also handles creating a release in the remote -VCS. It does *not* publish software artefacts to remote repositories such as PyPI; +VCS. It does *not* publish software artifacts to remote repositories such as PyPI; the rationale behind this decision is simply that under the hood, Python Semantic Release -used `twine`_ to upload artefacts to package indexes such as PyPI, and it's recommended +used `twine`_ to upload artifacts to package indexes such as PyPI, and it's recommended to use twine directly via the command-line. From the twine `documentation `_: @@ -162,7 +162,7 @@ to use twine directly via the command-line. From the twine As a result Python Semantic Release no longer depends on twine internals. -The ``publish`` command now handles publishing software artefacts to releases in the +The ``publish`` command now handles publishing software artifacts to releases in the remote version control system. .. _twine: https://twine.readthedocs.io/en/stable @@ -477,17 +477,17 @@ tag ``v1.1.4``, you should run:: semantic-release changelog --post-to-release-tag v1.1.4 -.. _breaking-changelog-customisation: +.. _breaking-changelog-customization: -Changelog customisation +Changelog customization """"""""""""""""""""""" -A number of options relevant to customising the changelog have been removed. This is +A number of options relevant to customizing the changelog have been removed. This is because Python Semantic Release now supports authoring a completely custom `Jinja`_ template with the contents of your changelog. Historically, the number of options added to Python Semantic Release in order to -allow this customisation has grown significantly; it now uses templates in order to -fully open up customising the changelog's appearance. +allow this customization has grown significantly; it now uses templates in order to +fully open up customizing the changelog's appearance. .. _Jinja: https://jinja.palletsprojects.com/en/3.1.x/ @@ -499,7 +499,7 @@ Configuration The configuration structure has been completely reworked, so you should read :ref:`configuration` carefully during the process of upgrading to v8+. However, -some common pitfalls and potential sources of confusion are summarised here. +some common pitfalls and potential sources of confusion are summarized here. .. _breaking-configuration-setup-cfg-unsupported: @@ -520,7 +520,7 @@ needs. .. warning:: If you don't already have a ``pyproject.toml`` configuration file, ``pip`` can - change its behaviour once you add one, as a result of `PEP-517`_. If you find + change its behavior once you add one, as a result of `PEP-517`_. If you find that this breaks your packaging, you can add your Python Semantic Release configuration to a separate file such as ``semantic-release.toml``, and use the :ref:`--config ` option to reference this alternative @@ -539,7 +539,7 @@ Commit parser options Options such as ``major_emoji``, ``parser_angular_patch_types`` or ``parser_angular_default_level_bump`` have been removed. Instead, these have been -replaced with a single set of recognised commit parser options, ``allowed_tags``, +replaced with a single set of recognized commit parser options, ``allowed_tags``, ``major_tags``, ``minor_tags``, and ``patch_tags``, though the interpretation of these is up to the specific parsers in use. You can read more detail about using commit parser options in :ref:`commit_parser_options `, diff --git a/pyproject.toml b/pyproject.toml index 65aa99d94..5666b1a86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -398,7 +398,7 @@ ignore_names = ["change_to_ex_proj_dir", "init_example_project"] [tool.semantic_release] logging_use_named_masks = true -commit_parser = "angular" +commit_parser = "conventional" commit_parser_options = { parse_squash_commits = true, ignore_merge_commits = true } build_command = """ python -m pip install -e .[build] diff --git a/src/semantic_release/cli/config.py b/src/semantic_release/cli/config.py index cd2d1bf13..496e97428 100644 --- a/src/semantic_release/cli/config.py +++ b/src/semantic_release/cli/config.py @@ -39,6 +39,7 @@ from semantic_release.commit_parser import ( AngularCommitParser, CommitParser, + ConventionalCommitParser, EmojiCommitParser, ParseResult, ParserOptions, @@ -73,6 +74,7 @@ class HvcsClient(str, Enum): _known_commit_parsers: Dict[str, type[CommitParser]] = { + "conventional": ConventionalCommitParser, "angular": AngularCommitParser, "emoji": EmojiCommitParser, "scipy": ScipyCommitParser, @@ -355,7 +357,7 @@ class RawConfig(BaseModel): env="GIT_COMMIT_AUTHOR", default=DEFAULT_COMMIT_AUTHOR ) commit_message: str = COMMIT_MESSAGE - commit_parser: NonEmptyString = "angular" + commit_parser: NonEmptyString = "conventional" # It's up to the parser_options() method to validate these commit_parser_options: Dict[str, Any] = {} logging_use_named_masks: bool = False @@ -414,6 +416,22 @@ def tag_commit_parser_deprecation_warning(cls, val: str) -> str: ) return val + @field_validator("commit_parser", mode="after") + @classmethod + def angular_commit_parser_deprecation_warning(cls, val: str) -> str: + if val == "angular": + log.warning( + str.join( + " ", + [ + "The 'angular' parser is deprecated and will be removed in v11.", + "The Angular parser is being renamed to the conventional commit parser,", + "which is selected by switching the 'commit_parser' value to 'conventional'.", + ], + ) + ) + return val + @field_validator("build_command_env", mode="after") @classmethod def remove_whitespace(cls, val: list[str]) -> list[str]: @@ -863,6 +881,7 @@ def from_raw_config( # noqa: C901 changelog_excluded_commit_patterns=changelog_excluded_commit_patterns, # TODO: change when we have other styles per parser # changelog_style=changelog_style, + # TODO: Breaking Change v10, change to conventional changelog_style="angular", changelog_output_format=raw.changelog.default_templates.output_format, prerelease=branch_config.prerelease, diff --git a/src/semantic_release/commit_parser/__init__.py b/src/semantic_release/commit_parser/__init__.py index 7e0d9b0fd..740f4ae7f 100644 --- a/src/semantic_release/commit_parser/__init__.py +++ b/src/semantic_release/commit_parser/__init__.py @@ -6,6 +6,10 @@ AngularCommitParser, AngularParserOptions, ) +from semantic_release.commit_parser.conventional import ( + ConventionalCommitParser, + ConventionalCommitParserOptions, +) from semantic_release.commit_parser.emoji import ( EmojiCommitParser, EmojiParserOptions, diff --git a/src/semantic_release/commit_parser/conventional.py b/src/semantic_release/commit_parser/conventional.py new file mode 100644 index 000000000..9ee0b27fe --- /dev/null +++ b/src/semantic_release/commit_parser/conventional.py @@ -0,0 +1,31 @@ +from __future__ import annotations + +from pydantic.dataclasses import dataclass + +from semantic_release.commit_parser.angular import ( + AngularCommitParser, + AngularParserOptions, +) + + +@dataclass +class ConventionalCommitParserOptions(AngularParserOptions): + """Options dataclass for the ConventionalCommitParser.""" + + +class ConventionalCommitParser(AngularCommitParser): + """ + A commit parser for projects conforming to the conventional commits specification. + + See https://www.conventionalcommits.org/en/v1.0.0/ + """ + + # TODO: Deprecate in lieu of get_default_options() + parser_options = ConventionalCommitParserOptions + + def __init__(self, options: ConventionalCommitParserOptions | None = None) -> None: + super().__init__(options) + + @staticmethod + def get_default_options() -> ConventionalCommitParserOptions: + return ConventionalCommitParserOptions() diff --git a/tests/const.py b/tests/const.py index 5bc12340f..88f5677eb 100644 --- a/tests/const.py +++ b/tests/const.py @@ -63,19 +63,19 @@ class RepoActionStep(str, Enum): "Implementing", ] -ANGULAR_COMMITS_CHORE = ("ci: added a commit lint job\n",) +CONVENTIONAL_COMMITS_CHORE = ("ci: added a commit lint job\n",) # Different in-scope commits that produce a certain release type -ANGULAR_COMMITS_PATCH = ( - *ANGULAR_COMMITS_CHORE, +CONVENTIONAL_COMMITS_PATCH = ( + *CONVENTIONAL_COMMITS_CHORE, "fix: fixed voltage in the flux capacitor\n", ) -ANGULAR_COMMITS_MINOR = ( - *ANGULAR_COMMITS_PATCH, +CONVENTIONAL_COMMITS_MINOR = ( + *CONVENTIONAL_COMMITS_PATCH, "feat: last minute rush order\n", ) # Take previous commits and insert a breaking change -ANGULAR_COMMITS_MAJOR = ( - *ANGULAR_COMMITS_MINOR, +CONVENTIONAL_COMMITS_MAJOR = ( + *CONVENTIONAL_COMMITS_MINOR, "fix!: big change\n\nBREAKING CHANGE: reworked something for previous feature\n", ) diff --git a/tests/e2e/cmd_changelog/test_changelog.py b/tests/e2e/cmd_changelog/test_changelog.py index 586c5e961..d717df497 100644 --- a/tests/e2e/cmd_changelog/test_changelog.py +++ b/tests/e2e/cmd_changelog/test_changelog.py @@ -36,31 +36,31 @@ example_changelog_rst, ) from tests.fixtures.repos import ( - repo_w_git_flow_angular_commits, + repo_w_git_flow_conventional_commits, repo_w_git_flow_emoji_commits, repo_w_git_flow_scipy_commits, - repo_w_git_flow_w_alpha_prereleases_n_angular_commits, + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits, repo_w_git_flow_w_alpha_prereleases_n_emoji_commits, repo_w_git_flow_w_alpha_prereleases_n_scipy_commits, - repo_w_git_flow_w_beta_alpha_rev_prereleases_n_angular_commits, + repo_w_git_flow_w_beta_alpha_rev_prereleases_n_conventional_commits, repo_w_git_flow_w_beta_alpha_rev_prereleases_n_emoji_commits, repo_w_git_flow_w_beta_alpha_rev_prereleases_n_scipy_commits, - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits, - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits_using_tag_format, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits_using_tag_format, repo_w_git_flow_w_rc_n_alpha_prereleases_n_emoji_commits, repo_w_git_flow_w_rc_n_alpha_prereleases_n_scipy_commits, - repo_w_github_flow_w_default_release_channel_angular_commits, + repo_w_github_flow_w_default_release_channel_conventional_commits, repo_w_github_flow_w_default_release_channel_emoji_commits, repo_w_github_flow_w_default_release_channel_scipy_commits, - repo_w_github_flow_w_feature_release_channel_angular_commits, + repo_w_github_flow_w_feature_release_channel_conventional_commits, repo_w_github_flow_w_feature_release_channel_emoji_commits, repo_w_github_flow_w_feature_release_channel_scipy_commits, - repo_w_no_tags_angular_commits, + repo_w_no_tags_conventional_commits, repo_w_no_tags_emoji_commits, repo_w_no_tags_scipy_commits, - repo_w_trunk_only_angular_commits, + repo_w_trunk_only_conventional_commits, repo_w_trunk_only_emoji_commits, - repo_w_trunk_only_n_prereleases_angular_commits, + repo_w_trunk_only_n_prereleases_conventional_commits, repo_w_trunk_only_n_prereleases_emoji_commits, repo_w_trunk_only_n_prereleases_scipy_commits, repo_w_trunk_only_scipy_commits, @@ -98,7 +98,7 @@ ) class Commit2Section(TypedDict): - angular: Commit2SectionCommit + conventional: Commit2SectionCommit emoji: Commit2SectionCommit scipy: Commit2SectionCommit @@ -115,8 +115,8 @@ class Commit2SectionCommit(TypedDict): for repo_fixture in ( # Only need to test when it has tags or no tags # DO NOT need to consider all repo types as it doesn't change no-op behavior - repo_w_no_tags_angular_commits.__name__, - repo_w_trunk_only_angular_commits.__name__, + repo_w_no_tags_conventional_commits.__name__, + repo_w_trunk_only_conventional_commits.__name__, ) ], ) @@ -184,8 +184,8 @@ def test_changelog_noop_is_noop( lazy_fixture(repo_fixture) for repo_fixture in [ # All commit types and one without a release - repo_w_no_tags_angular_commits.__name__, - repo_w_trunk_only_angular_commits.__name__, + repo_w_no_tags_conventional_commits.__name__, + repo_w_trunk_only_conventional_commits.__name__, repo_w_trunk_only_emoji_commits.__name__, repo_w_trunk_only_scipy_commits.__name__, ] @@ -193,34 +193,34 @@ def test_changelog_noop_is_noop( *[ pytest.param(lazy_fixture(repo_fixture), marks=pytest.mark.comprehensive) for repo_fixture in [ - # repo_w_no_tags_angular_commits.__name__, + # repo_w_no_tags_conventional_commits.__name__, repo_w_no_tags_emoji_commits.__name__, repo_w_no_tags_scipy_commits.__name__, - # repo_w_trunk_only_angular_commits.__name__, + # repo_w_trunk_only_conventional_commits.__name__, # repo_w_trunk_only_emoji_commits.__name__, # repo_w_trunk_only_scipy_commits.__name__, - repo_w_trunk_only_n_prereleases_angular_commits.__name__, + repo_w_trunk_only_n_prereleases_conventional_commits.__name__, repo_w_trunk_only_n_prereleases_emoji_commits.__name__, repo_w_trunk_only_n_prereleases_scipy_commits.__name__, - repo_w_github_flow_w_default_release_channel_angular_commits.__name__, + repo_w_github_flow_w_default_release_channel_conventional_commits.__name__, repo_w_github_flow_w_default_release_channel_emoji_commits.__name__, repo_w_github_flow_w_default_release_channel_scipy_commits.__name__, - repo_w_github_flow_w_feature_release_channel_angular_commits.__name__, + repo_w_github_flow_w_feature_release_channel_conventional_commits.__name__, repo_w_github_flow_w_feature_release_channel_emoji_commits.__name__, repo_w_github_flow_w_feature_release_channel_scipy_commits.__name__, - repo_w_git_flow_angular_commits.__name__, + repo_w_git_flow_conventional_commits.__name__, repo_w_git_flow_emoji_commits.__name__, repo_w_git_flow_scipy_commits.__name__, - repo_w_git_flow_w_beta_alpha_rev_prereleases_n_angular_commits.__name__, + repo_w_git_flow_w_beta_alpha_rev_prereleases_n_conventional_commits.__name__, repo_w_git_flow_w_beta_alpha_rev_prereleases_n_emoji_commits.__name__, repo_w_git_flow_w_beta_alpha_rev_prereleases_n_scipy_commits.__name__, - repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__, + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__, repo_w_git_flow_w_alpha_prereleases_n_emoji_commits.__name__, repo_w_git_flow_w_alpha_prereleases_n_scipy_commits.__name__, - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits.__name__, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits.__name__, repo_w_git_flow_w_rc_n_alpha_prereleases_n_emoji_commits.__name__, repo_w_git_flow_w_rc_n_alpha_prereleases_n_scipy_commits.__name__, - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits_using_tag_format.__name__, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits_using_tag_format.__name__, ] ], ], @@ -294,7 +294,7 @@ def test_changelog_content_regenerated_masked_initial_release( insertion_flag: str, ): build_definition = get_repo_definition_4_trunk_only_repo_w_tags( - commit_type="angular", + commit_type="conventional", mask_initial_release=True, extra_configs={ "tool.semantic_release.changelog.default_templates.changelog_file": str( @@ -345,7 +345,7 @@ def test_changelog_content_regenerated_masked_initial_release( [ lazy_fixture(repo_fixture) for repo_fixture in [ - repo_w_trunk_only_angular_commits.__name__, + repo_w_trunk_only_conventional_commits.__name__, repo_w_trunk_only_emoji_commits.__name__, repo_w_trunk_only_scipy_commits.__name__, ] @@ -402,10 +402,10 @@ def test_changelog_update_mode_unchanged( [ lazy_fixture(repo_fixture) for repo_fixture in [ - repo_w_no_tags_angular_commits.__name__, + repo_w_no_tags_conventional_commits.__name__, repo_w_no_tags_emoji_commits.__name__, repo_w_no_tags_scipy_commits.__name__, - repo_w_trunk_only_angular_commits.__name__, + repo_w_trunk_only_conventional_commits.__name__, repo_w_trunk_only_emoji_commits.__name__, repo_w_trunk_only_scipy_commits.__name__, ] @@ -473,7 +473,7 @@ def test_changelog_update_mode_no_prev_changelog( [ lazy_fixture(repo_fixture) for repo_fixture in [ - repo_w_trunk_only_angular_commits.__name__, + repo_w_trunk_only_conventional_commits.__name__, repo_w_trunk_only_emoji_commits.__name__, repo_w_trunk_only_scipy_commits.__name__, ] @@ -547,7 +547,7 @@ def test_changelog_update_mode_no_flag( lazy_fixture(repo_fixture) for repo_fixture in [ # MUST HAVE at least 2 tags! - repo_w_trunk_only_angular_commits.__name__, + repo_w_trunk_only_conventional_commits.__name__, repo_w_trunk_only_emoji_commits.__name__, repo_w_trunk_only_scipy_commits.__name__, ] @@ -649,7 +649,7 @@ def test_changelog_update_mode_no_header( lazy_fixture(repo_fixture) for repo_fixture in [ # MUST HAVE at least 2 tags! - repo_w_trunk_only_angular_commits.__name__, + repo_w_trunk_only_conventional_commits.__name__, repo_w_trunk_only_emoji_commits.__name__, repo_w_trunk_only_scipy_commits.__name__, ] @@ -753,7 +753,7 @@ def test_changelog_update_mode_no_footer( lazy_fixture(repo_fixture) for repo_fixture in [ # Must not have a single release/tag - repo_w_no_tags_angular_commits.__name__, + repo_w_no_tags_conventional_commits.__name__, repo_w_no_tags_emoji_commits.__name__, repo_w_no_tags_scipy_commits.__name__, ] @@ -852,7 +852,7 @@ def test_changelog_update_mode_no_releases( [ (lazy_fixture(repo_fixture), repo_fixture.split("_")[-2]) for repo_fixture in [ - repo_w_trunk_only_angular_commits.__name__, + repo_w_trunk_only_conventional_commits.__name__, repo_w_trunk_only_emoji_commits.__name__, repo_w_trunk_only_scipy_commits.__name__, ] @@ -869,7 +869,7 @@ def test_changelog_update_mode_unreleased_n_released( commit_n_rtn_changelog_entry: CommitNReturnChangelogEntryFn, changelog_file: Path, insertion_flag: str, - get_commit_def_of_angular_commit: GetCommitDefFn, + get_commit_def_of_conventional_commit: GetCommitDefFn, get_commit_def_of_emoji_commit: GetCommitDefFn, get_commit_def_of_scipy_commit: GetCommitDefFn, ): @@ -890,8 +890,8 @@ def test_changelog_update_mode_unreleased_n_released( ) commit_n_section: Commit2Section = { - "angular": { - "commit": get_commit_def_of_angular_commit( + "conventional": { + "commit": get_commit_def_of_conventional_commit( "perf: improve the performance of the application" ), "section": "Performance Improvements", @@ -1009,7 +1009,7 @@ def test_changelog_update_mode_unreleased_n_released( # Just need to test that it works for "a" project, not all -@pytest.mark.usefixtures(repo_w_trunk_only_n_prereleases_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_trunk_only_n_prereleases_conventional_commits.__name__) @pytest.mark.parametrize( "args", [("--post-to-release-tag", "v1.99.91910000000000000000000000000")] ) @@ -1026,7 +1026,7 @@ def test_changelog_release_tag_not_in_history( assert "not in release history" in result.stderr.lower() -@pytest.mark.usefixtures(repo_w_trunk_only_n_prereleases_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_trunk_only_n_prereleases_conventional_commits.__name__) @pytest.mark.parametrize( "args", [ @@ -1119,7 +1119,7 @@ def test_changelog_post_to_release(args: list[str], cli_runner: CliRunner): @pytest.mark.parametrize( "repo_result", - [lazy_fixture(repo_w_trunk_only_n_prereleases_angular_commits.__name__)], + [lazy_fixture(repo_w_trunk_only_n_prereleases_conventional_commits.__name__)], ) def test_custom_release_notes_template( repo_result: BuiltRepoResult, @@ -1168,7 +1168,7 @@ def test_custom_release_notes_template( assert expected_release_notes == actual_notes -@pytest.mark.usefixtures(repo_w_trunk_only_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_trunk_only_conventional_commits.__name__) def test_changelog_default_on_empty_template_dir( example_changelog_md: Path, changelog_template_dir: Path, @@ -1199,7 +1199,7 @@ def test_changelog_default_on_empty_template_dir( assert example_changelog_md.exists() -@pytest.mark.usefixtures(repo_w_trunk_only_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_trunk_only_conventional_commits.__name__) def test_changelog_default_on_incorrect_config_template_file( example_changelog_md: Path, changelog_template_dir: Path, @@ -1232,7 +1232,7 @@ def test_changelog_default_on_incorrect_config_template_file( @pytest.mark.parametrize("bad_changelog_file_str", ("/etc/passwd", "../../.ssh/id_rsa")) -@pytest.mark.usefixtures(repo_w_trunk_only_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_trunk_only_conventional_commits.__name__) def test_changelog_prevent_malicious_path_traversal_file( update_pyproject_toml: UpdatePyprojectTomlFn, bad_changelog_file_str: str, @@ -1257,7 +1257,7 @@ def test_changelog_prevent_malicious_path_traversal_file( @pytest.mark.parametrize("template_dir_path", ("~/.ssh", "../../.ssh")) -@pytest.mark.usefixtures(repo_w_trunk_only_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_trunk_only_conventional_commits.__name__) def test_changelog_prevent_external_path_traversal_dir( update_pyproject_toml: UpdatePyprojectTomlFn, template_dir_path: str, diff --git a/tests/e2e/cmd_changelog/test_changelog_custom_parser.py b/tests/e2e/cmd_changelog/test_changelog_custom_parser.py index d59044b69..3c6d88f7a 100644 --- a/tests/e2e/cmd_changelog/test_changelog_custom_parser.py +++ b/tests/e2e/cmd_changelog/test_changelog_custom_parser.py @@ -10,9 +10,9 @@ from semantic_release.cli.commands.main import main from tests.const import CHANGELOG_SUBCMD, MAIN_PROG_NAME -from tests.fixtures.repos import repo_w_no_tags_angular_commits +from tests.fixtures.repos import repo_w_no_tags_conventional_commits from tests.util import ( - CustomAngularParserWithIgnorePatterns, + CustomConventionalParserWithIgnorePatterns, assert_successful_exit_code, ) @@ -26,14 +26,14 @@ @pytest.mark.parametrize( - "repo_result", [lazy_fixture(repo_w_no_tags_angular_commits.__name__)] + "repo_result", [lazy_fixture(repo_w_no_tags_conventional_commits.__name__)] ) def test_changelog_custom_parser_remove_from_changelog( repo_result: BuiltRepoResult, cli_runner: CliRunner, update_pyproject_toml: UpdatePyprojectTomlFn, use_custom_parser: UseCustomParserFn, - get_commit_def_of_angular_commit: GetCommitDefFn, + get_commit_def_of_conventional_commit: GetCommitDefFn, changelog_md_file: Path, default_md_changelog_insertion_flag: str, ): @@ -42,7 +42,7 @@ def test_changelog_custom_parser_remove_from_changelog( When provided a commit message that matches the ignore syntax Then the commit message is not included in the resulting changelog """ - ignored_commit_def = get_commit_def_of_angular_commit( + ignored_commit_def = get_commit_def_of_conventional_commit( "chore: do not include me in the changelog" ) @@ -62,7 +62,7 @@ def test_changelog_custom_parser_remove_from_changelog( "tool.semantic_release.changelog.mode", ChangelogMode.INIT.value ) use_custom_parser( - f"{CustomAngularParserWithIgnorePatterns.__module__}:{CustomAngularParserWithIgnorePatterns.__name__}" + f"{CustomConventionalParserWithIgnorePatterns.__module__}:{CustomConventionalParserWithIgnorePatterns.__name__}" ) # Setup: add the commit to be ignored diff --git a/tests/e2e/cmd_changelog/test_changelog_parsing.py b/tests/e2e/cmd_changelog/test_changelog_parsing.py index 3f8dc052a..40b6923cc 100644 --- a/tests/e2e/cmd_changelog/test_changelog_parsing.py +++ b/tests/e2e/cmd_changelog/test_changelog_parsing.py @@ -23,7 +23,7 @@ example_changelog_rst, ) from tests.fixtures.repos.git_flow import ( - repo_w_git_flow_angular_commits, + repo_w_git_flow_conventional_commits, repo_w_git_flow_scipy_commits, ) from tests.util import assert_successful_exit_code @@ -62,7 +62,7 @@ marks=pytest.mark.comprehensive, ) for repo_fixture_name in [ - repo_w_git_flow_angular_commits.__name__, + repo_w_git_flow_conventional_commits.__name__, repo_w_git_flow_scipy_commits.__name__, ] ], diff --git a/tests/e2e/cmd_changelog/test_changelog_release_notes.py b/tests/e2e/cmd_changelog/test_changelog_release_notes.py index 7cde9b13f..e585f8b63 100644 --- a/tests/e2e/cmd_changelog/test_changelog_release_notes.py +++ b/tests/e2e/cmd_changelog/test_changelog_release_notes.py @@ -11,9 +11,9 @@ from tests.const import CHANGELOG_SUBCMD, EXAMPLE_PROJECT_LICENSE, MAIN_PROG_NAME from tests.fixtures.repos import ( - repo_w_github_flow_w_default_release_channel_angular_commits, - repo_w_github_flow_w_feature_release_channel_angular_commits, - repo_w_trunk_only_angular_commits, + repo_w_github_flow_w_default_release_channel_conventional_commits, + repo_w_github_flow_w_feature_release_channel_conventional_commits, + repo_w_trunk_only_conventional_commits, repo_w_trunk_only_emoji_commits, repo_w_trunk_only_scipy_commits, ) @@ -40,7 +40,7 @@ [ lazy_fixture(repo_fixture_name) for repo_fixture_name in [ - repo_w_trunk_only_angular_commits.__name__, + repo_w_trunk_only_conventional_commits.__name__, ] ], ) @@ -95,11 +95,11 @@ def test_changelog_latest_release_notes( "repo_result, mask_initial_release", [ ( - lazy_fixture(repo_w_trunk_only_angular_commits.__name__), + lazy_fixture(repo_w_trunk_only_conventional_commits.__name__), True, ), pytest.param( - lazy_fixture(repo_w_trunk_only_angular_commits.__name__), + lazy_fixture(repo_w_trunk_only_conventional_commits.__name__), False, marks=pytest.mark.comprehensive, ), @@ -111,7 +111,7 @@ def test_changelog_latest_release_notes( ) for mask_initial_release in [True, False] for repo_fixture_name in [ - repo_w_github_flow_w_default_release_channel_angular_commits.__name__, + repo_w_github_flow_w_default_release_channel_conventional_commits.__name__, ] ], ], @@ -175,14 +175,14 @@ def test_changelog_previous_release_notes( "repo_result, cache_key, mask_initial_release, license_name", [ ( - lazy_fixture(repo_w_trunk_only_angular_commits.__name__), - f"psr/repos/{repo_w_trunk_only_angular_commits.__name__}", + lazy_fixture(repo_w_trunk_only_conventional_commits.__name__), + f"psr/repos/{repo_w_trunk_only_conventional_commits.__name__}", True, "BSD-3-Clause", ), pytest.param( - lazy_fixture(repo_w_trunk_only_angular_commits.__name__), - f"psr/repos/{repo_w_trunk_only_angular_commits.__name__}", + lazy_fixture(repo_w_trunk_only_conventional_commits.__name__), + f"psr/repos/{repo_w_trunk_only_conventional_commits.__name__}", False, "BSD-3-Clause", marks=pytest.mark.comprehensive, @@ -201,7 +201,7 @@ def test_changelog_previous_release_notes( repo_w_trunk_only_scipy_commits.__name__, # Add more repos here if needed # github_flow had issues as its hard to generate the release notes from squash commits - repo_w_github_flow_w_feature_release_channel_angular_commits.__name__, + repo_w_github_flow_w_feature_release_channel_conventional_commits.__name__, ] ], ], diff --git a/tests/e2e/cmd_config/test_generate_config.py b/tests/e2e/cmd_config/test_generate_config.py index bfabaa1de..3d49a3136 100644 --- a/tests/e2e/cmd_config/test_generate_config.py +++ b/tests/e2e/cmd_config/test_generate_config.py @@ -10,7 +10,7 @@ from semantic_release.cli.config import RawConfig from tests.const import GENERATE_CONFIG_SUBCMD, MAIN_PROG_NAME, VERSION_SUBCMD -from tests.fixtures.repos import repo_w_no_tags_angular_commits +from tests.fixtures.repos import repo_w_no_tags_conventional_commits from tests.util import assert_successful_exit_code if TYPE_CHECKING: @@ -28,7 +28,7 @@ def raw_config_dict() -> dict[str, Any]: @pytest.mark.parametrize("args", [(), ("--format", "toml"), ("--format", "TOML")]) -@pytest.mark.usefixtures(repo_w_no_tags_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_no_tags_conventional_commits.__name__) def test_generate_config_toml( cli_runner: CliRunner, args: tuple[str], @@ -70,7 +70,7 @@ def test_generate_config_toml( @pytest.mark.parametrize("args", [("--format", "json"), ("--format", "JSON")]) -@pytest.mark.usefixtures(repo_w_no_tags_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_no_tags_conventional_commits.__name__) def test_generate_config_json( cli_runner: CliRunner, args: tuple[str], @@ -111,7 +111,7 @@ def test_generate_config_json( assert_successful_exit_code(result, cli_cmd) -@pytest.mark.usefixtures(repo_w_no_tags_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_no_tags_conventional_commits.__name__) def test_generate_config_pyproject_toml( cli_runner: CliRunner, raw_config_dict: dict[str, Any], diff --git a/tests/e2e/cmd_publish/test_publish.py b/tests/e2e/cmd_publish/test_publish.py index 51cbfe0d4..ba5307fec 100644 --- a/tests/e2e/cmd_publish/test_publish.py +++ b/tests/e2e/cmd_publish/test_publish.py @@ -10,7 +10,7 @@ from semantic_release.hvcs import Github from tests.const import MAIN_PROG_NAME, PUBLISH_SUBCMD -from tests.fixtures.repos import repo_w_trunk_only_angular_commits +from tests.fixtures.repos import repo_w_trunk_only_conventional_commits from tests.util import assert_exit_code, assert_successful_exit_code if TYPE_CHECKING: @@ -23,7 +23,7 @@ @pytest.mark.parametrize("cmd_args", [(), ("--tag", "latest")]) @pytest.mark.parametrize( - "repo_result", [lazy_fixture(repo_w_trunk_only_angular_commits.__name__)] + "repo_result", [lazy_fixture(repo_w_trunk_only_conventional_commits.__name__)] ) def test_publish_latest_uses_latest_tag( repo_result: BuiltRepoResult, @@ -49,7 +49,7 @@ def test_publish_latest_uses_latest_tag( @pytest.mark.parametrize( - "repo_result", [lazy_fixture(repo_w_trunk_only_angular_commits.__name__)] + "repo_result", [lazy_fixture(repo_w_trunk_only_conventional_commits.__name__)] ) def test_publish_to_tag_uses_tag( repo_result: BuiltRepoResult, @@ -73,7 +73,7 @@ def test_publish_to_tag_uses_tag( ) -@pytest.mark.usefixtures(repo_w_trunk_only_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_trunk_only_conventional_commits.__name__) def test_publish_fails_on_nonexistant_tag(cli_runner: CliRunner): non_existant_tag = "nonexistant-tag" diff --git a/tests/e2e/cmd_version/bump_version/git_flow/test_repo_1_channel.py b/tests/e2e/cmd_version/bump_version/git_flow/test_repo_1_channel.py index 0c753051c..74cd8c7e4 100644 --- a/tests/e2e/cmd_version/bump_version/git_flow/test_repo_1_channel.py +++ b/tests/e2e/cmd_version/bump_version/git_flow/test_repo_1_channel.py @@ -14,7 +14,7 @@ VERSION_SUBCMD, ) from tests.fixtures.repos.git_flow import ( - repo_w_git_flow_angular_commits, + repo_w_git_flow_conventional_commits, repo_w_git_flow_emoji_commits, repo_w_git_flow_scipy_commits, ) @@ -45,7 +45,7 @@ @pytest.mark.parametrize( "repo_fixture_name", [ - repo_w_git_flow_angular_commits.__name__, + repo_w_git_flow_conventional_commits.__name__, *[ pytest.param(repo_fixture_name, marks=pytest.mark.comprehensive) for repo_fixture_name in [ diff --git a/tests/e2e/cmd_version/bump_version/git_flow/test_repo_2_channels.py b/tests/e2e/cmd_version/bump_version/git_flow/test_repo_2_channels.py index 004206ad4..31e041770 100644 --- a/tests/e2e/cmd_version/bump_version/git_flow/test_repo_2_channels.py +++ b/tests/e2e/cmd_version/bump_version/git_flow/test_repo_2_channels.py @@ -14,7 +14,7 @@ VERSION_SUBCMD, ) from tests.fixtures.repos.git_flow import ( - repo_w_git_flow_w_alpha_prereleases_n_angular_commits, + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits, repo_w_git_flow_w_alpha_prereleases_n_emoji_commits, repo_w_git_flow_w_alpha_prereleases_n_scipy_commits, ) @@ -45,7 +45,7 @@ @pytest.mark.parametrize( "repo_fixture_name", [ - repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__, + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__, *[ pytest.param(repo_fixture_name, marks=pytest.mark.comprehensive) for repo_fixture_name in [ diff --git a/tests/e2e/cmd_version/bump_version/git_flow/test_repo_3_channels.py b/tests/e2e/cmd_version/bump_version/git_flow/test_repo_3_channels.py index 2bfa71f03..c3ee44cac 100644 --- a/tests/e2e/cmd_version/bump_version/git_flow/test_repo_3_channels.py +++ b/tests/e2e/cmd_version/bump_version/git_flow/test_repo_3_channels.py @@ -14,8 +14,8 @@ VERSION_SUBCMD, ) from tests.fixtures.repos.git_flow import ( - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits, - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits_using_tag_format, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits_using_tag_format, repo_w_git_flow_w_rc_n_alpha_prereleases_n_emoji_commits, repo_w_git_flow_w_rc_n_alpha_prereleases_n_scipy_commits, ) @@ -46,11 +46,11 @@ @pytest.mark.parametrize( "repo_fixture_name", [ - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits.__name__, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits.__name__, *[ pytest.param(repo_fixture_name, marks=pytest.mark.comprehensive) for repo_fixture_name in [ - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits_using_tag_format.__name__, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits_using_tag_format.__name__, repo_w_git_flow_w_rc_n_alpha_prereleases_n_emoji_commits.__name__, repo_w_git_flow_w_rc_n_alpha_prereleases_n_scipy_commits.__name__, ] diff --git a/tests/e2e/cmd_version/bump_version/git_flow/test_repo_4_channels.py b/tests/e2e/cmd_version/bump_version/git_flow/test_repo_4_channels.py index 95464cb0f..3e2b6c14c 100644 --- a/tests/e2e/cmd_version/bump_version/git_flow/test_repo_4_channels.py +++ b/tests/e2e/cmd_version/bump_version/git_flow/test_repo_4_channels.py @@ -14,7 +14,7 @@ VERSION_SUBCMD, ) from tests.fixtures.repos.git_flow import ( - repo_w_git_flow_w_beta_alpha_rev_prereleases_n_angular_commits, + repo_w_git_flow_w_beta_alpha_rev_prereleases_n_conventional_commits, repo_w_git_flow_w_beta_alpha_rev_prereleases_n_emoji_commits, repo_w_git_flow_w_beta_alpha_rev_prereleases_n_scipy_commits, ) @@ -45,7 +45,7 @@ @pytest.mark.parametrize( "repo_fixture_name", [ - repo_w_git_flow_w_beta_alpha_rev_prereleases_n_angular_commits.__name__, + repo_w_git_flow_w_beta_alpha_rev_prereleases_n_conventional_commits.__name__, *[ pytest.param(repo_fixture_name, marks=pytest.mark.comprehensive) for repo_fixture_name in [ diff --git a/tests/e2e/cmd_version/bump_version/github_flow/test_repo_1_channel.py b/tests/e2e/cmd_version/bump_version/github_flow/test_repo_1_channel.py index 365672843..0ce3dae7c 100644 --- a/tests/e2e/cmd_version/bump_version/github_flow/test_repo_1_channel.py +++ b/tests/e2e/cmd_version/bump_version/github_flow/test_repo_1_channel.py @@ -14,7 +14,7 @@ VERSION_SUBCMD, ) from tests.fixtures.repos.github_flow import ( - repo_w_github_flow_w_default_release_channel_angular_commits, + repo_w_github_flow_w_default_release_channel_conventional_commits, repo_w_github_flow_w_default_release_channel_emoji_commits, repo_w_github_flow_w_default_release_channel_scipy_commits, ) @@ -45,7 +45,7 @@ @pytest.mark.parametrize( "repo_fixture_name", [ - repo_w_github_flow_w_default_release_channel_angular_commits.__name__, + repo_w_github_flow_w_default_release_channel_conventional_commits.__name__, *[ pytest.param(repo_fixture_name, marks=pytest.mark.comprehensive) for repo_fixture_name in [ diff --git a/tests/e2e/cmd_version/bump_version/github_flow/test_repo_2_channels.py b/tests/e2e/cmd_version/bump_version/github_flow/test_repo_2_channels.py index 45b29f082..bf197bc3d 100644 --- a/tests/e2e/cmd_version/bump_version/github_flow/test_repo_2_channels.py +++ b/tests/e2e/cmd_version/bump_version/github_flow/test_repo_2_channels.py @@ -14,7 +14,7 @@ VERSION_SUBCMD, ) from tests.fixtures.repos.github_flow import ( - repo_w_github_flow_w_feature_release_channel_angular_commits, + repo_w_github_flow_w_feature_release_channel_conventional_commits, repo_w_github_flow_w_feature_release_channel_emoji_commits, repo_w_github_flow_w_feature_release_channel_scipy_commits, ) @@ -45,7 +45,7 @@ @pytest.mark.parametrize( "repo_fixture_name", [ - repo_w_github_flow_w_feature_release_channel_angular_commits.__name__, + repo_w_github_flow_w_feature_release_channel_conventional_commits.__name__, *[ pytest.param(repo_fixture_name, marks=pytest.mark.comprehensive) for repo_fixture_name in [ diff --git a/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk.py b/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk.py index fbb876761..fac01bdff 100644 --- a/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk.py +++ b/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk.py @@ -14,7 +14,7 @@ VERSION_SUBCMD, ) from tests.fixtures.repos.trunk_based_dev import ( - repo_w_trunk_only_angular_commits, + repo_w_trunk_only_conventional_commits, repo_w_trunk_only_emoji_commits, repo_w_trunk_only_scipy_commits, ) @@ -45,7 +45,7 @@ @pytest.mark.parametrize( "repo_fixture_name", [ - repo_w_trunk_only_angular_commits.__name__, + repo_w_trunk_only_conventional_commits.__name__, *[ pytest.param(repo_fixture_name, marks=pytest.mark.comprehensive) for repo_fixture_name in [ diff --git a/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_dual_version_support.py b/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_dual_version_support.py index e81ba67ef..ecc4e3990 100644 --- a/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_dual_version_support.py +++ b/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_dual_version_support.py @@ -15,7 +15,7 @@ VERSION_SUBCMD, ) from tests.fixtures.repos.trunk_based_dev import ( - repo_w_trunk_only_dual_version_spt_angular_commits, + repo_w_trunk_only_dual_version_spt_conventional_commits, repo_w_trunk_only_dual_version_spt_emoji_commits, repo_w_trunk_only_dual_version_spt_scipy_commits, ) @@ -46,7 +46,7 @@ @pytest.mark.parametrize( "repo_fixture_name", [ - repo_w_trunk_only_dual_version_spt_angular_commits.__name__, + repo_w_trunk_only_dual_version_spt_conventional_commits.__name__, *[ pytest.param(repo_fixture_name, marks=pytest.mark.comprehensive) for repo_fixture_name in [ diff --git a/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_dual_version_support_w_prereleases.py b/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_dual_version_support_w_prereleases.py index 53544a058..720bdfc5c 100644 --- a/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_dual_version_support_w_prereleases.py +++ b/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_dual_version_support_w_prereleases.py @@ -15,7 +15,7 @@ VERSION_SUBCMD, ) from tests.fixtures.repos.trunk_based_dev import ( - repo_w_trunk_only_dual_version_spt_w_prereleases_angular_commits, + repo_w_trunk_only_dual_version_spt_w_prereleases_conventional_commits, repo_w_trunk_only_dual_version_spt_w_prereleases_emoji_commits, repo_w_trunk_only_dual_version_spt_w_prereleases_scipy_commits, ) @@ -46,7 +46,7 @@ @pytest.mark.parametrize( "repo_fixture_name", [ - repo_w_trunk_only_dual_version_spt_w_prereleases_angular_commits.__name__, + repo_w_trunk_only_dual_version_spt_w_prereleases_conventional_commits.__name__, *[ pytest.param(repo_fixture_name, marks=pytest.mark.comprehensive) for repo_fixture_name in [ diff --git a/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_w_prereleases.py b/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_w_prereleases.py index e907fb2f0..958cac4e9 100644 --- a/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_w_prereleases.py +++ b/tests/e2e/cmd_version/bump_version/trunk_based_dev/test_repo_trunk_w_prereleases.py @@ -14,7 +14,7 @@ VERSION_SUBCMD, ) from tests.fixtures.repos.trunk_based_dev import ( - repo_w_trunk_only_n_prereleases_angular_commits, + repo_w_trunk_only_n_prereleases_conventional_commits, repo_w_trunk_only_n_prereleases_emoji_commits, repo_w_trunk_only_n_prereleases_scipy_commits, ) @@ -45,7 +45,7 @@ @pytest.mark.parametrize( "repo_fixture_name", [ - repo_w_trunk_only_n_prereleases_angular_commits.__name__, + repo_w_trunk_only_n_prereleases_conventional_commits.__name__, *[ pytest.param(repo_fixture_name, marks=pytest.mark.comprehensive) for repo_fixture_name in [ diff --git a/tests/e2e/cmd_version/test_version.py b/tests/e2e/cmd_version/test_version.py index e9285bb42..9586073c3 100644 --- a/tests/e2e/cmd_version/test_version.py +++ b/tests/e2e/cmd_version/test_version.py @@ -14,8 +14,8 @@ VERSION_SUBCMD, ) from tests.fixtures.repos import ( - repo_w_no_tags_angular_commits, - repo_w_trunk_only_angular_commits, + repo_w_no_tags_conventional_commits, + repo_w_trunk_only_conventional_commits, ) from tests.util import assert_successful_exit_code @@ -35,7 +35,7 @@ "repo_result, next_release_version", # must use a repo that is ready for a release to prevent no release # logic from being triggered before the noop logic - [(lazy_fixture(repo_w_no_tags_angular_commits.__name__), "0.1.0")], + [(lazy_fixture(repo_w_no_tags_conventional_commits.__name__), "0.1.0")], ) def test_version_noop_is_noop( repo_result: BuiltRepoResult, @@ -84,7 +84,7 @@ def test_version_noop_is_noop( @pytest.mark.parametrize( "repo_result", - [lazy_fixture(repo_w_trunk_only_angular_commits.__name__)], + [lazy_fixture(repo_w_trunk_only_conventional_commits.__name__)], ) def test_version_no_git_verify( repo_result: BuiltRepoResult, @@ -144,7 +144,7 @@ def test_version_no_git_verify( @pytest.mark.parametrize( - "repo_result", [lazy_fixture(repo_w_trunk_only_angular_commits.__name__)] + "repo_result", [lazy_fixture(repo_w_trunk_only_conventional_commits.__name__)] ) def test_version_on_nonrelease_branch( repo_result: BuiltRepoResult, @@ -188,7 +188,7 @@ def test_version_on_nonrelease_branch( @pytest.mark.parametrize( "repo_result", - [lazy_fixture(repo_w_trunk_only_angular_commits.__name__)], + [lazy_fixture(repo_w_trunk_only_conventional_commits.__name__)], ) def test_version_on_last_release( repo_result: BuiltRepoResult, @@ -240,7 +240,7 @@ def test_version_on_last_release( @pytest.mark.parametrize( - "repo_result", [lazy_fixture(repo_w_no_tags_angular_commits.__name__)] + "repo_result", [lazy_fixture(repo_w_no_tags_conventional_commits.__name__)] ) def test_version_only_tag_push( repo_result: BuiltRepoResult, diff --git a/tests/e2e/cmd_version/test_version_build.py b/tests/e2e/cmd_version/test_version_build.py index af81337de..e2b42045f 100644 --- a/tests/e2e/cmd_version/test_version_build.py +++ b/tests/e2e/cmd_version/test_version_build.py @@ -16,7 +16,7 @@ from semantic_release.cli.commands.main import main from tests.const import MAIN_PROG_NAME, VERSION_SUBCMD -from tests.fixtures.repos import repo_w_trunk_only_angular_commits +from tests.fixtures.repos import repo_w_trunk_only_conventional_commits from tests.util import assert_successful_exit_code, get_func_qual_name if TYPE_CHECKING: @@ -57,7 +57,7 @@ "repo_result, cli_args, next_release_version", [ ( - lazy_fixture(repo_w_trunk_only_angular_commits.__name__), + lazy_fixture(repo_w_trunk_only_conventional_commits.__name__), ["--patch"], "0.1.2", ) @@ -137,7 +137,7 @@ def test_version_runs_build_command( "repo_result, cli_args, next_release_version", [ ( - lazy_fixture(repo_w_trunk_only_angular_commits.__name__), + lazy_fixture(repo_w_trunk_only_conventional_commits.__name__), ["--patch"], "0.1.2", ) @@ -278,7 +278,7 @@ def test_version_runs_build_command_windows( "repo_result, cli_args, next_release_version", [ ( - lazy_fixture(repo_w_trunk_only_angular_commits.__name__), + lazy_fixture(repo_w_trunk_only_conventional_commits.__name__), ["--patch"], "0.1.2", ) @@ -382,7 +382,7 @@ def test_version_runs_build_command_w_user_env( ) -@pytest.mark.usefixtures(repo_w_trunk_only_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_trunk_only_conventional_commits.__name__) def test_version_skips_build_command_with_skip_build( cli_runner: CliRunner, mocked_git_push: mock.MagicMock, diff --git a/tests/e2e/cmd_version/test_version_bump.py b/tests/e2e/cmd_version/test_version_bump.py index 0d9b17ca8..6efb10a96 100644 --- a/tests/e2e/cmd_version/test_version_bump.py +++ b/tests/e2e/cmd_version/test_version_bump.py @@ -12,34 +12,34 @@ from pytest_lazy_fixtures.lazy_fixture import lf as lazy_fixture from semantic_release.cli.commands.main import main -from semantic_release.commit_parser.angular import AngularCommitParser +from semantic_release.commit_parser.conventional import ConventionalCommitParser from semantic_release.commit_parser.emoji import EmojiCommitParser from semantic_release.commit_parser.scipy import ScipyCommitParser from tests.const import EXAMPLE_PROJECT_NAME, MAIN_PROG_NAME, VERSION_SUBCMD from tests.fixtures import ( - angular_chore_commits, - angular_major_commits, - angular_minor_commits, - angular_patch_commits, + conventional_chore_commits, + conventional_major_commits, + conventional_minor_commits, + conventional_patch_commits, emoji_chore_commits, emoji_major_commits, emoji_minor_commits, emoji_patch_commits, - repo_w_git_flow_w_alpha_prereleases_n_angular_commits, + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits, repo_w_git_flow_w_alpha_prereleases_n_emoji_commits, repo_w_git_flow_w_alpha_prereleases_n_scipy_commits, - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits, repo_w_git_flow_w_rc_n_alpha_prereleases_n_emoji_commits, repo_w_git_flow_w_rc_n_alpha_prereleases_n_scipy_commits, - repo_w_github_flow_w_feature_release_channel_angular_commits, + repo_w_github_flow_w_feature_release_channel_conventional_commits, repo_w_initial_commit, - repo_w_no_tags_angular_commits, + repo_w_no_tags_conventional_commits, repo_w_no_tags_emoji_commits, repo_w_no_tags_scipy_commits, - repo_w_trunk_only_angular_commits, + repo_w_trunk_only_conventional_commits, repo_w_trunk_only_emoji_commits, - repo_w_trunk_only_n_prereleases_angular_commits, + repo_w_trunk_only_n_prereleases_conventional_commits, repo_w_trunk_only_n_prereleases_emoji_commits, repo_w_trunk_only_n_prereleases_scipy_commits, repo_w_trunk_only_scipy_commits, @@ -71,7 +71,7 @@ [ *( ( - lazy_fixture(repo_w_no_tags_angular_commits.__name__), + lazy_fixture(repo_w_no_tags_conventional_commits.__name__), cli_args, next_release_version, ) @@ -118,7 +118,7 @@ marks=pytest.mark.comprehensive, ) for repo_fixture_name, values in { - repo_w_trunk_only_angular_commits.__name__: [ + repo_w_trunk_only_conventional_commits.__name__: [ # New build-metadata forces a new release (["--build-metadata", "build.12345"], "0.1.1+build.12345"), # Forced version bump @@ -155,7 +155,7 @@ "0.1.2-beta.1+build.12345", ), ], - repo_w_trunk_only_n_prereleases_angular_commits.__name__: [ + repo_w_trunk_only_n_prereleases_conventional_commits.__name__: [ # New build-metadata forces a new release (["--build-metadata", "build.12345"], "0.2.0+build.12345"), # Forced version bump @@ -193,7 +193,7 @@ "0.2.1-beta.1+build.12345", ), ], - repo_w_github_flow_w_feature_release_channel_angular_commits.__name__: [ + repo_w_github_flow_w_feature_release_channel_conventional_commits.__name__: [ # New build-metadata forces a new release (["--build-metadata", "build.12345"], "1.1.0+build.12345"), # Forced version bump @@ -230,7 +230,7 @@ "1.1.1-beta.1+build.12345", ), ], - repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__: [ + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__: [ # New build-metadata forces a new release (["--build-metadata", "build.12345"], "1.2.0-alpha.2+build.12345"), # Forced version bump @@ -267,7 +267,7 @@ "1.2.1-beta.1+build.12345", ), ], - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits.__name__: [ + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits.__name__: [ # New build-metadata forces a new release (["--build-metadata", "build.12345"], "1.1.0+build.12345"), # Forced version bump @@ -421,9 +421,9 @@ def test_version_force_level( # Default case should be a minor bump since last full release was 1.1.1 # last tag is a prerelease 1.2.0-rc.2 lazy_fixture( - repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__ + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__ ), - lazy_fixture(angular_minor_commits.__name__), + lazy_fixture(conventional_minor_commits.__name__), False, "alpha", "1.2.0", @@ -444,25 +444,25 @@ def test_version_force_level( # The last full release version was 1.1.1, so it's had a minor # prerelease ( - repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__, + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__, "alpha", ): [ - (angular_patch_commits.__name__, False, "1.1.2", None), + (conventional_patch_commits.__name__, False, "1.1.2", None), ( - angular_patch_commits.__name__, + conventional_patch_commits.__name__, True, "1.1.2-alpha.1", None, ), ( - angular_minor_commits.__name__, + conventional_minor_commits.__name__, True, "1.2.0-alpha.3", "feat/feature-4", # branch ), - (angular_major_commits.__name__, False, "2.0.0", None), + (conventional_major_commits.__name__, False, "2.0.0", None), ( - angular_major_commits.__name__, + conventional_major_commits.__name__, True, "2.0.0-alpha.1", None, @@ -471,26 +471,26 @@ def test_version_force_level( # Latest version for repo_with_git_flow_and_release_channels is # currently 1.1.0 ( - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits.__name__, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits.__name__, "alpha", ): [ - (angular_patch_commits.__name__, False, "1.1.1", None), + (conventional_patch_commits.__name__, False, "1.1.1", None), ( - angular_patch_commits.__name__, + conventional_patch_commits.__name__, True, "1.1.1-alpha.1", None, ), - (angular_minor_commits.__name__, False, "1.2.0", None), + (conventional_minor_commits.__name__, False, "1.2.0", None), ( - angular_minor_commits.__name__, + conventional_minor_commits.__name__, True, "1.2.0-alpha.1", None, ), - (angular_major_commits.__name__, False, "2.0.0", None), + (conventional_major_commits.__name__, False, "2.0.0", None), ( - angular_major_commits.__name__, + conventional_major_commits.__name__, True, "2.0.0-alpha.1", None, @@ -508,7 +508,7 @@ def test_version_force_level( ), ) # TODO: add a github flow test case -def test_version_next_greater_than_version_one_angular( +def test_version_next_greater_than_version_one_conventional( repo_result: BuiltRepoResult, commit_messages: list[str], prerelease: bool, @@ -603,28 +603,28 @@ def test_version_next_greater_than_version_one_angular( # The last full release version was 1.1.1, so it's had a minor # prerelease ( - repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__, + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__, "alpha", ): [ *( (commits, True, "1.2.0-alpha.2", "feat/feature-4") for commits in ( None, - angular_chore_commits.__name__, + conventional_chore_commits.__name__, ) ), *( (commits, False, "1.1.1", None) for commits in ( None, - angular_chore_commits.__name__, + conventional_chore_commits.__name__, ) ), ], # Latest version for repo_with_git_flow_and_release_channels is # currently 1.1.0 ( - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits.__name__, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits.__name__, "alpha", ): [ *( @@ -632,7 +632,7 @@ def test_version_next_greater_than_version_one_angular( for prerelease in (True, False) for commits in ( None, - angular_chore_commits.__name__, + conventional_chore_commits.__name__, ) ), ], @@ -647,7 +647,7 @@ def test_version_next_greater_than_version_one_angular( ] ), ) -def test_version_next_greater_than_version_one_no_bump_angular( +def test_version_next_greater_than_version_one_no_bump_conventional( repo_result: BuiltRepoResult, commit_messages: list[str], prerelease: bool, @@ -1351,8 +1351,8 @@ def test_version_next_greater_than_version_one_no_bump_scipy( # It's biggest change type is minor, so the next version should be 0.1.0 # Given the major_on_zero is False and the version is starting at 0.0.0, # the major level commits are limited to only causing a minor level bump - lazy_fixture(repo_w_no_tags_angular_commits.__name__), - lazy_fixture(angular_major_commits.__name__), + lazy_fixture(repo_w_no_tags_conventional_commits.__name__), + lazy_fixture(conventional_major_commits.__name__), False, "rc", False, @@ -1376,7 +1376,7 @@ def test_version_next_greater_than_version_one_no_bump_scipy( # Latest version for repo_with_no_tags is currently 0.0.0 (default) # It's biggest change type is minor, so the next version should be 0.1.0 ( - repo_w_no_tags_angular_commits.__name__, + repo_w_no_tags_conventional_commits.__name__, None, ): [ *( @@ -1389,21 +1389,21 @@ def test_version_next_greater_than_version_one_no_bump_scipy( # will be a minor change and thus the version will be bumped to 0.1.0 None, # Non version bumping commits are absorbed into the previously detected minor bump - lazy_fixture(angular_chore_commits.__name__), + lazy_fixture(conventional_chore_commits.__name__), # Patch commits are absorbed into the previously detected minor bump - lazy_fixture(angular_patch_commits.__name__), + lazy_fixture(conventional_patch_commits.__name__), # Minor level commits are absorbed into the previously detected minor bump - lazy_fixture(angular_minor_commits.__name__), + lazy_fixture(conventional_minor_commits.__name__), # Given the major_on_zero is False and the version is starting at 0.0.0, # the major level commits are limited to only causing a minor level bump - # lazy_fixture(angular_major_commits.__name__), # used as default + # lazy_fixture(conventional_major_commits.__name__), # used as default ) ), # when prerelease is False, & major_on_zero is False, & allow_zero_version is True, # the version should only be minor bumped when provided major commits because # of the major_on_zero value ( - lazy_fixture(angular_major_commits.__name__), + lazy_fixture(conventional_major_commits.__name__), False, False, True, @@ -1414,7 +1414,7 @@ def test_version_next_greater_than_version_one_no_bump_scipy( # the version should be major bumped when provided major commits because # of the major_on_zero value ( - lazy_fixture(angular_major_commits.__name__), + lazy_fixture(conventional_major_commits.__name__), False, True, True, @@ -1429,17 +1429,17 @@ def test_version_next_greater_than_version_one_no_bump_scipy( for major_on_zero in (True, False) for commits in ( None, - lazy_fixture(angular_chore_commits.__name__), - lazy_fixture(angular_patch_commits.__name__), - lazy_fixture(angular_minor_commits.__name__), - lazy_fixture(angular_major_commits.__name__), + lazy_fixture(conventional_chore_commits.__name__), + lazy_fixture(conventional_patch_commits.__name__), + lazy_fixture(conventional_minor_commits.__name__), + lazy_fixture(conventional_major_commits.__name__), ) ), ], # Latest version for repo_with_single_branch is currently 0.1.1 # Note repo_with_single_branch isn't modelled with prereleases ( - repo_w_trunk_only_angular_commits.__name__, + repo_w_trunk_only_conventional_commits.__name__, None, ): [ *( @@ -1447,7 +1447,7 @@ def test_version_next_greater_than_version_one_no_bump_scipy( # the version is patch bumped because of the patch level commits # regardless of the major_on_zero value ( - lazy_fixture(angular_patch_commits.__name__), + lazy_fixture(conventional_patch_commits.__name__), False, major_on_zero, True, @@ -1461,15 +1461,15 @@ def test_version_next_greater_than_version_one_no_bump_scipy( # the version is minor bumped because of the major_on_zero value=False (commits, False, False, True, "0.2.0", None) for commits in ( - lazy_fixture(angular_minor_commits.__name__), - lazy_fixture(angular_major_commits.__name__), + lazy_fixture(conventional_minor_commits.__name__), + lazy_fixture(conventional_major_commits.__name__), ) ), # when prerelease must be False, and allow_zero_version is True, # but the major_on_zero is True, then when a major level commit is given, # the version should be bumped to the next major version ( - lazy_fixture(angular_major_commits.__name__), + lazy_fixture(conventional_major_commits.__name__), False, True, True, @@ -1483,24 +1483,24 @@ def test_version_next_greater_than_version_one_no_bump_scipy( for major_on_zero in (True, False) for commits in ( None, - lazy_fixture(angular_chore_commits.__name__), - lazy_fixture(angular_patch_commits.__name__), - lazy_fixture(angular_minor_commits.__name__), - lazy_fixture(angular_major_commits.__name__), + lazy_fixture(conventional_chore_commits.__name__), + lazy_fixture(conventional_patch_commits.__name__), + lazy_fixture(conventional_minor_commits.__name__), + lazy_fixture(conventional_major_commits.__name__), ) ), ], # Latest version for repo_with_single_branch_and_prereleases is # currently 0.2.0 ( - repo_w_trunk_only_n_prereleases_angular_commits.__name__, + repo_w_trunk_only_n_prereleases_conventional_commits.__name__, None, ): [ # when allow_zero_version is True, # prerelease is False, & major_on_zero is False, the version should be # patch bumped as a prerelease version, when given patch level commits ( - lazy_fixture(angular_patch_commits.__name__), + lazy_fixture(conventional_patch_commits.__name__), True, False, True, @@ -1511,7 +1511,7 @@ def test_version_next_greater_than_version_one_no_bump_scipy( # prerelease is False, & major_on_zero is False, the version should be # patch bumped, when given patch level commits ( - lazy_fixture(angular_patch_commits.__name__), + lazy_fixture(conventional_patch_commits.__name__), False, False, True, @@ -1524,8 +1524,8 @@ def test_version_next_greater_than_version_one_no_bump_scipy( # minor bumped as a prerelease version, when given commits of a minor or major level (commits, True, False, True, "0.3.0-rc.1", None) for commits in ( - lazy_fixture(angular_minor_commits.__name__), - lazy_fixture(angular_major_commits.__name__), + lazy_fixture(conventional_minor_commits.__name__), + lazy_fixture(conventional_major_commits.__name__), ) ), *( @@ -1534,15 +1534,15 @@ def test_version_next_greater_than_version_one_no_bump_scipy( # minor or major level because major_on_zero = False (commits, False, False, True, "0.3.0", None) for commits in ( - lazy_fixture(angular_minor_commits.__name__), - lazy_fixture(angular_major_commits.__name__), + lazy_fixture(conventional_minor_commits.__name__), + lazy_fixture(conventional_major_commits.__name__), ) ), # when prerelease is True, & major_on_zero is True, and allow_zero_version # is True, the version should be bumped to 1.0.0 as a prerelease version, when # given major level commits ( - lazy_fixture(angular_major_commits.__name__), + lazy_fixture(conventional_major_commits.__name__), True, True, True, @@ -1552,7 +1552,7 @@ def test_version_next_greater_than_version_one_no_bump_scipy( # when prerelease is False, & major_on_zero is True, and allow_zero_version # is True, the version should be bumped to 1.0.0, when given major level commits ( - lazy_fixture(angular_major_commits.__name__), + lazy_fixture(conventional_major_commits.__name__), False, True, True, @@ -1567,10 +1567,10 @@ def test_version_next_greater_than_version_one_no_bump_scipy( for major_on_zero in (True, False) for commits in ( None, - lazy_fixture(angular_chore_commits.__name__), - lazy_fixture(angular_patch_commits.__name__), - lazy_fixture(angular_minor_commits.__name__), - lazy_fixture(angular_major_commits.__name__), + lazy_fixture(conventional_chore_commits.__name__), + lazy_fixture(conventional_patch_commits.__name__), + lazy_fixture(conventional_minor_commits.__name__), + lazy_fixture(conventional_major_commits.__name__), ) ), *( @@ -1580,9 +1580,9 @@ def test_version_next_greater_than_version_one_no_bump_scipy( (commits, False, major_on_zero, False, "1.0.0", None) for major_on_zero in (True, False) for commits in ( - lazy_fixture(angular_patch_commits.__name__), - lazy_fixture(angular_minor_commits.__name__), - lazy_fixture(angular_major_commits.__name__), + lazy_fixture(conventional_patch_commits.__name__), + lazy_fixture(conventional_minor_commits.__name__), + lazy_fixture(conventional_major_commits.__name__), ) ), ], @@ -1599,7 +1599,7 @@ def test_version_next_greater_than_version_one_no_bump_scipy( ], ), ) -def test_version_next_w_zero_dot_versions_angular( +def test_version_next_w_zero_dot_versions_conventional( repo_result: BuiltRepoResult, commit_messages: list[str], prerelease: bool, @@ -1706,7 +1706,7 @@ def test_version_next_w_zero_dot_versions_angular( # Latest version for repo_with_single_branch is currently 0.1.1 # Note repo_with_single_branch isn't modelled with prereleases ( - repo_w_trunk_only_angular_commits.__name__, + repo_w_trunk_only_conventional_commits.__name__, None, ): [ *( @@ -1717,14 +1717,14 @@ def test_version_next_w_zero_dot_versions_angular( for major_on_zero in (True, False) for commits in ( None, - lazy_fixture(angular_chore_commits.__name__), + lazy_fixture(conventional_chore_commits.__name__), ) ), ], # Latest version for repo_with_single_branch_and_prereleases is # currently 0.2.0 ( - repo_w_trunk_only_n_prereleases_angular_commits.__name__, + repo_w_trunk_only_n_prereleases_conventional_commits.__name__, None, ): [ *( @@ -1736,7 +1736,7 @@ def test_version_next_w_zero_dot_versions_angular( for major_on_zero in (True, False) for commits in ( None, - lazy_fixture(angular_chore_commits.__name__), + lazy_fixture(conventional_chore_commits.__name__), ) ), ], @@ -1753,7 +1753,7 @@ def test_version_next_w_zero_dot_versions_angular( ], ), ) -def test_version_next_w_zero_dot_versions_no_bump_angular( +def test_version_next_w_zero_dot_versions_no_bump_conventional( repo_result: BuiltRepoResult, commit_messages: list[str], prerelease: bool, @@ -2839,7 +2839,7 @@ def test_version_next_w_zero_dot_versions_no_bump_scipy( # Latest version for repo_w_initial_commit is currently 0.0.0 # with no changes made it should be 0.0.0 lazy_fixture(repo_w_initial_commit.__name__), - AngularCommitParser.__name__.replace("CommitParser", "").lower(), + ConventionalCommitParser.__name__.replace("CommitParser", "").lower(), None, False, "rc", @@ -2874,11 +2874,11 @@ def test_version_next_w_zero_dot_versions_no_bump_scipy( for major_on_zero in (True, False) for commits, parser in ( # No commits added, so base is just initial commit at 0.0.0 - (None, AngularCommitParser.__name__), + (None, ConventionalCommitParser.__name__), # Chore like commits also don't trigger a version bump so it stays 0.0.0 ( - lazy_fixture(angular_chore_commits.__name__), - AngularCommitParser.__name__, + lazy_fixture(conventional_chore_commits.__name__), + ConventionalCommitParser.__name__, ), ( lazy_fixture(emoji_chore_commits.__name__), @@ -2898,8 +2898,8 @@ def test_version_next_w_zero_dot_versions_no_bump_scipy( # a patch bump as a prerelease version, because of the patch level commits # major_on_zero is irrelevant here as we are only applying patch commits ( - lazy_fixture(angular_patch_commits.__name__), - AngularCommitParser.__name__, + lazy_fixture(conventional_patch_commits.__name__), + ConventionalCommitParser.__name__, ), ( lazy_fixture(emoji_patch_commits.__name__), @@ -2919,8 +2919,8 @@ def test_version_next_w_zero_dot_versions_no_bump_scipy( # a patch bump because of the patch commits added # major_on_zero is irrelevant here as we are only applying patch commits ( - lazy_fixture(angular_patch_commits.__name__), - AngularCommitParser.__name__, + lazy_fixture(conventional_patch_commits.__name__), + ConventionalCommitParser.__name__, ), ( lazy_fixture(emoji_patch_commits.__name__), @@ -2938,8 +2938,8 @@ def test_version_next_w_zero_dot_versions_no_bump_scipy( # when prerelease is False, & major_on_zero is False, the version should be # a minor bump because of the minor commits added ( - lazy_fixture(angular_minor_commits.__name__), - AngularCommitParser.__name__, + lazy_fixture(conventional_minor_commits.__name__), + ConventionalCommitParser.__name__, ), ( lazy_fixture(emoji_minor_commits.__name__), @@ -2952,8 +2952,8 @@ def test_version_next_w_zero_dot_versions_no_bump_scipy( # Given the major_on_zero is False and the version is starting at 0.0.0, # the major level commits are limited to only causing a minor level bump ( - lazy_fixture(angular_major_commits.__name__), - AngularCommitParser.__name__, + lazy_fixture(conventional_major_commits.__name__), + ConventionalCommitParser.__name__, ), ( lazy_fixture(emoji_major_commits.__name__), @@ -2973,8 +2973,8 @@ def test_version_next_w_zero_dot_versions_no_bump_scipy( # the version should be a minor bump of 0.0.0 # because of the minor commits added and zero version is allowed ( - lazy_fixture(angular_minor_commits.__name__), - AngularCommitParser.__name__, + lazy_fixture(conventional_minor_commits.__name__), + ConventionalCommitParser.__name__, ), ( lazy_fixture(emoji_minor_commits.__name__), @@ -2987,8 +2987,8 @@ def test_version_next_w_zero_dot_versions_no_bump_scipy( # Given the major_on_zero is False and the version is starting at 0.0.0, # the major level commits are limited to only causing a minor level bump ( - lazy_fixture(angular_major_commits.__name__), - AngularCommitParser.__name__, + lazy_fixture(conventional_major_commits.__name__), + ConventionalCommitParser.__name__, ), ( lazy_fixture(emoji_major_commits.__name__), @@ -3009,22 +3009,22 @@ def test_version_next_w_zero_dot_versions_no_bump_scipy( for major_on_zero in (True, False) for commits, parser in ( # parser doesn't matter here as long as it detects a NO_RELEASE on Initial Commit - (None, AngularCommitParser.__name__), + (None, ConventionalCommitParser.__name__), ( - lazy_fixture(angular_chore_commits.__name__), - AngularCommitParser.__name__, + lazy_fixture(conventional_chore_commits.__name__), + ConventionalCommitParser.__name__, ), ( - lazy_fixture(angular_patch_commits.__name__), - AngularCommitParser.__name__, + lazy_fixture(conventional_patch_commits.__name__), + ConventionalCommitParser.__name__, ), ( - lazy_fixture(angular_minor_commits.__name__), - AngularCommitParser.__name__, + lazy_fixture(conventional_minor_commits.__name__), + ConventionalCommitParser.__name__, ), ( - lazy_fixture(angular_major_commits.__name__), - AngularCommitParser.__name__, + lazy_fixture(conventional_major_commits.__name__), + ConventionalCommitParser.__name__, ), ( lazy_fixture(emoji_chore_commits.__name__), @@ -3068,22 +3068,22 @@ def test_version_next_w_zero_dot_versions_no_bump_scipy( (commits, parser, False, major_on_zero, False, "1.0.0") for major_on_zero in (True, False) for commits, parser in ( - (None, AngularCommitParser.__name__), + (None, ConventionalCommitParser.__name__), ( - lazy_fixture(angular_chore_commits.__name__), - AngularCommitParser.__name__, + lazy_fixture(conventional_chore_commits.__name__), + ConventionalCommitParser.__name__, ), ( - lazy_fixture(angular_patch_commits.__name__), - AngularCommitParser.__name__, + lazy_fixture(conventional_patch_commits.__name__), + ConventionalCommitParser.__name__, ), ( - lazy_fixture(angular_minor_commits.__name__), - AngularCommitParser.__name__, + lazy_fixture(conventional_minor_commits.__name__), + ConventionalCommitParser.__name__, ), ( - lazy_fixture(angular_major_commits.__name__), - AngularCommitParser.__name__, + lazy_fixture(conventional_major_commits.__name__), + ConventionalCommitParser.__name__, ), ( lazy_fixture(emoji_chore_commits.__name__), diff --git a/tests/e2e/cmd_version/test_version_changelog.py b/tests/e2e/cmd_version/test_version_changelog.py index 7d4bbecbb..19a3bb3ba 100644 --- a/tests/e2e/cmd_version/test_version_changelog.py +++ b/tests/e2e/cmd_version/test_version_changelog.py @@ -20,25 +20,25 @@ example_changelog_rst, ) from tests.fixtures.repos import ( - repo_w_git_flow_w_alpha_prereleases_n_angular_commits, + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits, repo_w_git_flow_w_alpha_prereleases_n_emoji_commits, repo_w_git_flow_w_alpha_prereleases_n_scipy_commits, - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits, - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits_using_tag_format, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits_using_tag_format, repo_w_git_flow_w_rc_n_alpha_prereleases_n_emoji_commits, repo_w_git_flow_w_rc_n_alpha_prereleases_n_scipy_commits, - repo_w_github_flow_w_default_release_channel_angular_commits, + repo_w_github_flow_w_default_release_channel_conventional_commits, repo_w_github_flow_w_default_release_channel_emoji_commits, repo_w_github_flow_w_default_release_channel_scipy_commits, - repo_w_github_flow_w_feature_release_channel_angular_commits, + repo_w_github_flow_w_feature_release_channel_conventional_commits, repo_w_github_flow_w_feature_release_channel_emoji_commits, repo_w_github_flow_w_feature_release_channel_scipy_commits, - repo_w_no_tags_angular_commits, + repo_w_no_tags_conventional_commits, repo_w_no_tags_emoji_commits, repo_w_no_tags_scipy_commits, - repo_w_trunk_only_angular_commits, + repo_w_trunk_only_conventional_commits, repo_w_trunk_only_emoji_commits, - repo_w_trunk_only_n_prereleases_angular_commits, + repo_w_trunk_only_n_prereleases_conventional_commits, repo_w_trunk_only_n_prereleases_emoji_commits, repo_w_trunk_only_n_prereleases_scipy_commits, repo_w_trunk_only_scipy_commits, @@ -79,8 +79,8 @@ "repo_result, cache_key, tag_format", [ ( - lazy_fixture(repo_w_trunk_only_angular_commits.__name__), - f"psr/repos/{repo_w_trunk_only_angular_commits.__name__}", + lazy_fixture(repo_w_trunk_only_conventional_commits.__name__), + f"psr/repos/{repo_w_trunk_only_conventional_commits.__name__}", "v{version}", ), *[ @@ -98,7 +98,7 @@ None, ) for repo_fixture_name in [ - # repo_with_single_branch_angular_commits.__name__, # default + # repo_with_single_branch_conventional_commits.__name__, # default repo_w_trunk_only_emoji_commits.__name__, repo_w_trunk_only_scipy_commits.__name__, ] @@ -109,7 +109,7 @@ None, ) for repo_fixture_name in [ - repo_w_trunk_only_n_prereleases_angular_commits.__name__, + repo_w_trunk_only_n_prereleases_conventional_commits.__name__, repo_w_trunk_only_n_prereleases_emoji_commits.__name__, repo_w_trunk_only_n_prereleases_scipy_commits.__name__, ] @@ -120,7 +120,7 @@ None, ) for repo_fixture_name in [ - repo_w_github_flow_w_default_release_channel_angular_commits.__name__, + repo_w_github_flow_w_default_release_channel_conventional_commits.__name__, repo_w_github_flow_w_default_release_channel_emoji_commits.__name__, repo_w_github_flow_w_default_release_channel_scipy_commits.__name__, ] @@ -131,7 +131,7 @@ None, ) for repo_fixture_name in [ - repo_w_github_flow_w_feature_release_channel_angular_commits.__name__, + repo_w_github_flow_w_feature_release_channel_conventional_commits.__name__, repo_w_github_flow_w_feature_release_channel_emoji_commits.__name__, repo_w_github_flow_w_feature_release_channel_scipy_commits.__name__, ] @@ -142,7 +142,7 @@ None, ) for repo_fixture_name in [ - repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__, + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__, repo_w_git_flow_w_alpha_prereleases_n_emoji_commits.__name__, repo_w_git_flow_w_alpha_prereleases_n_scipy_commits.__name__, ] @@ -153,7 +153,7 @@ None, ) for repo_fixture_name in [ - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits.__name__, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits.__name__, repo_w_git_flow_w_rc_n_alpha_prereleases_n_emoji_commits.__name__, repo_w_git_flow_w_rc_n_alpha_prereleases_n_scipy_commits.__name__, ] @@ -164,7 +164,7 @@ "submod-v{version}", ) for repo_fixture_name in [ - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits_using_tag_format.__name__, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits_using_tag_format.__name__, ] ], ] @@ -285,8 +285,8 @@ def test_version_updates_changelog_w_new_version( "repo_result, cache_key", [ ( - lazy_fixture(repo_w_no_tags_angular_commits.__name__), - f"psr/repos/{repo_w_no_tags_angular_commits.__name__}", + lazy_fixture(repo_w_no_tags_conventional_commits.__name__), + f"psr/repos/{repo_w_no_tags_conventional_commits.__name__}", ), *[ pytest.param( @@ -296,7 +296,7 @@ def test_version_updates_changelog_w_new_version( ) for repo_fixture in [ # Must not have a single release/tag - # repo_with_no_tags_angular_commits.__name__, # default + # repo_with_no_tags_conventional_commits.__name__, # default repo_w_no_tags_emoji_commits.__name__, repo_w_no_tags_scipy_commits.__name__, ] @@ -435,8 +435,8 @@ def test_version_updates_changelog_wo_prev_releases( "repo_result, cache_key, tag_format", [ ( - lazy_fixture(repo_w_trunk_only_angular_commits.__name__), - f"psr/repos/{repo_w_trunk_only_angular_commits.__name__}", + lazy_fixture(repo_w_trunk_only_conventional_commits.__name__), + f"psr/repos/{repo_w_trunk_only_conventional_commits.__name__}", "v{version}", ), *[ @@ -454,7 +454,7 @@ def test_version_updates_changelog_wo_prev_releases( None, ) for repo_fixture_name in [ - # repo_with_single_branch_angular_commits.__name__, # default + # repo_with_single_branch_conventional_commits.__name__, # default repo_w_trunk_only_emoji_commits.__name__, repo_w_trunk_only_scipy_commits.__name__, ] @@ -465,7 +465,7 @@ def test_version_updates_changelog_wo_prev_releases( None, ) for repo_fixture_name in [ - repo_w_trunk_only_n_prereleases_angular_commits.__name__, + repo_w_trunk_only_n_prereleases_conventional_commits.__name__, repo_w_trunk_only_n_prereleases_emoji_commits.__name__, repo_w_trunk_only_n_prereleases_scipy_commits.__name__, ] @@ -476,7 +476,7 @@ def test_version_updates_changelog_wo_prev_releases( None, ) for repo_fixture_name in [ - repo_w_github_flow_w_default_release_channel_angular_commits.__name__, + repo_w_github_flow_w_default_release_channel_conventional_commits.__name__, repo_w_github_flow_w_default_release_channel_emoji_commits.__name__, repo_w_github_flow_w_default_release_channel_scipy_commits.__name__, ] @@ -487,7 +487,7 @@ def test_version_updates_changelog_wo_prev_releases( None, ) for repo_fixture_name in [ - repo_w_github_flow_w_feature_release_channel_angular_commits.__name__, + repo_w_github_flow_w_feature_release_channel_conventional_commits.__name__, repo_w_github_flow_w_feature_release_channel_emoji_commits.__name__, repo_w_github_flow_w_feature_release_channel_scipy_commits.__name__, ] @@ -498,7 +498,7 @@ def test_version_updates_changelog_wo_prev_releases( None, ) for repo_fixture_name in [ - repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__, + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__, repo_w_git_flow_w_alpha_prereleases_n_emoji_commits.__name__, repo_w_git_flow_w_alpha_prereleases_n_scipy_commits.__name__, ] @@ -509,7 +509,7 @@ def test_version_updates_changelog_wo_prev_releases( None, ) for repo_fixture_name in [ - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits.__name__, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits.__name__, repo_w_git_flow_w_rc_n_alpha_prereleases_n_emoji_commits.__name__, repo_w_git_flow_w_rc_n_alpha_prereleases_n_scipy_commits.__name__, ] @@ -520,7 +520,7 @@ def test_version_updates_changelog_wo_prev_releases( "submod-v{version}", ) for repo_fixture_name in [ - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits_using_tag_format.__name__, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits_using_tag_format.__name__, ] ], ] @@ -608,7 +608,7 @@ def test_version_initializes_changelog_in_update_mode_w_no_prev_changelog( ), ], ) -@pytest.mark.usefixtures(repo_w_trunk_only_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_trunk_only_conventional_commits.__name__) def test_version_maintains_changelog_in_update_mode_w_no_flag( changelog_file: Path, cli_runner: CliRunner, @@ -675,7 +675,7 @@ def test_version_maintains_changelog_in_update_mode_w_no_flag( ) for repo_fixture in [ # Must have a previous release/tag - repo_w_trunk_only_angular_commits.__name__, + repo_w_trunk_only_conventional_commits.__name__, ] ], ) diff --git a/tests/e2e/cmd_version/test_version_changelog_custom_commit_msg.py b/tests/e2e/cmd_version/test_version_changelog_custom_commit_msg.py index 0351f5dfb..d7ee1d08f 100644 --- a/tests/e2e/cmd_version/test_version_changelog_custom_commit_msg.py +++ b/tests/e2e/cmd_version/test_version_changelog_custom_commit_msg.py @@ -25,7 +25,7 @@ changelog_rst_file, ) from tests.fixtures.repos import ( - repo_w_trunk_only_angular_commits, + repo_w_trunk_only_conventional_commits, ) from tests.util import ( assert_successful_exit_code, @@ -51,7 +51,7 @@ ) class Commit2Section(TypedDict): - angular: Commit2SectionCommit + conventional: Commit2SectionCommit emoji: Commit2SectionCommit scipy: Commit2SectionCommit @@ -97,12 +97,12 @@ class Commit2SectionCommit(TypedDict): *[ ( # Repos: Must have at least 2 releases - repo_w_trunk_only_angular_commits.__name__, + repo_w_trunk_only_conventional_commits.__name__, commit_msg, ) for commit_msg in [ dedent( - # Angular compliant prefix with skip-ci idicator + # Conventional compliant prefix with skip-ci idicator """\ chore(release): v{version} [skip ci] diff --git a/tests/e2e/cmd_version/test_version_github_actions.py b/tests/e2e/cmd_version/test_version_github_actions.py index 1c7ba4aaa..c79e34b15 100644 --- a/tests/e2e/cmd_version/test_version_github_actions.py +++ b/tests/e2e/cmd_version/test_version_github_actions.py @@ -7,7 +7,9 @@ from semantic_release.cli.commands.main import main from tests.const import MAIN_PROG_NAME, VERSION_SUBCMD -from tests.fixtures.repos import repo_w_git_flow_w_alpha_prereleases_n_angular_commits +from tests.fixtures.repos import ( + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits, +) from tests.util import actions_output_to_dict, assert_successful_exit_code if TYPE_CHECKING: @@ -16,7 +18,9 @@ from click.testing import CliRunner -@pytest.mark.usefixtures(repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__) +@pytest.mark.usefixtures( + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__ +) def test_version_writes_github_actions_output( cli_runner: CliRunner, monkeypatch: pytest.MonkeyPatch, diff --git a/tests/e2e/cmd_version/test_version_print.py b/tests/e2e/cmd_version/test_version_print.py index b0226387d..a259036cb 100644 --- a/tests/e2e/cmd_version/test_version_print.py +++ b/tests/e2e/cmd_version/test_version_print.py @@ -11,16 +11,16 @@ MAIN_PROG_NAME, VERSION_SUBCMD, ) -from tests.fixtures.commit_parsers import angular_minor_commits -from tests.fixtures.git_repo import get_commit_def_of_angular_commit +from tests.fixtures.commit_parsers import conventional_minor_commits +from tests.fixtures.git_repo import get_commit_def_of_conventional_commit from tests.fixtures.repos import ( - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits_using_tag_format, - repo_w_no_tags_angular_commits, - repo_w_trunk_only_angular_commits, - repo_w_trunk_only_angular_commits_using_tag_format, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits_using_tag_format, + repo_w_no_tags_conventional_commits, + repo_w_trunk_only_conventional_commits, + repo_w_trunk_only_conventional_commits_using_tag_format, ) from tests.fixtures.repos.trunk_based_dev.repo_w_no_tags import ( - repo_w_no_tags_angular_commits_using_tag_format, + repo_w_no_tags_conventional_commits_using_tag_format, ) from tests.util import ( add_text_to_file, @@ -47,8 +47,8 @@ "repo_result, commits, force_args, next_release_version", [ ( - lazy_fixture(repo_w_trunk_only_angular_commits.__name__), - lazy_fixture(angular_minor_commits.__name__), + lazy_fixture(repo_w_trunk_only_conventional_commits.__name__), + lazy_fixture(conventional_minor_commits.__name__), cli_args, next_release_version, ) @@ -155,15 +155,15 @@ def test_version_print_next_version( *[ pytest.param( lazy_fixture(repo_fixture_name), - lazy_fixture(angular_minor_commits.__name__), + lazy_fixture(conventional_minor_commits.__name__), cli_args, next_release_version, marks=marks if marks else [], ) for repo_fixture_name, marks in ( - (repo_w_trunk_only_angular_commits.__name__, None), + (repo_w_trunk_only_conventional_commits.__name__, None), ( - repo_w_trunk_only_angular_commits_using_tag_format.__name__, + repo_w_trunk_only_conventional_commits_using_tag_format.__name__, pytest.mark.comprehensive, ), ) @@ -213,8 +213,8 @@ def test_version_print_next_version( marks=pytest.mark.comprehensive, ) for repo_fixture_name in ( - repo_w_no_tags_angular_commits.__name__, - repo_w_no_tags_angular_commits_using_tag_format.__name__, + repo_w_no_tags_conventional_commits.__name__, + repo_w_no_tags_conventional_commits_using_tag_format.__name__, ) for cli_args, next_release_version in ( # Dynamic version bump determination (based on commits) @@ -321,7 +321,7 @@ def test_version_print_tag_prints_next_tag( @pytest.mark.parametrize( "repo_result", - [lazy_fixture(repo_w_trunk_only_angular_commits.__name__)], + [lazy_fixture(repo_w_trunk_only_conventional_commits.__name__)], ) def test_version_print_last_released_prints_version( repo_result: BuiltRepoResult, @@ -367,8 +367,8 @@ def test_version_print_last_released_prints_version( "repo_result, commits", [ ( - lazy_fixture(repo_w_trunk_only_angular_commits.__name__), - lazy_fixture(angular_minor_commits.__name__), + lazy_fixture(repo_w_trunk_only_conventional_commits.__name__), + lazy_fixture(conventional_minor_commits.__name__), ) ], ) @@ -420,7 +420,7 @@ def test_version_print_last_released_prints_released_if_commits( @pytest.mark.parametrize( "repo_result", - [lazy_fixture(repo_w_no_tags_angular_commits.__name__)], + [lazy_fixture(repo_w_no_tags_conventional_commits.__name__)], ) def test_version_print_last_released_prints_nothing_if_no_tags( repo_result: BuiltRepoResult, @@ -464,7 +464,7 @@ def test_version_print_last_released_prints_nothing_if_no_tags( @pytest.mark.parametrize( "repo_result", - [lazy_fixture(repo_w_trunk_only_angular_commits.__name__)], + [lazy_fixture(repo_w_trunk_only_conventional_commits.__name__)], ) def test_version_print_last_released_on_detached_head( repo_result: BuiltRepoResult, @@ -511,7 +511,7 @@ def test_version_print_last_released_on_detached_head( @pytest.mark.parametrize( "repo_result", - [lazy_fixture(repo_w_trunk_only_angular_commits.__name__)], + [lazy_fixture(repo_w_trunk_only_conventional_commits.__name__)], ) def test_version_print_last_released_on_nonrelease_branch( repo_result: BuiltRepoResult, @@ -559,10 +559,10 @@ def test_version_print_last_released_on_nonrelease_branch( @pytest.mark.parametrize( "repo_result", [ - lazy_fixture(repo_w_trunk_only_angular_commits.__name__), + lazy_fixture(repo_w_trunk_only_conventional_commits.__name__), pytest.param( lazy_fixture( - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits_using_tag_format.__name__ + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits_using_tag_format.__name__ ), marks=pytest.mark.comprehensive, ), @@ -614,14 +614,14 @@ def test_version_print_last_released_tag_prints_correct_tag( "repo_result, commits", [ ( - lazy_fixture(repo_w_trunk_only_angular_commits.__name__), - lazy_fixture(angular_minor_commits.__name__), + lazy_fixture(repo_w_trunk_only_conventional_commits.__name__), + lazy_fixture(conventional_minor_commits.__name__), ), pytest.param( lazy_fixture( - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits_using_tag_format.__name__ + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits_using_tag_format.__name__ ), - lazy_fixture(angular_minor_commits.__name__), + lazy_fixture(conventional_minor_commits.__name__), marks=pytest.mark.comprehensive, ), ], @@ -676,7 +676,7 @@ def test_version_print_last_released_tag_prints_released_if_commits( @pytest.mark.parametrize( "repo_result", - [lazy_fixture(repo_w_no_tags_angular_commits.__name__)], + [lazy_fixture(repo_w_no_tags_conventional_commits.__name__)], ) def test_version_print_last_released_tag_prints_nothing_if_no_tags( repo_result: BuiltRepoResult, @@ -721,10 +721,10 @@ def test_version_print_last_released_tag_prints_nothing_if_no_tags( @pytest.mark.parametrize( "repo_result", [ - lazy_fixture(repo_w_trunk_only_angular_commits.__name__), + lazy_fixture(repo_w_trunk_only_conventional_commits.__name__), pytest.param( lazy_fixture( - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits_using_tag_format.__name__ + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits_using_tag_format.__name__ ), marks=pytest.mark.comprehensive, ), @@ -778,10 +778,10 @@ def test_version_print_last_released_tag_on_detached_head( @pytest.mark.parametrize( "repo_result", [ - lazy_fixture(repo_w_trunk_only_angular_commits.__name__), + lazy_fixture(repo_w_trunk_only_conventional_commits.__name__), pytest.param( lazy_fixture( - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits_using_tag_format.__name__ + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits_using_tag_format.__name__ ), marks=pytest.mark.comprehensive, ), @@ -836,8 +836,8 @@ def test_version_print_last_released_tag_on_nonrelease_branch( "repo_result, get_commit_def_fn", [ ( - lazy_fixture(repo_w_trunk_only_angular_commits.__name__), - lazy_fixture(get_commit_def_of_angular_commit.__name__), + lazy_fixture(repo_w_trunk_only_conventional_commits.__name__), + lazy_fixture(get_commit_def_of_conventional_commit.__name__), ) ], ) @@ -895,8 +895,8 @@ def test_version_print_next_version_fails_on_detached_head( "repo_result, get_commit_def_fn", [ ( - lazy_fixture(repo_w_trunk_only_angular_commits.__name__), - lazy_fixture(get_commit_def_of_angular_commit.__name__), + lazy_fixture(repo_w_trunk_only_conventional_commits.__name__), + lazy_fixture(get_commit_def_of_conventional_commit.__name__), ) ], ) diff --git a/tests/e2e/cmd_version/test_version_release_notes.py b/tests/e2e/cmd_version/test_version_release_notes.py index 36fdf0e63..c185b76f2 100644 --- a/tests/e2e/cmd_version/test_version_release_notes.py +++ b/tests/e2e/cmd_version/test_version_release_notes.py @@ -15,7 +15,7 @@ VERSION_SUBCMD, RepoActionStep, ) -from tests.fixtures.repos import repo_w_no_tags_angular_commits +from tests.fixtures.repos import repo_w_no_tags_conventional_commits from tests.fixtures.repos.trunk_based_dev.repo_w_no_tags import ( repo_w_no_tags_emoji_commits, repo_w_no_tags_scipy_commits, @@ -46,7 +46,7 @@ @pytest.mark.parametrize( "repo_result, next_release_version", [ - (lazy_fixture(repo_w_no_tags_angular_commits.__name__), "0.1.0"), + (lazy_fixture(repo_w_no_tags_conventional_commits.__name__), "0.1.0"), ], ) def test_custom_release_notes_template( @@ -113,7 +113,7 @@ def test_custom_release_notes_template( "project.license.text", # deprecated ] for repo_fixture_name in [ - repo_w_no_tags_angular_commits.__name__, + repo_w_no_tags_conventional_commits.__name__, repo_w_no_tags_emoji_commits.__name__, repo_w_no_tags_scipy_commits.__name__, ] diff --git a/tests/e2e/cmd_version/test_version_stamp.py b/tests/e2e/cmd_version/test_version_stamp.py index d052fcc9c..c95c6f813 100644 --- a/tests/e2e/cmd_version/test_version_stamp.py +++ b/tests/e2e/cmd_version/test_version_stamp.py @@ -14,10 +14,10 @@ from tests.const import EXAMPLE_PROJECT_NAME, MAIN_PROG_NAME, VERSION_SUBCMD from tests.fixtures.repos.trunk_based_dev.repo_w_no_tags import ( - repo_w_no_tags_angular_commits, + repo_w_no_tags_conventional_commits, ) from tests.fixtures.repos.trunk_based_dev.repo_w_prereleases import ( - repo_w_trunk_only_n_prereleases_angular_commits, + repo_w_trunk_only_n_prereleases_conventional_commits, ) from tests.util import ( assert_successful_exit_code, @@ -48,7 +48,7 @@ "repo_result, expected_new_version", [ ( - lazy_fixture(repo_w_trunk_only_n_prereleases_angular_commits.__name__), + lazy_fixture(repo_w_trunk_only_n_prereleases_conventional_commits.__name__), "0.3.0", ) ], @@ -141,7 +141,7 @@ def test_version_only_stamp_version( # ============================================================================== # -@pytest.mark.usefixtures(repo_w_no_tags_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_no_tags_conventional_commits.__name__) def test_stamp_version_variables_python( cli_runner: CliRunner, update_pyproject_toml: UpdatePyprojectTomlFn, @@ -174,7 +174,7 @@ def test_stamp_version_variables_python( assert new_version == version_py_after -@pytest.mark.usefixtures(repo_w_no_tags_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_no_tags_conventional_commits.__name__) def test_stamp_version_variables_yaml( cli_runner: CliRunner, update_pyproject_toml: UpdatePyprojectTomlFn, @@ -217,7 +217,7 @@ def test_stamp_version_variables_yaml( assert yaml.safe_load(orig_yaml) == resulting_yaml_obj -@pytest.mark.usefixtures(repo_w_no_tags_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_no_tags_conventional_commits.__name__) def test_stamp_version_variables_yaml_cff( cli_runner: CliRunner, update_pyproject_toml: UpdatePyprojectTomlFn, @@ -267,7 +267,7 @@ def test_stamp_version_variables_yaml_cff( assert yaml.safe_load(orig_yaml) == resulting_yaml_obj -@pytest.mark.usefixtures(repo_w_no_tags_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_no_tags_conventional_commits.__name__) def test_stamp_version_variables_json( cli_runner: CliRunner, update_pyproject_toml: UpdatePyprojectTomlFn, diff --git a/tests/e2e/cmd_version/test_version_strict.py b/tests/e2e/cmd_version/test_version_strict.py index 438adf571..c8dcb56a5 100644 --- a/tests/e2e/cmd_version/test_version_strict.py +++ b/tests/e2e/cmd_version/test_version_strict.py @@ -8,7 +8,7 @@ from semantic_release.cli.commands.main import main from tests.const import MAIN_PROG_NAME, VERSION_SUBCMD -from tests.fixtures.repos import repo_w_trunk_only_angular_commits +from tests.fixtures.repos import repo_w_trunk_only_conventional_commits from tests.util import assert_exit_code if TYPE_CHECKING: @@ -22,7 +22,7 @@ @pytest.mark.parametrize( "repo_result", - [lazy_fixture(repo_w_trunk_only_angular_commits.__name__)], + [lazy_fixture(repo_w_trunk_only_conventional_commits.__name__)], ) def test_version_already_released_when_strict( repo_result: BuiltRepoResult, @@ -71,7 +71,7 @@ def test_version_already_released_when_strict( @pytest.mark.parametrize( - "repo_result", [lazy_fixture(repo_w_trunk_only_angular_commits.__name__)] + "repo_result", [lazy_fixture(repo_w_trunk_only_conventional_commits.__name__)] ) def test_version_on_nonrelease_branch_when_strict( repo_result: BuiltRepoResult, diff --git a/tests/e2e/test_help.py b/tests/e2e/test_help.py index 4a5d7909a..a31454efd 100644 --- a/tests/e2e/test_help.py +++ b/tests/e2e/test_help.py @@ -12,7 +12,7 @@ from semantic_release.cli.commands.version import version from tests.const import MAIN_PROG_NAME, SUCCESS_EXIT_CODE -from tests.fixtures.repos import repo_w_trunk_only_angular_commits +from tests.fixtures.repos import repo_w_trunk_only_conventional_commits from tests.util import assert_exit_code if TYPE_CHECKING: @@ -85,7 +85,7 @@ def test_help_no_repo( (main, changelog, generate_config, publish, version), ids=lambda cmd: cmd.name, ) -@pytest.mark.usefixtures(repo_w_trunk_only_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_trunk_only_conventional_commits.__name__) def test_help_valid_config( help_option: str, command: Command, @@ -137,7 +137,7 @@ def test_help_invalid_config( help_option: str, command: Command, cli_runner: CliRunner, - repo_w_trunk_only_angular_commits: Repo, + repo_w_trunk_only_conventional_commits: Repo, update_pyproject_toml: UpdatePyprojectTomlFn, ): """ @@ -187,7 +187,7 @@ def test_help_invalid_config( ids=lambda cmd: cmd.name, ) @pytest.mark.parametrize( - "repo_result", [lazy_fixture(repo_w_trunk_only_angular_commits.__name__)] + "repo_result", [lazy_fixture(repo_w_trunk_only_conventional_commits.__name__)] ) def test_help_non_release_branch( help_option: str, diff --git a/tests/e2e/test_main.py b/tests/e2e/test_main.py index 6ada12a1f..361061021 100644 --- a/tests/e2e/test_main.py +++ b/tests/e2e/test_main.py @@ -14,8 +14,8 @@ from tests.const import MAIN_PROG_NAME, VERSION_SUBCMD from tests.fixtures import ( - repo_w_git_flow_w_alpha_prereleases_n_angular_commits, - repo_w_no_tags_angular_commits, + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits, + repo_w_no_tags_conventional_commits, ) from tests.util import assert_exit_code, assert_successful_exit_code @@ -46,7 +46,7 @@ def test_main_no_args_prints_help_text(cli_runner: CliRunner): @pytest.mark.parametrize( "repo_result", - [lazy_fixture(repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__)], + [lazy_fixture(repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__)], ) def test_not_a_release_branch_exit_code( repo_result: BuiltRepoResult, cli_runner: CliRunner @@ -64,7 +64,7 @@ def test_not_a_release_branch_exit_code( @pytest.mark.parametrize( "repo_result", - [lazy_fixture(repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__)], + [lazy_fixture(repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__)], ) def test_not_a_release_branch_exit_code_with_strict( repo_result: BuiltRepoResult, @@ -83,7 +83,7 @@ def test_not_a_release_branch_exit_code_with_strict( @pytest.mark.parametrize( "repo_result", - [lazy_fixture(repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__)], + [lazy_fixture(repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__)], ) def test_not_a_release_branch_detached_head_exit_code( repo_result: BuiltRepoResult, @@ -129,7 +129,9 @@ def json_file_with_no_configuration_for_psr(tmp_path: Path) -> Path: return path -@pytest.mark.usefixtures(repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__) +@pytest.mark.usefixtures( + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__ +) def test_default_config_is_used_when_none_in_toml_config_file( cli_runner: CliRunner, toml_file_with_no_configuration_for_psr: Path, @@ -149,7 +151,9 @@ def test_default_config_is_used_when_none_in_toml_config_file( assert_successful_exit_code(result, cli_cmd) -@pytest.mark.usefixtures(repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__) +@pytest.mark.usefixtures( + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__ +) def test_default_config_is_used_when_none_in_json_config_file( cli_runner: CliRunner, json_file_with_no_configuration_for_psr: Path, @@ -169,7 +173,9 @@ def test_default_config_is_used_when_none_in_json_config_file( assert_successful_exit_code(result, cli_cmd) -@pytest.mark.usefixtures(repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__) +@pytest.mark.usefixtures( + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__ +) def test_errors_when_config_file_does_not_exist_and_passed_explicitly( cli_runner: CliRunner, ): @@ -189,7 +195,7 @@ def test_errors_when_config_file_does_not_exist_and_passed_explicitly( assert "does not exist" in result.stderr -@pytest.mark.usefixtures(repo_w_no_tags_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_no_tags_conventional_commits.__name__) def test_errors_when_config_file_invalid_configuration( cli_runner: CliRunner, update_pyproject_toml: UpdatePyprojectTomlFn ): diff --git a/tests/fixtures/commit_parsers.py b/tests/fixtures/commit_parsers.py index ac0658d67..ff2357cd3 100644 --- a/tests/fixtures/commit_parsers.py +++ b/tests/fixtures/commit_parsers.py @@ -1,17 +1,17 @@ import pytest from semantic_release.commit_parser import ( - AngularCommitParser, - AngularParserOptions, + ConventionalCommitParser, + ConventionalCommitParserOptions, EmojiCommitParser, EmojiParserOptions, ) from tests.const import ( - ANGULAR_COMMITS_CHORE, - ANGULAR_COMMITS_MAJOR, - ANGULAR_COMMITS_MINOR, - ANGULAR_COMMITS_PATCH, + CONVENTIONAL_COMMITS_CHORE, + CONVENTIONAL_COMMITS_MAJOR, + CONVENTIONAL_COMMITS_MINOR, + CONVENTIONAL_COMMITS_PATCH, EMOJI_COMMITS_CHORE, EMOJI_COMMITS_MAJOR, EMOJI_COMMITS_MINOR, @@ -22,15 +22,15 @@ @pytest.fixture(scope="session") -def default_angular_parser() -> AngularCommitParser: - return AngularCommitParser() +def default_conventional_parser() -> ConventionalCommitParser: + return ConventionalCommitParser() @pytest.fixture(scope="session") -def default_angular_parser_options( - default_angular_parser: AngularCommitParser, -) -> AngularParserOptions: - return default_angular_parser.get_default_options() +def default_conventional_parser_options( + default_conventional_parser: ConventionalCommitParser, +) -> ConventionalCommitParserOptions: + return default_conventional_parser.get_default_options() @pytest.fixture(scope="session") @@ -46,23 +46,23 @@ def default_emoji_parser_options( @pytest.fixture(scope="session") -def angular_major_commits(): - return ANGULAR_COMMITS_MAJOR +def conventional_major_commits(): + return CONVENTIONAL_COMMITS_MAJOR @pytest.fixture(scope="session") -def angular_minor_commits(): - return ANGULAR_COMMITS_MINOR +def conventional_minor_commits(): + return CONVENTIONAL_COMMITS_MINOR @pytest.fixture(scope="session") -def angular_patch_commits(): - return ANGULAR_COMMITS_PATCH +def conventional_patch_commits(): + return CONVENTIONAL_COMMITS_PATCH @pytest.fixture(scope="session") -def angular_chore_commits(): - return ANGULAR_COMMITS_CHORE +def conventional_chore_commits(): + return CONVENTIONAL_COMMITS_CHORE @pytest.fixture(scope="session") diff --git a/tests/fixtures/example_project.py b/tests/fixtures/example_project.py index b1dc9858d..7575ec96f 100644 --- a/tests/fixtures/example_project.py +++ b/tests/fixtures/example_project.py @@ -13,7 +13,7 @@ import semantic_release from semantic_release.commit_parser import ( - AngularCommitParser, + ConventionalCommitParser, EmojiCommitParser, ScipyCommitParser, ) @@ -452,17 +452,17 @@ def _set_allow_zero_version(flag: bool) -> None: @pytest.fixture(scope="session") -def use_angular_parser( +def use_conventional_parser( update_pyproject_toml: UpdatePyprojectTomlFn, pyproject_toml_config_option_parser: str, ) -> UseParserFn: - """Modify the configuration file to use the Angular parser.""" + """Modify the configuration file to use the Conventional parser.""" - def _use_angular_parser() -> type[CommitParser]: - update_pyproject_toml(pyproject_toml_config_option_parser, "angular") - return AngularCommitParser + def _use_conventional_parser() -> type[CommitParser]: + update_pyproject_toml(pyproject_toml_config_option_parser, "conventional") + return ConventionalCommitParser - return _use_angular_parser + return _use_conventional_parser @pytest.fixture(scope="session") diff --git a/tests/fixtures/git_repo.py b/tests/fixtures/git_repo.py index c5f224c8c..0c8faeeb5 100644 --- a/tests/fixtures/git_repo.py +++ b/tests/fixtures/git_repo.py @@ -15,9 +15,9 @@ from git import Actor, Repo from semantic_release.cli.config import ChangelogOutputFormat -from semantic_release.commit_parser.angular import ( - AngularCommitParser, - AngularParserOptions, +from semantic_release.commit_parser.conventional import ( + ConventionalCommitParser, + ConventionalCommitParserOptions, ) from semantic_release.commit_parser.emoji import EmojiCommitParser, EmojiParserOptions from semantic_release.commit_parser.scipy import ScipyCommitParser, ScipyParserOptions @@ -74,7 +74,7 @@ UseParserFn, ) - CommitConvention = Literal["angular", "emoji", "scipy"] + CommitConvention = Literal["conventional", "emoji", "scipy"] VersionStr = str CommitMsg = str DatetimeISOStr = str @@ -244,7 +244,7 @@ def __call__( ) -> CommitDef: ... class CommitSpec(TypedDict): - angular: str + conventional: str emoji: str scipy: str datetime: NotRequired[DatetimeISOStr] @@ -516,11 +516,11 @@ def example_git_https_url(): @pytest.fixture(scope="session") -def get_commit_def_of_angular_commit( - default_angular_parser: AngularCommitParser, +def get_commit_def_of_conventional_commit( + default_conventional_parser: ConventionalCommitParser, ) -> GetCommitDefFn: - def _get_commit_def_of_angular_commit(msg: str) -> CommitDef: - if not (parsed_result := default_angular_parser.parse_message(msg)): + def _get_commit_def_of_conventional_commit(msg: str) -> CommitDef: + if not (parsed_result := default_conventional_parser.parse_message(msg)): return { "msg": msg, "type": "unknown", @@ -549,7 +549,7 @@ def _get_commit_def_of_angular_commit(msg: str) -> CommitDef: "include_in_changelog": True, } - return _get_commit_def_of_angular_commit + return _get_commit_def_of_conventional_commit @pytest.fixture(scope="session") @@ -982,7 +982,7 @@ def build_configured_base_repo( # noqa: C901 use_gitlab_hvcs: UseHvcsFn, use_gitea_hvcs: UseHvcsFn, use_bitbucket_hvcs: UseHvcsFn, - use_angular_parser: UseParserFn, + use_conventional_parser: UseParserFn, use_emoji_parser: UseParserFn, use_scipy_parser: UseParserFn, use_custom_parser: UseCustomParserFn, @@ -999,7 +999,7 @@ def build_configured_base_repo( # noqa: C901 def _build_configured_base_repo( # noqa: C901 dest_dir: Path | str, - commit_type: str = "angular", + commit_type: str = "conventional", hvcs_client_name: str = "github", hvcs_domain: str = EXAMPLE_HVCS_DOMAIN, tag_format_str: str | None = None, @@ -1015,8 +1015,8 @@ def _build_configured_base_repo( # noqa: C901 # Make sure we are in the dest directory with temporary_working_directory(dest_dir): # Set parser configuration - if commit_type == "angular": - use_angular_parser() + if commit_type == "conventional": + use_conventional_parser() elif commit_type == "emoji": use_emoji_parser() elif commit_type == "scipy": @@ -1089,17 +1089,18 @@ def _build_configured_base_repo( # noqa: C901 @pytest.fixture(scope="session") def separate_squashed_commit_def( - default_angular_parser: AngularCommitParser, + default_conventional_parser: ConventionalCommitParser, default_emoji_parser: EmojiCommitParser, default_scipy_parser: ScipyCommitParser, ) -> SeparateSquashedCommitDefFn: message_parsers: dict[ - CommitConvention, AngularCommitParser | EmojiCommitParser | ScipyCommitParser + CommitConvention, + ConventionalCommitParser | EmojiCommitParser | ScipyCommitParser, ] = { - "angular": AngularCommitParser( - options=AngularParserOptions( + "conventional": ConventionalCommitParser( + options=ConventionalCommitParserOptions( **{ - **default_angular_parser.options.__dict__, + **default_conventional_parser.options.__dict__, "parse_squash_commits": True, } ) @@ -1125,7 +1126,7 @@ def separate_squashed_commit_def( def _separate_squashed_commit_def( squashed_commit_def: CommitDef, ) -> list[CommitDef]: - commit_type: CommitConvention = "angular" + commit_type: CommitConvention = "conventional" for parser_name, parser in message_parsers.items(): if squashed_commit_def["type"] in parser.options.allowed_tags: commit_type = parser_name @@ -1177,13 +1178,13 @@ def _separate_squashed_commit_def( @pytest.fixture(scope="session") def convert_commit_spec_to_commit_def( - get_commit_def_of_angular_commit: GetCommitDefFn, + get_commit_def_of_conventional_commit: GetCommitDefFn, get_commit_def_of_emoji_commit: GetCommitDefFn, get_commit_def_of_scipy_commit: GetCommitDefFn, stable_now_date: datetime, ) -> ConvertCommitSpecToCommitDefFn: message_parsers: dict[CommitConvention, GetCommitDefFn] = { - "angular": get_commit_def_of_angular_commit, + "conventional": get_commit_def_of_conventional_commit, "emoji": get_commit_def_of_emoji_commit, "scipy": get_commit_def_of_scipy_commit, } diff --git a/tests/fixtures/repos/git_flow/repo_w_1_release_channel.py b/tests/fixtures/repos/git_flow/repo_w_1_release_channel.py index 75b614245..c624a7965 100644 --- a/tests/fixtures/repos/git_flow/repo_w_1_release_channel.py +++ b/tests/fixtures/repos/git_flow/repo_w_1_release_channel.py @@ -143,7 +143,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=DEV_BRANCH_NAME, tgt_branch_name=DEFAULT_BRANCH_NAME, ), @@ -200,7 +200,7 @@ def _get_repo_from_defintion( # only one commit to start the main branch convert_commit_spec_to_commit_def( { - "angular": INITIAL_COMMIT_MESSAGE, + "conventional": INITIAL_COMMIT_MESSAGE, "emoji": INITIAL_COMMIT_MESSAGE, "scipy": INITIAL_COMMIT_MESSAGE, "datetime": next(commit_timestamp_gen), @@ -237,7 +237,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "feat: add new feature", + "conventional": "feat: add new feature", "emoji": ":sparkles: add new feature", "scipy": "ENH: add new feature", "datetime": next(commit_timestamp_gen), @@ -259,7 +259,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FEAT_BRANCH_1_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -324,7 +324,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "feat: add a new feature", + "conventional": "feat: add a new feature", "emoji": ":sparkles: add a new feature", "scipy": "ENH: add a new feature", "datetime": next(commit_timestamp_gen), @@ -346,7 +346,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FEAT_BRANCH_2_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -411,7 +411,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": str.join( + "conventional": str.join( "\n\n", [ "feat: add revolutionary feature", @@ -451,7 +451,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FEAT_BRANCH_3_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -516,7 +516,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "fix: correct a bug", + "conventional": "fix: correct a bug", "emoji": ":bug: correct a bug", "scipy": "BUG: correct a bug", "datetime": next(commit_timestamp_gen), @@ -538,7 +538,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FIX_BRANCH_1_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -603,7 +603,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "fix: correct another bug", + "conventional": "fix: correct another bug", "emoji": ":bug: correct another bug", "scipy": "BUG: correct another bug", "datetime": next(commit_timestamp_gen), @@ -625,7 +625,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FIX_BRANCH_2_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -659,7 +659,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "feat(cli): add new config cli command", + "conventional": "feat(cli): add new config cli command", "emoji": ":sparkles: (cli) add new config cli command", "scipy": "ENH(cli): add new config cli command", "datetime": next(commit_timestamp_gen), @@ -681,7 +681,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FEAT_BRANCH_4_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -771,13 +771,13 @@ def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]: @pytest.fixture -def repo_w_git_flow_angular_commits( +def repo_w_git_flow_conventional_commits( build_git_flow_repo_w_1_release_channels: BuildSpecificRepoFn, example_project_git_repo: ExProjectGitRepoFn, example_project_dir: ExProjectDir, change_to_ex_proj_dir: None, ) -> BuiltRepoResult: - repo_name = repo_w_git_flow_angular_commits.__name__ + repo_name = repo_w_git_flow_conventional_commits.__name__ commit_type: CommitConvention = repo_name.split("_")[-2] # type: ignore[assignment] return { diff --git a/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py b/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py index 52e8cdb36..f4a6005bc 100644 --- a/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py +++ b/tests/fixtures/repos/git_flow/repo_w_2_release_channels.py @@ -143,7 +143,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=DEV_BRANCH_NAME, tgt_branch_name=DEFAULT_BRANCH_NAME, ), @@ -206,7 +206,7 @@ def _get_repo_from_defintion( # only one commit to start the main branch convert_commit_spec_to_commit_def( { - "angular": INITIAL_COMMIT_MESSAGE, + "conventional": INITIAL_COMMIT_MESSAGE, "emoji": INITIAL_COMMIT_MESSAGE, "scipy": INITIAL_COMMIT_MESSAGE, "datetime": next(commit_timestamp_gen), @@ -243,7 +243,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "feat: add new feature", + "conventional": "feat: add new feature", "emoji": ":sparkles: add new feature", "scipy": "ENH: add new feature", "datetime": next(commit_timestamp_gen), @@ -265,7 +265,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FEAT_BRANCH_1_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -330,7 +330,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "feat: add a new feature", + "conventional": "feat: add a new feature", "emoji": ":sparkles: add a new feature", "scipy": "ENH: add a new feature", "datetime": next(commit_timestamp_gen), @@ -370,7 +370,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": str.join( + "conventional": str.join( "\n\n", [ "feat: add revolutionary feature", @@ -428,7 +428,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "feat: add some more text", + "conventional": "feat: add some more text", "emoji": ":sparkles: add some more text", "scipy": "ENH: add some more text", "datetime": next(commit_timestamp_gen), @@ -450,7 +450,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FEAT_BRANCH_2_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -515,7 +515,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "feat(cli): add new config cli command", + "conventional": "feat(cli): add new config cli command", "emoji": ":sparkles: (cli) add new config cli command", "scipy": "ENH(cli): add new config cli command", "datetime": next(commit_timestamp_gen), @@ -537,7 +537,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FEAT_BRANCH_3_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -602,7 +602,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "fix(config): fixed configuration generation", + "conventional": "fix(config): fixed configuration generation", "emoji": ":bug: (config) fixed configuration generation", "scipy": "MAINT(config): fixed configuration generation", "datetime": next(commit_timestamp_gen), @@ -624,7 +624,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FIX_BRANCH_1_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -689,7 +689,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "feat: add some more text", + "conventional": "feat: add some more text", "emoji": ":sparkles: add some more text", "scipy": "ENH: add some more text", "datetime": next(commit_timestamp_gen), @@ -729,14 +729,14 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "fix(scope): correct some text", + "conventional": "fix(scope): correct some text", "emoji": ":bug: (scope) correct some text", "scipy": "MAINT(scope): correct some text", "datetime": next(commit_timestamp_gen), "include_in_changelog": True, }, { - "angular": "feat(scope): add some more text", + "conventional": "feat(scope): add some more text", "emoji": ":sparkles:(scope) add some more text", "scipy": "ENH(scope): add some more text", "datetime": next(commit_timestamp_gen), @@ -811,13 +811,13 @@ def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]: @pytest.fixture -def repo_w_git_flow_w_alpha_prereleases_n_angular_commits( +def repo_w_git_flow_w_alpha_prereleases_n_conventional_commits( build_git_flow_repo_w_2_release_channels: BuildSpecificRepoFn, example_project_git_repo: ExProjectGitRepoFn, example_project_dir: ExProjectDir, change_to_ex_proj_dir: None, ) -> BuiltRepoResult: - repo_name = repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__ + repo_name = repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__ commit_type: CommitConvention = repo_name.split("_")[-2] # type: ignore[assignment] return { diff --git a/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py b/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py index 32f22a7c6..10cc98ff8 100644 --- a/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py +++ b/tests/fixtures/repos/git_flow/repo_w_3_release_channels.py @@ -145,7 +145,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=DEV_BRANCH_NAME, tgt_branch_name=DEFAULT_BRANCH_NAME, ), @@ -214,7 +214,7 @@ def _get_repo_from_defintion( # only one commit to start the main branch convert_commit_spec_to_commit_def( { - "angular": INITIAL_COMMIT_MESSAGE, + "conventional": INITIAL_COMMIT_MESSAGE, "emoji": INITIAL_COMMIT_MESSAGE, "scipy": INITIAL_COMMIT_MESSAGE, "datetime": next(commit_timestamp_gen), @@ -251,7 +251,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "feat: add new feature", + "conventional": "feat: add new feature", "emoji": ":sparkles: add new feature", "scipy": "ENH: add new feature", "datetime": next(commit_timestamp_gen), @@ -273,7 +273,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FEAT_BRANCH_1_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -338,7 +338,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "feat: add a new feature", + "conventional": "feat: add a new feature", "emoji": ":sparkles: add a new feature", "scipy": "ENH: add a new feature", "datetime": next(commit_timestamp_gen), @@ -378,7 +378,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": str.join( + "conventional": str.join( "\n\n", [ "feat: add revolutionary feature", @@ -441,7 +441,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FEAT_BRANCH_2_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -529,7 +529,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "feat(cli): add new config cli command", + "conventional": "feat(cli): add new config cli command", "emoji": ":sparkles: (cli) add new config cli command", "scipy": "ENH(cli): add new config cli command", "datetime": next(commit_timestamp_gen), @@ -569,7 +569,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "feat(config): add new config option", + "conventional": "feat(config): add new config option", "emoji": ":sparkles: (config) add new config option", "scipy": "ENH(config): add new config option", "datetime": next(commit_timestamp_gen), @@ -614,7 +614,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FEAT_BRANCH_3_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -648,7 +648,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "fix(cli): fix config cli command", + "conventional": "fix(cli): fix config cli command", "emoji": ":bug: (cli) fix config cli command", "scipy": "BUG(cli): fix config cli command", "datetime": next(commit_timestamp_gen), @@ -670,7 +670,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FIX_BRANCH_1_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -727,7 +727,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "fix(config): fix config option", + "conventional": "fix(config): fix config option", "emoji": ":bug: (config) fix config option", "scipy": "BUG(config): fix config option", "datetime": next(commit_timestamp_gen), @@ -749,7 +749,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FIX_BRANCH_2_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -862,7 +862,7 @@ def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]: @pytest.fixture -def repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits_using_tag_format( +def repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits_using_tag_format( build_repo_from_definition: BuildRepoFromDefinitionFn, get_repo_definition_4_git_flow_repo_w_3_release_channels: GetRepoDefinitionFn, get_cached_repo_data: GetCachedRepoDataFn, @@ -875,13 +875,13 @@ def repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits_using_tag_format( def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]: repo_construction_steps = ( get_repo_definition_4_git_flow_repo_w_3_release_channels( - commit_type="angular", + commit_type="conventional", tag_format_str="submod-v{version}", ) ) return build_repo_from_definition(cached_repo_path, repo_construction_steps) - repo_name = repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits_using_tag_format.__name__ + repo_name = repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits_using_tag_format.__name__ build_repo_or_copy_cache( repo_name=repo_name, @@ -900,13 +900,13 @@ def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]: @pytest.fixture -def repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits( +def repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits( build_git_flow_repo_w_3_release_channels: BuildSpecificRepoFn, example_project_git_repo: ExProjectGitRepoFn, example_project_dir: ExProjectDir, change_to_ex_proj_dir: None, ) -> BuiltRepoResult: - repo_name = repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits.__name__ + repo_name = repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits.__name__ commit_type: CommitConvention = repo_name.split("_")[-2] # type: ignore[assignment] return { diff --git a/tests/fixtures/repos/git_flow/repo_w_4_release_channels.py b/tests/fixtures/repos/git_flow/repo_w_4_release_channels.py index 204a41ea3..d6abbb5df 100644 --- a/tests/fixtures/repos/git_flow/repo_w_4_release_channels.py +++ b/tests/fixtures/repos/git_flow/repo_w_4_release_channels.py @@ -169,7 +169,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=DEV_BRANCH_NAME, tgt_branch_name=BETA_BRANCH_NAME, ), @@ -196,7 +196,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=BETA_BRANCH_NAME, tgt_branch_name=DEFAULT_BRANCH_NAME, ), @@ -270,7 +270,7 @@ def _get_repo_from_defintion( # only one commit to start the main branch convert_commit_spec_to_commit_def( { - "angular": INITIAL_COMMIT_MESSAGE, + "conventional": INITIAL_COMMIT_MESSAGE, "emoji": INITIAL_COMMIT_MESSAGE, "scipy": INITIAL_COMMIT_MESSAGE, "datetime": next(commit_timestamp_gen), @@ -316,7 +316,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "feat: add new feature", + "conventional": "feat: add new feature", "emoji": ":sparkles: add new feature", "scipy": "ENH: add new feature", "datetime": next(commit_timestamp_gen), @@ -338,7 +338,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FEAT_BRANCH_1_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -411,7 +411,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "fix(cli): fix config cli command", + "conventional": "fix(cli): fix config cli command", "emoji": ":bug: (cli) fix config cli command", "scipy": "BUG(cli): fix config cli command", "datetime": next(commit_timestamp_gen), @@ -433,7 +433,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FIX_BRANCH_1_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -521,7 +521,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "fix(config): fix config option", + "conventional": "fix(config): fix config option", "emoji": ":bug: (config) fix config option", "scipy": "BUG(config): fix config option", "datetime": next(commit_timestamp_gen), @@ -543,7 +543,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FIX_BRANCH_2_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -632,7 +632,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "feat(feat-2): add another primary feature", + "conventional": "feat(feat-2): add another primary feature", "emoji": ":sparkles: (feat-2) add another primary feature", "scipy": "ENH(feat-2): add another primary feature", "datetime": next(commit_timestamp_gen), @@ -677,7 +677,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_git( + "conventional": format_merge_commit_msg_git( branch_name=FEAT_BRANCH_2_NAME, tgt_branch_name=DEV_BRANCH_NAME, ), @@ -820,13 +820,15 @@ def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]: @pytest.fixture -def repo_w_git_flow_w_beta_alpha_rev_prereleases_n_angular_commits( +def repo_w_git_flow_w_beta_alpha_rev_prereleases_n_conventional_commits( build_git_flow_repo_w_4_release_channels: BuildSpecificRepoFn, example_project_git_repo: ExProjectGitRepoFn, example_project_dir: ExProjectDir, change_to_ex_proj_dir: None, ) -> BuiltRepoResult: - repo_name = repo_w_git_flow_w_beta_alpha_rev_prereleases_n_angular_commits.__name__ + repo_name = ( + repo_w_git_flow_w_beta_alpha_rev_prereleases_n_conventional_commits.__name__ + ) commit_type: CommitConvention = repo_name.split("_")[-2] # type: ignore[assignment] return { diff --git a/tests/fixtures/repos/github_flow/repo_w_default_release.py b/tests/fixtures/repos/github_flow/repo_w_default_release.py index 3e572499b..ce8877dfe 100644 --- a/tests/fixtures/repos/github_flow/repo_w_default_release.py +++ b/tests/fixtures/repos/github_flow/repo_w_default_release.py @@ -152,7 +152,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": INITIAL_COMMIT_MESSAGE, + "conventional": INITIAL_COMMIT_MESSAGE, "emoji": INITIAL_COMMIT_MESSAGE, "scipy": INITIAL_COMMIT_MESSAGE, "datetime": next(commit_timestamp_gen), @@ -161,7 +161,7 @@ def _get_repo_from_defintion( ), }, { - "angular": "feat: add new feature", + "conventional": "feat: add new feature", "emoji": ":sparkles: add new feature", "scipy": "ENH: add new feature", "datetime": next(commit_timestamp_gen), @@ -193,7 +193,7 @@ def _get_repo_from_defintion( fix_branch_1_commits: Sequence[CommitSpec] = [ { - "angular": "fix(cli): add missing text", + "conventional": "fix(cli): add missing text", "emoji": ":bug: add missing text", "scipy": "MAINT: add missing text", "datetime": next(commit_timestamp_gen), @@ -232,19 +232,19 @@ def _get_repo_from_defintion( # simulate separate work by another person at same time as the fix branch feat_branch_1_commits: Sequence[CommitSpec] = [ { - "angular": "feat(cli): add cli interface", + "conventional": "feat(cli): add cli interface", "emoji": ":sparkles: add cli interface", "scipy": "ENH: add cli interface", "datetime": next(commit_timestamp_gen), }, { - "angular": "test(cli): add cli tests", + "conventional": "test(cli): add cli tests", "emoji": ":checkmark: add cli tests", "scipy": "TST: add cli tests", "datetime": next(commit_timestamp_gen), }, { - "angular": "docs(cli): add cli documentation", + "conventional": "docs(cli): add cli documentation", "emoji": ":memo: add cli documentation", "scipy": "DOC: add cli documentation", "datetime": next(commit_timestamp_gen), @@ -282,7 +282,7 @@ def _get_repo_from_defintion( new_version = "1.0.1" - all_commit_types: list[CommitConvention] = ["angular", "emoji", "scipy"] + all_commit_types: list[CommitConvention] = ["conventional", "emoji", "scipy"] fix_branch_pr_number = next(pr_num_gen) fix_branch_squash_commit_spec: CommitSpec = { **{ # type: ignore[typeddict-item] @@ -431,13 +431,15 @@ def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]: @pytest.fixture -def repo_w_github_flow_w_default_release_channel_angular_commits( +def repo_w_github_flow_w_default_release_channel_conventional_commits( build_repo_w_github_flow_w_default_release_channel: BuildSpecificRepoFn, example_project_git_repo: ExProjectGitRepoFn, example_project_dir: ExProjectDir, change_to_ex_proj_dir: None, ) -> BuiltRepoResult: - repo_name = repo_w_github_flow_w_default_release_channel_angular_commits.__name__ + repo_name = ( + repo_w_github_flow_w_default_release_channel_conventional_commits.__name__ + ) commit_type: CommitConvention = repo_name.split("_")[-2] # type: ignore[assignment] return { diff --git a/tests/fixtures/repos/github_flow/repo_w_release_channels.py b/tests/fixtures/repos/github_flow/repo_w_release_channels.py index 843aba506..07be6eb5a 100644 --- a/tests/fixtures/repos/github_flow/repo_w_release_channels.py +++ b/tests/fixtures/repos/github_flow/repo_w_release_channels.py @@ -158,7 +158,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": INITIAL_COMMIT_MESSAGE, + "conventional": INITIAL_COMMIT_MESSAGE, "emoji": INITIAL_COMMIT_MESSAGE, "scipy": INITIAL_COMMIT_MESSAGE, "datetime": next(commit_timestamp_gen), @@ -167,7 +167,7 @@ def _get_repo_from_defintion( ), }, { - "angular": "feat: add new feature", + "conventional": "feat: add new feature", "emoji": ":sparkles: add new feature", "scipy": "ENH: add new feature", "datetime": next(commit_timestamp_gen), @@ -216,7 +216,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "fix: correct some text", + "conventional": "fix: correct some text", "emoji": ":bug: correct some text", "scipy": "MAINT: correct some text", "datetime": next(commit_timestamp_gen), @@ -256,7 +256,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "fix: adjust text to resolve", + "conventional": "fix: adjust text to resolve", "emoji": ":bug: adjust text to resolve", "scipy": "MAINT: adjust text to resolve", "datetime": next(commit_timestamp_gen), @@ -302,7 +302,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_github( + "conventional": format_merge_commit_msg_github( pr_number=fix_branch_pr_number, branch_name=FIX_BRANCH_1_NAME, ), @@ -360,7 +360,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "feat(cli): add cli interface", + "conventional": "feat(cli): add cli interface", "emoji": ":sparkles: add cli interface", "scipy": "ENH: add cli interface", "datetime": next(commit_timestamp_gen), @@ -406,7 +406,7 @@ def _get_repo_from_defintion( "fast_forward": False, "commit_def": convert_commit_spec_to_commit_def( { - "angular": format_merge_commit_msg_github( + "conventional": format_merge_commit_msg_github( pr_number=feat_branch_pr_number, branch_name=FEAT_BRANCH_1_NAME, ), @@ -489,13 +489,15 @@ def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]: @pytest.fixture -def repo_w_github_flow_w_feature_release_channel_angular_commits( +def repo_w_github_flow_w_feature_release_channel_conventional_commits( build_repo_w_github_flow_w_feature_release_channel: BuildSpecificRepoFn, example_project_git_repo: ExProjectGitRepoFn, example_project_dir: ExProjectDir, change_to_ex_proj_dir: None, ) -> BuiltRepoResult: - repo_name = repo_w_github_flow_w_feature_release_channel_angular_commits.__name__ + repo_name = ( + repo_w_github_flow_w_feature_release_channel_conventional_commits.__name__ + ) commit_type: CommitConvention = repo_name.split("_")[-2] # type: ignore[assignment] return { diff --git a/tests/fixtures/repos/repo_initial_commit.py b/tests/fixtures/repos/repo_initial_commit.py index 92a64cf1e..c6ffd952b 100644 --- a/tests/fixtures/repos/repo_initial_commit.py +++ b/tests/fixtures/repos/repo_initial_commit.py @@ -106,7 +106,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": INITIAL_COMMIT_MESSAGE, + "conventional": INITIAL_COMMIT_MESSAGE, "emoji": INITIAL_COMMIT_MESSAGE, "scipy": INITIAL_COMMIT_MESSAGE, "datetime": stable_now_date().isoformat( @@ -194,7 +194,7 @@ def repo_w_initial_commit( return { "definition": build_repo_w_initial_commit( repo_name=repo_name, - commit_type="angular", # not used but required + commit_type="conventional", # not used but required dest_dir=example_project_dir, ), "repo": example_project_git_repo(), diff --git a/tests/fixtures/repos/trunk_based_dev/repo_w_dual_version_support.py b/tests/fixtures/repos/trunk_based_dev/repo_w_dual_version_support.py index 3353024c0..c7a33cc16 100644 --- a/tests/fixtures/repos/trunk_based_dev/repo_w_dual_version_support.py +++ b/tests/fixtures/repos/trunk_based_dev/repo_w_dual_version_support.py @@ -149,7 +149,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": INITIAL_COMMIT_MESSAGE, + "conventional": INITIAL_COMMIT_MESSAGE, "emoji": INITIAL_COMMIT_MESSAGE, "scipy": INITIAL_COMMIT_MESSAGE, "datetime": next(commit_timestamp_gen), @@ -158,7 +158,7 @@ def _get_repo_from_defintion( ), }, { - "angular": "feat: add new feature", + "conventional": "feat: add new feature", "emoji": ":sparkles: add new feature", "scipy": "ENH: add new feature", "datetime": next(commit_timestamp_gen), @@ -198,7 +198,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "fix: correct some text", + "conventional": "fix: correct some text", "emoji": ":bug: correct some text", "scipy": "MAINT: correct some text", "datetime": next(commit_timestamp_gen), @@ -251,7 +251,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": str.join( + "conventional": str.join( "\n\n", [ "feat: add revolutionary feature", @@ -313,7 +313,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "fix: correct critical bug", + "conventional": "fix: correct critical bug", "emoji": ":bug: correct critical bug", "scipy": "MAINT: correct critical bug", "datetime": next(commit_timestamp_gen), @@ -401,13 +401,13 @@ def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]: @pytest.fixture -def repo_w_trunk_only_dual_version_spt_angular_commits( +def repo_w_trunk_only_dual_version_spt_conventional_commits( build_trunk_only_repo_w_dual_version_support: BuildSpecificRepoFn, example_project_git_repo: ExProjectGitRepoFn, example_project_dir: ExProjectDir, change_to_ex_proj_dir: None, ) -> BuiltRepoResult: - repo_name = repo_w_trunk_only_dual_version_spt_angular_commits.__name__ + repo_name = repo_w_trunk_only_dual_version_spt_conventional_commits.__name__ commit_type: CommitConvention = repo_name.split("_")[-2] # type: ignore[assignment] return { diff --git a/tests/fixtures/repos/trunk_based_dev/repo_w_dual_version_support_w_prereleases.py b/tests/fixtures/repos/trunk_based_dev/repo_w_dual_version_support_w_prereleases.py index 33a827dab..2576ec510 100644 --- a/tests/fixtures/repos/trunk_based_dev/repo_w_dual_version_support_w_prereleases.py +++ b/tests/fixtures/repos/trunk_based_dev/repo_w_dual_version_support_w_prereleases.py @@ -149,7 +149,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": INITIAL_COMMIT_MESSAGE, + "conventional": INITIAL_COMMIT_MESSAGE, "emoji": INITIAL_COMMIT_MESSAGE, "scipy": INITIAL_COMMIT_MESSAGE, "datetime": next(commit_timestamp_gen), @@ -158,7 +158,7 @@ def _get_repo_from_defintion( ), }, { - "angular": "feat: add new feature", + "conventional": "feat: add new feature", "emoji": ":sparkles: add new feature", "scipy": "ENH: add new feature", "datetime": next(commit_timestamp_gen), @@ -198,7 +198,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "fix: correct some text", + "conventional": "fix: correct some text", "emoji": ":bug: correct some text", "scipy": "MAINT: correct some text", "datetime": next(commit_timestamp_gen), @@ -251,7 +251,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": str.join( + "conventional": str.join( "\n\n", [ "feat: add revolutionary feature", @@ -314,7 +314,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "fix: correct critical bug", + "conventional": "fix: correct critical bug", "emoji": ":bug: correct critical bug", "scipy": "MAINT: correct critical bug", "datetime": next(commit_timestamp_gen), @@ -355,7 +355,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "fix: resolve critical bug", + "conventional": "fix: resolve critical bug", "emoji": ":bug: resolve critical bug", "scipy": "MAINT: resolve critical bug", "datetime": next(commit_timestamp_gen), @@ -396,7 +396,7 @@ def _get_repo_from_defintion( # "commits": convert_commit_specs_to_commit_defs( # [ # { - # "angular": "docs: update documentation regarding critical bug", + # "conventional": "docs: update documentation regarding critical bug", # "emoji": ":books: update documentation regarding critical bug", # "scipy": "DOC: update documentation regarding critical bug", # "datetime": next(commit_timestamp_gen), @@ -484,14 +484,14 @@ def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]: @pytest.fixture -def repo_w_trunk_only_dual_version_spt_w_prereleases_angular_commits( +def repo_w_trunk_only_dual_version_spt_w_prereleases_conventional_commits( build_trunk_only_repo_w_dual_version_spt_w_prereleases: BuildSpecificRepoFn, example_project_git_repo: ExProjectGitRepoFn, example_project_dir: ExProjectDir, change_to_ex_proj_dir: None, ) -> BuiltRepoResult: repo_name = ( - repo_w_trunk_only_dual_version_spt_w_prereleases_angular_commits.__name__ + repo_w_trunk_only_dual_version_spt_w_prereleases_conventional_commits.__name__ ) commit_type: CommitConvention = repo_name.split("_")[-2] # type: ignore[assignment] diff --git a/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py b/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py index 45c3b40dd..65acc4d50 100644 --- a/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py +++ b/tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py @@ -119,7 +119,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": INITIAL_COMMIT_MESSAGE, + "conventional": INITIAL_COMMIT_MESSAGE, "emoji": INITIAL_COMMIT_MESSAGE, "scipy": INITIAL_COMMIT_MESSAGE, "datetime": next(commit_timestamp_gen), @@ -128,21 +128,21 @@ def _get_repo_from_defintion( ), }, { - "angular": "feat: add new feature", + "conventional": "feat: add new feature", "emoji": ":sparkles: add new feature", "scipy": "ENH: add new feature", "datetime": next(commit_timestamp_gen), "include_in_changelog": True, }, { - "angular": "fix: correct some text", + "conventional": "fix: correct some text", "emoji": ":bug: correct some text", "scipy": "MAINT: correct some text", "datetime": next(commit_timestamp_gen), "include_in_changelog": True, }, { - "angular": "fix: correct more text", + "conventional": "fix: correct more text", "emoji": ":bug: correct more text", "scipy": "MAINT: correct more text", "datetime": next(commit_timestamp_gen), @@ -215,7 +215,7 @@ def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]: @pytest.fixture -def repo_w_no_tags_angular_commits_using_tag_format( +def repo_w_no_tags_conventional_commits_using_tag_format( build_repo_from_definition: BuildRepoFromDefinitionFn, get_repo_definition_4_trunk_only_repo_w_no_tags: GetRepoDefinitionFn, get_cached_repo_data: GetCachedRepoDataFn, @@ -230,7 +230,7 @@ def repo_w_no_tags_angular_commits_using_tag_format( Follows tag format defined in python-semantic-release#1137 """ - repo_name = repo_w_no_tags_angular_commits_using_tag_format.__name__ + repo_name = repo_w_no_tags_conventional_commits_using_tag_format.__name__ commit_type: CommitConvention = ( repo_name.split("_commits", maxsplit=1)[0].split("_")[-1] # type: ignore[assignment] ) @@ -259,13 +259,13 @@ def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]: @pytest.fixture -def repo_w_no_tags_angular_commits( +def repo_w_no_tags_conventional_commits( build_trunk_only_repo_w_no_tags: BuildSpecificRepoFn, example_project_git_repo: ExProjectGitRepoFn, example_project_dir: ExProjectDir, change_to_ex_proj_dir: None, ) -> BuiltRepoResult: - repo_name = repo_w_no_tags_angular_commits.__name__ + repo_name = repo_w_no_tags_conventional_commits.__name__ commit_type: CommitConvention = repo_name.split("_")[-2] # type: ignore[assignment] return { diff --git a/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py b/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py index 1d57218ba..a2c133d21 100644 --- a/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py +++ b/tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py @@ -139,7 +139,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": INITIAL_COMMIT_MESSAGE, + "conventional": INITIAL_COMMIT_MESSAGE, "emoji": INITIAL_COMMIT_MESSAGE, "scipy": INITIAL_COMMIT_MESSAGE, "datetime": next(commit_timestamp_gen), @@ -148,7 +148,7 @@ def _get_repo_from_defintion( ), }, { - "angular": "feat: add new feature", + "conventional": "feat: add new feature", "emoji": ":sparkles: add new feature", "scipy": "ENH: add new feature", "datetime": next(commit_timestamp_gen), @@ -188,7 +188,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "fix: correct some text", + "conventional": "fix: correct some text", "emoji": ":bug: correct some text", "scipy": "MAINT: correct some text", "datetime": next(commit_timestamp_gen), @@ -228,7 +228,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "feat: add some more text", + "conventional": "feat: add some more text", "emoji": ":sparkles: add some more text", "scipy": "ENH: add some more text", "datetime": next(commit_timestamp_gen), @@ -268,7 +268,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "feat(cli): add cli command", + "conventional": "feat(cli): add cli command", "emoji": ":sparkles:(cli) add cli command", "scipy": "ENH(cli): add cli command", "datetime": next(commit_timestamp_gen), @@ -343,13 +343,13 @@ def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]: @pytest.fixture -def repo_w_trunk_only_n_prereleases_angular_commits( +def repo_w_trunk_only_n_prereleases_conventional_commits( build_trunk_only_repo_w_prerelease_tags: BuildSpecificRepoFn, example_project_git_repo: ExProjectGitRepoFn, example_project_dir: ExProjectDir, change_to_ex_proj_dir: None, ) -> BuiltRepoResult: - repo_name = repo_w_trunk_only_n_prereleases_angular_commits.__name__ + repo_name = repo_w_trunk_only_n_prereleases_conventional_commits.__name__ commit_type: CommitConvention = repo_name.split("_")[-2] # type: ignore[assignment] return { diff --git a/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py b/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py index a79bd11dc..9d080ed7a 100644 --- a/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py +++ b/tests/fixtures/repos/trunk_based_dev/repo_w_tags.py @@ -141,7 +141,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": INITIAL_COMMIT_MESSAGE, + "conventional": INITIAL_COMMIT_MESSAGE, "emoji": INITIAL_COMMIT_MESSAGE, "scipy": INITIAL_COMMIT_MESSAGE, "datetime": next(commit_timestamp_gen), @@ -150,7 +150,7 @@ def _get_repo_from_defintion( ), }, { - "angular": "feat: add new feature", + "conventional": "feat: add new feature", "emoji": ":sparkles: add new feature", "scipy": "ENH: add new feature", "datetime": next(commit_timestamp_gen), @@ -190,7 +190,7 @@ def _get_repo_from_defintion( "commits": convert_commit_specs_to_commit_defs( [ { - "angular": "fix: correct some text", + "conventional": "fix: correct some text", "emoji": ":bug: correct some text", "scipy": "MAINT: correct some text", "datetime": next(commit_timestamp_gen), @@ -263,7 +263,7 @@ def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]: @pytest.fixture -def repo_w_trunk_only_angular_commits_using_tag_format( +def repo_w_trunk_only_conventional_commits_using_tag_format( build_repo_from_definition: BuildRepoFromDefinitionFn, get_repo_definition_4_trunk_only_repo_w_tags: GetRepoDefinitionFn, get_cached_repo_data: GetCachedRepoDataFn, @@ -273,7 +273,7 @@ def repo_w_trunk_only_angular_commits_using_tag_format( example_project_dir: ExProjectDir, change_to_ex_proj_dir: None, ) -> BuiltRepoResult: - repo_name = repo_w_trunk_only_angular_commits_using_tag_format.__name__ + repo_name = repo_w_trunk_only_conventional_commits_using_tag_format.__name__ commit_type: CommitConvention = ( repo_name.split("_commits", maxsplit=1)[0].split("_")[-1] # type: ignore[assignment] ) @@ -302,13 +302,13 @@ def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]: @pytest.fixture -def repo_w_trunk_only_angular_commits( +def repo_w_trunk_only_conventional_commits( build_trunk_only_repo_w_tags: BuildSpecificRepoFn, example_project_git_repo: ExProjectGitRepoFn, example_project_dir: ExProjectDir, change_to_ex_proj_dir: None, ) -> BuiltRepoResult: - repo_name = repo_w_trunk_only_angular_commits.__name__ + repo_name = repo_w_trunk_only_conventional_commits.__name__ commit_type: CommitConvention = repo_name.split("_")[-2] # type: ignore[assignment] return { diff --git a/tests/unit/semantic_release/changelog/test_release_history.py b/tests/unit/semantic_release/changelog/test_release_history.py index 3f9908fcf..17b327cfa 100644 --- a/tests/unit/semantic_release/changelog/test_release_history.py +++ b/tests/unit/semantic_release/changelog/test_release_history.py @@ -11,21 +11,21 @@ from semantic_release.version.translator import VersionTranslator from semantic_release.version.version import Version -from tests.const import ANGULAR_COMMITS_MINOR, COMMIT_MESSAGE +from tests.const import COMMIT_MESSAGE, CONVENTIONAL_COMMITS_MINOR from tests.fixtures import ( - repo_w_git_flow_w_alpha_prereleases_n_angular_commits, - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits, - repo_w_github_flow_w_feature_release_channel_angular_commits, - repo_w_no_tags_angular_commits, - repo_w_trunk_only_angular_commits, - repo_w_trunk_only_n_prereleases_angular_commits, + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits, + repo_w_github_flow_w_feature_release_channel_conventional_commits, + repo_w_no_tags_conventional_commits, + repo_w_trunk_only_conventional_commits, + repo_w_trunk_only_n_prereleases_conventional_commits, ) from tests.util import add_text_to_file if TYPE_CHECKING: from typing import Protocol - from semantic_release.commit_parser.angular import AngularCommitParser + from semantic_release.commit_parser.conventional import ConventionalCommitParser from tests.fixtures.git_repo import ( BuiltRepoResult, @@ -39,7 +39,7 @@ def __call__(self, repo_def: RepoDefinition) -> FakeReleaseHistoryElements: ... # NOTE: not testing parser correctness here, just that the right commits end up # in the right places. So we only compare that the commits with the messages # we anticipate are in the right place, rather than by hash -# So we are only using the angular parser +# So we are only using the conventional parser # We are also currently only testing that the "elements" key of the releases @@ -103,21 +103,21 @@ def _create_release_history_from_repo_def( @pytest.mark.parametrize( "repo_result", [ - # ANGULAR parser - lazy_fixture(repo_w_no_tags_angular_commits.__name__), + # CONVENTIONAL parser + lazy_fixture(repo_w_no_tags_conventional_commits.__name__), *[ pytest.param( lazy_fixture(repo_fixture_name), marks=pytest.mark.comprehensive, ) for repo_fixture_name in [ - repo_w_trunk_only_angular_commits.__name__, - repo_w_trunk_only_n_prereleases_angular_commits.__name__, + repo_w_trunk_only_conventional_commits.__name__, + repo_w_trunk_only_n_prereleases_conventional_commits.__name__, # This is not tested because currently unable to disern the commits that were squashed or not - # repo_w_github_flow_w_default_release_channel_angular_commits.__name__, - repo_w_github_flow_w_feature_release_channel_angular_commits.__name__, - repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__, - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits.__name__, + # repo_w_github_flow_w_default_release_channel_conventional_commits.__name__, + repo_w_github_flow_w_feature_release_channel_conventional_commits.__name__, + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits.__name__, ] ], ], @@ -125,7 +125,7 @@ def _create_release_history_from_repo_def( @pytest.mark.order("last") def test_release_history( repo_result: BuiltRepoResult, - default_angular_parser: AngularCommitParser, + default_conventional_parser: ConventionalCommitParser, file_in_repo: str, create_release_history_from_repo_def: CreateReleaseHistoryFromRepoDefFn, get_commits_from_repo_build_def: GetCommitsFromRepoBuildDefFn, @@ -143,7 +143,7 @@ def test_release_history( history = ReleaseHistory.from_git_history( repo, translator, - default_angular_parser, # type: ignore[arg-type] + default_conventional_parser, # type: ignore[arg-type] ) released = history.released @@ -171,7 +171,7 @@ def test_release_history( # PART 2: add some commits to the repo and check that they are in the right place - for commit_message in ANGULAR_COMMITS_MINOR: + for commit_message in CONVENTIONAL_COMMITS_MINOR: add_text_to_file(repo, file_in_repo) repo.git.commit(m=commit_message) @@ -181,7 +181,7 @@ def test_release_history( [ msg for bucket in [ - ANGULAR_COMMITS_MINOR[::-1], + CONVENTIONAL_COMMITS_MINOR[::-1], *expected_release_history.unreleased.values(), ] for msg in bucket @@ -193,7 +193,7 @@ def test_release_history( new_history = ReleaseHistory.from_git_history( repo, translator, - default_angular_parser, # type: ignore[arg-type] + default_conventional_parser, # type: ignore[arg-type] ) new_unreleased = new_history.unreleased new_released = new_history.released @@ -218,32 +218,32 @@ def test_release_history( @pytest.mark.parametrize( "repo_result", [ - lazy_fixture(repo_w_no_tags_angular_commits.__name__), + lazy_fixture(repo_w_no_tags_conventional_commits.__name__), *[ pytest.param( lazy_fixture(repo_fixture_name), marks=pytest.mark.comprehensive, ) for repo_fixture_name in [ - repo_w_trunk_only_angular_commits.__name__, - repo_w_trunk_only_n_prereleases_angular_commits.__name__, - repo_w_github_flow_w_feature_release_channel_angular_commits.__name__, - repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__, - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits.__name__, + repo_w_trunk_only_conventional_commits.__name__, + repo_w_trunk_only_n_prereleases_conventional_commits.__name__, + repo_w_github_flow_w_feature_release_channel_conventional_commits.__name__, + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits.__name__, ] ], ], ) @pytest.mark.order("last") def test_release_history_releases( - repo_result: BuiltRepoResult, default_angular_parser: AngularCommitParser + repo_result: BuiltRepoResult, default_conventional_parser: ConventionalCommitParser ): new_version = Version.parse("100.10.1") actor = Actor("semantic-release", "semantic-release") release_history = ReleaseHistory.from_git_history( repo=repo_result["repo"], translator=VersionTranslator(), - commit_parser=default_angular_parser, # type: ignore[arg-type] + commit_parser=default_conventional_parser, # type: ignore[arg-type] ) tagged_date = datetime.now() new_rh = release_history.release( @@ -270,32 +270,32 @@ def test_release_history_releases( @pytest.mark.parametrize( "repo_result", [ - lazy_fixture(repo_w_no_tags_angular_commits.__name__), + lazy_fixture(repo_w_no_tags_conventional_commits.__name__), *[ pytest.param( lazy_fixture(repo_fixture_name), marks=pytest.mark.comprehensive, ) for repo_fixture_name in [ - repo_w_trunk_only_angular_commits.__name__, - repo_w_trunk_only_n_prereleases_angular_commits.__name__, - repo_w_github_flow_w_feature_release_channel_angular_commits.__name__, - repo_w_git_flow_w_alpha_prereleases_n_angular_commits.__name__, - repo_w_git_flow_w_rc_n_alpha_prereleases_n_angular_commits.__name__, + repo_w_trunk_only_conventional_commits.__name__, + repo_w_trunk_only_n_prereleases_conventional_commits.__name__, + repo_w_github_flow_w_feature_release_channel_conventional_commits.__name__, + repo_w_git_flow_w_alpha_prereleases_n_conventional_commits.__name__, + repo_w_git_flow_w_rc_n_alpha_prereleases_n_conventional_commits.__name__, ] ], ], ) @pytest.mark.order("last") def test_all_matching_repo_tags_are_released( - repo_result: BuiltRepoResult, default_angular_parser: AngularCommitParser + repo_result: BuiltRepoResult, default_conventional_parser: ConventionalCommitParser ): repo = repo_result["repo"] translator = VersionTranslator() release_history = ReleaseHistory.from_git_history( repo=repo, translator=translator, - commit_parser=default_angular_parser, # type: ignore[arg-type] + commit_parser=default_conventional_parser, # type: ignore[arg-type] ) for tag in repo.tags: diff --git a/tests/unit/semantic_release/cli/test_config.py b/tests/unit/semantic_release/cli/test_config.py index c24781c4c..343748187 100644 --- a/tests/unit/semantic_release/cli/test_config.py +++ b/tests/unit/semantic_release/cli/test_config.py @@ -25,7 +25,7 @@ _known_hvcs, ) from semantic_release.cli.util import load_raw_config_file -from semantic_release.commit_parser.angular import AngularParserOptions +from semantic_release.commit_parser.conventional import ConventionalCommitParserOptions from semantic_release.commit_parser.emoji import EmojiParserOptions from semantic_release.commit_parser.scipy import ScipyParserOptions from semantic_release.commit_parser.tag import TagParserOptions @@ -33,7 +33,7 @@ from semantic_release.enums import LevelBump from semantic_release.errors import ParserLoadError -from tests.fixtures.repos import repo_w_no_tags_angular_commits +from tests.fixtures.repos import repo_w_no_tags_conventional_commits from tests.util import ( CustomParserOpts, CustomParserWithNoOpts, @@ -110,9 +110,9 @@ def test_invalid_hvcs_type(remote_config: dict[str, Any]): [ ( None, - RootModel(AngularParserOptions()).model_dump(), - ), # default not provided -> means angular - ("angular", RootModel(AngularParserOptions()).model_dump()), + RootModel(ConventionalCommitParserOptions()).model_dump(), + ), # default not provided -> means conventional + ("conventional", RootModel(ConventionalCommitParserOptions()).model_dump()), ("emoji", RootModel(EmojiParserOptions()).model_dump()), ("scipy", RootModel(ScipyParserOptions()).model_dump()), ("tag", RootModel(TagParserOptions()).model_dump()), @@ -142,7 +142,7 @@ def test_load_user_defined_parser_opts(): } raw_config = RawConfig.model_validate( { - "commit_parser": "angular", + "commit_parser": "conventional", "commit_parser_options": user_defined_opts, } ) @@ -185,7 +185,7 @@ def test_default_toml_config_valid(example_project_dir: ExProjectDir): ({"GIT_COMMIT_AUTHOR": "foo "}, "foo "), ], ) -@pytest.mark.usefixtures(repo_w_no_tags_angular_commits.__name__) +@pytest.mark.usefixtures(repo_w_no_tags_conventional_commits.__name__) def test_commit_author_configurable( example_pyproject_toml: Path, mock_env: dict[str, str], diff --git a/tests/unit/semantic_release/commit_parser/test_angular.py b/tests/unit/semantic_release/commit_parser/test_conventional.py similarity index 91% rename from tests/unit/semantic_release/commit_parser/test_angular.py rename to tests/unit/semantic_release/commit_parser/test_conventional.py index ef6ed9eb4..078e1ecd5 100644 --- a/tests/unit/semantic_release/commit_parser/test_angular.py +++ b/tests/unit/semantic_release/commit_parser/test_conventional.py @@ -5,9 +5,9 @@ import pytest -from semantic_release.commit_parser.angular import ( - AngularCommitParser, - AngularParserOptions, +from semantic_release.commit_parser.conventional import ( + ConventionalCommitParser, + ConventionalCommitParserOptions, ) from semantic_release.commit_parser.token import ParsedCommit, ParseError from semantic_release.enums import LevelBump @@ -34,11 +34,11 @@ "commit_message", ["", "feat(parser\n): Add new parser pattern"] ) def test_parser_raises_unknown_message_style( - default_angular_parser: AngularCommitParser, + default_conventional_parser: ConventionalCommitParser, make_commit_obj: MakeCommitObjFn, commit_message: str, ): - parsed_results = default_angular_parser.parse(make_commit_obj(commit_message)) + parsed_results = default_conventional_parser.parse(make_commit_obj(commit_message)) assert isinstance(parsed_results, Iterable) for result in parsed_results: assert isinstance(result, ParseError) @@ -172,16 +172,16 @@ def test_parser_raises_unknown_message_style( ], ) def test_parser_squashed_commit_bitbucket_squash_style( - default_angular_parser: AngularCommitParser, + default_conventional_parser: ConventionalCommitParser, make_commit_obj: MakeCommitObjFn, commit_message: str, expected_commit_details: Sequence[dict | None], ): # Setup: Enable squash commit parsing - parser = AngularCommitParser( - options=AngularParserOptions( + parser = ConventionalCommitParser( + options=ConventionalCommitParserOptions( **{ - **default_angular_parser.options.__dict__, + **default_conventional_parser.options.__dict__, "parse_squash_commits": True, } ) @@ -359,16 +359,16 @@ def test_parser_squashed_commit_bitbucket_squash_style( ], ) def test_parser_squashed_commit_git_squash_style( - default_angular_parser: AngularCommitParser, + default_conventional_parser: ConventionalCommitParser, make_commit_obj: MakeCommitObjFn, commit_message: str, expected_commit_details: Sequence[dict | None], ): # Setup: Enable squash commit parsing - parser = AngularCommitParser( - options=AngularParserOptions( + parser = ConventionalCommitParser( + options=ConventionalCommitParserOptions( **{ - **default_angular_parser.options.__dict__, + **default_conventional_parser.options.__dict__, "parse_squash_commits": True, } ) @@ -526,16 +526,16 @@ def test_parser_squashed_commit_git_squash_style( ], ) def test_parser_squashed_commit_github_squash_style( - default_angular_parser: AngularCommitParser, + default_conventional_parser: ConventionalCommitParser, make_commit_obj: MakeCommitObjFn, commit_message: str, expected_commit_details: Sequence[dict | None], ): # Setup: Enable squash commit parsing - parser = AngularCommitParser( - options=AngularParserOptions( + parser = ConventionalCommitParser( + options=ConventionalCommitParserOptions( **{ - **default_angular_parser.options.__dict__, + **default_conventional_parser.options.__dict__, "parse_squash_commits": True, } ) @@ -587,20 +587,20 @@ def test_parser_squashed_commit_github_squash_style( LevelBump.MAJOR, ), ("feat(parser): add emoji parser", LevelBump.MINOR), - ("fix(parser): fix regex in angular parser", LevelBump.PATCH), - ("test(parser): add a test for angular parser", LevelBump.NO_RELEASE), + ("fix(parser): fix regex in conventional parser", LevelBump.PATCH), + ("test(parser): add a test for conventional parser", LevelBump.NO_RELEASE), ("feat(parser)!: edit data parsing stuff", LevelBump.MAJOR), ("fix!: edit data parsing stuff again", LevelBump.MAJOR), ("fix: superfix", LevelBump.PATCH), ], ) def test_parser_returns_correct_bump_level( - default_angular_parser: AngularCommitParser, + default_conventional_parser: ConventionalCommitParser, commit_message: str, bump: LevelBump, make_commit_obj: MakeCommitObjFn, ): - parsed_results = default_angular_parser.parse(make_commit_obj(commit_message)) + parsed_results = default_conventional_parser.parse(make_commit_obj(commit_message)) assert isinstance(parsed_results, Iterable) assert len(parsed_results) == 1 @@ -623,12 +623,12 @@ def test_parser_returns_correct_bump_level( ], ) def test_parser_return_type_from_commit_message( - default_angular_parser: AngularCommitParser, + default_conventional_parser: ConventionalCommitParser, message: str, type_: str, make_commit_obj: MakeCommitObjFn, ): - parsed_results = default_angular_parser.parse(make_commit_obj(message)) + parsed_results = default_conventional_parser.parse(make_commit_obj(message)) assert isinstance(parsed_results, Iterable) assert len(parsed_results) == 1 @@ -653,12 +653,12 @@ def test_parser_return_type_from_commit_message( ], ) def test_parser_return_scope_from_commit_message( - default_angular_parser: AngularCommitParser, + default_conventional_parser: ConventionalCommitParser, message: str, scope: str, make_commit_obj: MakeCommitObjFn, ): - parsed_results = default_angular_parser.parse(make_commit_obj(message)) + parsed_results = default_conventional_parser.parse(make_commit_obj(message)) assert isinstance(parsed_results, Iterable) assert len(parsed_results) == 1 @@ -679,10 +679,13 @@ def test_parser_return_scope_from_commit_message( "message, descriptions", [ ("feat(parser): add emoji parser", ["add emoji parser"]), - ("fix(parser): fix regex in angular parser", ["fix regex in angular parser"]), ( - "test(parser): add a test for angular parser", - ["add a test for angular parser"], + "fix(parser): fix regex in conventional parser", + ["fix regex in conventional parser"], + ), + ( + "test(parser): add a test for conventional parser", + ["add a test for conventional parser"], ), ( f"fix(tox): fix env \n\n{_long_text}\n\n{_footer}", @@ -692,12 +695,12 @@ def test_parser_return_scope_from_commit_message( ], ) def test_parser_return_subject_from_commit_message( - default_angular_parser: AngularCommitParser, + default_conventional_parser: ConventionalCommitParser, message: str, descriptions: list[str], make_commit_obj: MakeCommitObjFn, ): - parsed_results = default_angular_parser.parse(make_commit_obj(message)) + parsed_results = default_conventional_parser.parse(make_commit_obj(message)) assert isinstance(parsed_results, Iterable) assert len(parsed_results) == 1 @@ -719,8 +722,8 @@ def test_parser_return_subject_from_commit_message( ), # GitLab style ( - "fix(parser): fix regex in angular parser (!456)", - "fix regex in angular parser (!456)", + "fix(parser): fix regex in conventional parser (!456)", + "fix regex in conventional parser (!456)", "!456", ), # BitBucket style @@ -738,13 +741,13 @@ def test_parser_return_subject_from_commit_message( ], ) def test_parser_return_linked_merge_request_from_commit_message( - default_angular_parser: AngularCommitParser, + default_conventional_parser: ConventionalCommitParser, message: str, subject: str, merge_request_number: str, make_commit_obj: MakeCommitObjFn, ): - parsed_results = default_angular_parser.parse(make_commit_obj(message)) + parsed_results = default_conventional_parser.parse(make_commit_obj(message)) assert isinstance(parsed_results, Iterable) assert len(parsed_results) == 1 @@ -1029,12 +1032,12 @@ def test_parser_return_linked_merge_request_from_commit_message( ], ) def test_parser_return_linked_issues_from_commit_message( - default_angular_parser: AngularCommitParser, + default_conventional_parser: ConventionalCommitParser, message: str, linked_issues: Sequence[str], make_commit_obj: MakeCommitObjFn, ): - parsed_results = default_angular_parser.parse(make_commit_obj(message)) + parsed_results = default_conventional_parser.parse(make_commit_obj(message)) assert isinstance(parsed_results, Iterable) assert len(parsed_results) == 1 @@ -1057,7 +1060,7 @@ def test_parser_return_linked_issues_from_commit_message( "single notice", dedent( """\ - fix(parser): fix regex in angular parser + fix(parser): fix regex in conventional parser NOTICE: This is a notice """ @@ -1068,7 +1071,7 @@ def test_parser_return_linked_issues_from_commit_message( "multiline notice", dedent( """\ - fix(parser): fix regex in angular parser + fix(parser): fix regex in conventional parser NOTICE: This is a notice that is longer than other notices @@ -1080,7 +1083,7 @@ def test_parser_return_linked_issues_from_commit_message( "multiple notices", dedent( """\ - fix(parser): fix regex in angular parser + fix(parser): fix regex in conventional parser NOTICE: This is a notice @@ -1093,7 +1096,7 @@ def test_parser_return_linked_issues_from_commit_message( "notice with other footer", dedent( """\ - fix(parser): fix regex in angular parser + fix(parser): fix regex in conventional parser BREAKING CHANGE: This is a breaking change @@ -1106,12 +1109,12 @@ def test_parser_return_linked_issues_from_commit_message( ], ) def test_parser_return_release_notices_from_commit_message( - default_angular_parser: AngularCommitParser, + default_conventional_parser: ConventionalCommitParser, message: str, notices: Sequence[str], make_commit_obj: MakeCommitObjFn, ): - parsed_results = default_angular_parser.parse(make_commit_obj(message)) + parsed_results = default_conventional_parser.parse(make_commit_obj(message)) assert isinstance(parsed_results, Iterable) assert len(parsed_results) == 1 @@ -1130,9 +1133,9 @@ def test_parser_return_release_notices_from_commit_message( # test custom parser options # ############################## def test_parser_custom_default_level(make_commit_obj: MakeCommitObjFn): - options = AngularParserOptions(default_bump_level=LevelBump.MINOR) - parsed_results = AngularCommitParser(options).parse( - make_commit_obj("test(parser): add a test for angular parser") + options = ConventionalCommitParserOptions(default_bump_level=LevelBump.MINOR) + parsed_results = ConventionalCommitParser(options).parse( + make_commit_obj("test(parser): add a test for conventional parser") ) assert isinstance(parsed_results, Iterable) @@ -1143,13 +1146,13 @@ def test_parser_custom_default_level(make_commit_obj: MakeCommitObjFn): def test_parser_custom_allowed_types( - default_angular_parser: AngularCommitParser, + default_conventional_parser: ConventionalCommitParser, make_commit_obj: MakeCommitObjFn, ): new_tag = "custom" - custom_allowed_tags = [*default_angular_parser.options.allowed_tags, new_tag] - parser = AngularCommitParser( - options=AngularParserOptions( + custom_allowed_tags = [*default_conventional_parser.options.allowed_tags, new_tag] + parser = ConventionalCommitParser( + options=ConventionalCommitParserOptions( allowed_tags=tuple(custom_allowed_tags), ) ) @@ -1169,14 +1172,15 @@ def test_parser_custom_allowed_types( def test_parser_custom_allowed_types_ignores_non_types( - default_angular_parser: AngularCommitParser, make_commit_obj: MakeCommitObjFn + default_conventional_parser: ConventionalCommitParser, + make_commit_obj: MakeCommitObjFn, ): banned_tag = "feat" - custom_allowed_tags = [*default_angular_parser.options.allowed_tags] + custom_allowed_tags = [*default_conventional_parser.options.allowed_tags] custom_allowed_tags.remove(banned_tag) - parser = AngularCommitParser( - options=AngularParserOptions( + parser = ConventionalCommitParser( + options=ConventionalCommitParserOptions( allowed_tags=tuple(custom_allowed_tags), ) ) @@ -1190,8 +1194,8 @@ def test_parser_custom_allowed_types_ignores_non_types( def test_parser_custom_minor_tags(make_commit_obj: MakeCommitObjFn): custom_minor_tag = "docs" - parser = AngularCommitParser( - options=AngularParserOptions(minor_tags=(custom_minor_tag,)) + parser = ConventionalCommitParser( + options=ConventionalCommitParserOptions(minor_tags=(custom_minor_tag,)) ) parsed_results = parser.parse(make_commit_obj(f"{custom_minor_tag}: ...")) @@ -1204,8 +1208,8 @@ def test_parser_custom_minor_tags(make_commit_obj: MakeCommitObjFn): def test_parser_custom_patch_tags(make_commit_obj: MakeCommitObjFn): custom_patch_tag = "test" - parser = AngularCommitParser( - options=AngularParserOptions(patch_tags=(custom_patch_tag,)) + parser = ConventionalCommitParser( + options=ConventionalCommitParserOptions(patch_tags=(custom_patch_tag,)) ) parsed_results = parser.parse(make_commit_obj(f"{custom_patch_tag}: ...")) @@ -1217,14 +1221,14 @@ def test_parser_custom_patch_tags(make_commit_obj: MakeCommitObjFn): def test_parser_ignore_merge_commit( - default_angular_parser: AngularCommitParser, + default_conventional_parser: ConventionalCommitParser, make_commit_obj: MakeCommitObjFn, ): # Setup: Enable parsing of linked issues - parser = AngularCommitParser( - options=AngularParserOptions( + parser = ConventionalCommitParser( + options=ConventionalCommitParserOptions( **{ - **default_angular_parser.options.__dict__, + **default_conventional_parser.options.__dict__, "ignore_merge_commits": True, } ) diff --git a/tests/unit/semantic_release/commit_parser/test_emoji.py b/tests/unit/semantic_release/commit_parser/test_emoji.py index 84f390773..ec2d83a3e 100644 --- a/tests/unit/semantic_release/commit_parser/test_emoji.py +++ b/tests/unit/semantic_release/commit_parser/test_emoji.py @@ -448,7 +448,7 @@ def test_parser_return_linked_issues_from_commit_message( "single notice", dedent( """\ - :bug:(parser): fix regex in angular parser + :bug:(parser): fix regex in emoji parser NOTICE: This is a notice """ @@ -459,7 +459,7 @@ def test_parser_return_linked_issues_from_commit_message( "multiline notice", dedent( """\ - :bug:(parser): fix regex in angular parser + :bug:(parser): fix regex in emoji parser NOTICE: This is a notice that is longer than other notices @@ -471,7 +471,7 @@ def test_parser_return_linked_issues_from_commit_message( "multiple notices", dedent( """\ - :bug:(parser): fix regex in angular parser + :bug:(parser): fix regex in emoji parser NOTICE: This is a notice @@ -484,7 +484,7 @@ def test_parser_return_linked_issues_from_commit_message( "notice with other footer", dedent( """\ - :bug:(parser): fix regex in angular parser + :bug:(parser): fix regex in emoji parser BREAKING CHANGE: This is a breaking change diff --git a/tests/unit/semantic_release/commit_parser/test_scipy.py b/tests/unit/semantic_release/commit_parser/test_scipy.py index a48fc418a..2c15fca6f 100644 --- a/tests/unit/semantic_release/commit_parser/test_scipy.py +++ b/tests/unit/semantic_release/commit_parser/test_scipy.py @@ -1044,7 +1044,7 @@ def test_parser_return_linked_issues_from_commit_message( "single notice", dedent( """\ - BUG(parser): fix regex in angular parser + BUG(parser): fix regex in scipy parser NOTICE: This is a notice """ @@ -1055,7 +1055,7 @@ def test_parser_return_linked_issues_from_commit_message( "multiline notice", dedent( """\ - BUG(parser): fix regex in angular parser + BUG(parser): fix regex in scipy parser NOTICE: This is a notice that is longer than other notices @@ -1067,7 +1067,7 @@ def test_parser_return_linked_issues_from_commit_message( "multiple notices", dedent( """\ - BUG(parser): fix regex in angular parser + BUG(parser): fix regex in scipy parser NOTICE: This is a notice @@ -1080,7 +1080,7 @@ def test_parser_return_linked_issues_from_commit_message( "notice with other footer", dedent( """\ - BUG(parser): fix regex in angular parser + BUG(parser): fix regex in scipy parser BREAKING CHANGE: This is a breaking change diff --git a/tests/util.py b/tests/util.py index 97dc18b5c..63d7679ac 100644 --- a/tests/util.py +++ b/tests/util.py @@ -17,7 +17,7 @@ from semantic_release.changelog.context import ChangelogMode, make_changelog_context from semantic_release.changelog.release_history import ReleaseHistory from semantic_release.commit_parser._base import CommitParser, ParserOptions -from semantic_release.commit_parser.angular import AngularCommitParser +from semantic_release.commit_parser.conventional import ConventionalCommitParser from semantic_release.commit_parser.token import ( ParsedCommit, ParsedMessageResult, @@ -289,7 +289,7 @@ class IncompleteCustomParser(CommitParser): pass -class CustomAngularParserWithIgnorePatterns(AngularCommitParser): +class CustomConventionalParserWithIgnorePatterns(ConventionalCommitParser): def parse(self, commit: Commit) -> ParsedCommit | ParseError: if not (parse_msg_result := super().parse_message(str(commit.message))): return ParseError(commit, "Unable to parse commit") From 212683d1d33a85146b33a7add4c29893df579fb2 Mon Sep 17 00:00:00 2001 From: semantic-release Date: Mon, 10 Feb 2025 03:53:50 +0000 Subject: [PATCH 05/15] 9.19.0 Automatically generated by python-semantic-release --- CHANGELOG.rst | 27 ++++++++++++++++++++++ docs/automatic-releases/github-actions.rst | 14 +++++------ docs/commit_parsing.rst | 6 ++--- docs/configuration.rst | 4 ++-- pyproject.toml | 2 +- src/semantic_release/__init__.py | 2 +- 6 files changed, 41 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fb1e8ebfb..303e0d149 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,33 @@ CHANGELOG ========= +.. _changelog-v9.19.0: + +v9.19.0 (2025-02-10) +==================== + +✨ Features +----------- + +* **parser-conventional**: Add official ``conventional-commits`` parser (`PR#1177`_, `27ddf84`_) + +📖 Documentation +---------------- + +* Update references to Angular parser to Conventional Commit Parser (`PR#1177`_, `27ddf84`_) + +💡 ADDITIONAL RELEASE INFORMATION +--------------------------------- + +* **parser-conventional**: The 'angular' commit parser has been renamed to 'conventional' to match + the official conventional-commits standard for which the 'angular' parser has evolved into. Please + update your configurations to specify 'conventional' as the 'commit_parser' value in place of + 'angular'. The 'angular' type will be removed in v11. + +.. _27ddf84: https://github.com/python-semantic-release/python-semantic-release/commit/27ddf840f8c812361c60bac9cf0b110d401f33d6 +.. _PR#1177: https://github.com/python-semantic-release/python-semantic-release/pull/1177 + + .. _changelog-v9.18.1: v9.18.1 (2025-02-08) diff --git a/docs/automatic-releases/github-actions.rst b/docs/automatic-releases/github-actions.rst index c8cfd4098..2ea4ba2ff 100644 --- a/docs/automatic-releases/github-actions.rst +++ b/docs/automatic-releases/github-actions.rst @@ -337,7 +337,7 @@ before the :ref:`version ` subcommand. .. code:: yaml - - uses: python-semantic-release/python-semantic-release@v9.18.1 + - uses: python-semantic-release/python-semantic-release@v9.19.0 with: root_options: "-vv --noop" @@ -576,7 +576,7 @@ before the :ref:`publish ` subcommand. .. code:: yaml - - uses: python-semantic-release/publish-action@v9.18.1 + - uses: python-semantic-release/publish-action@v9.19.0 with: root_options: "-vv --noop" @@ -684,7 +684,7 @@ to the GitHub Release Assets as well. - name: Action | Semantic Version Release id: release # Adjust tag with desired version if applicable. - uses: python-semantic-release/python-semantic-release@v9.18.1 + uses: python-semantic-release/python-semantic-release@v9.19.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} git_committer_name: "github-actions" @@ -695,7 +695,7 @@ to the GitHub Release Assets as well. if: steps.release.outputs.released == 'true' - name: Publish | Upload to GitHub Release Assets - uses: python-semantic-release/publish-action@v9.18.1 + uses: python-semantic-release/publish-action@v9.19.0 if: steps.release.outputs.released == 'true' with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -744,7 +744,7 @@ The equivalent GitHub Action configuration would be: - name: Action | Semantic Version Release # Adjust tag with desired version if applicable. - uses: python-semantic-release/python-semantic-release@v9.18.1 + uses: python-semantic-release/python-semantic-release@v9.19.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} force: patch @@ -772,13 +772,13 @@ Publish Action. .. code:: yaml - name: Release Project 1 - uses: python-semantic-release/python-semantic-release@v9.18.1 + uses: python-semantic-release/python-semantic-release@v9.19.0 with: directory: ./project1 github_token: ${{ secrets.GITHUB_TOKEN }} - name: Release Project 2 - uses: python-semantic-release/python-semantic-release@v9.18.1 + uses: python-semantic-release/python-semantic-release@v9.19.0 with: directory: ./project2 github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/commit_parsing.rst b/docs/commit_parsing.rst index 30cdf32b1..25e70eb45 100644 --- a/docs/commit_parsing.rst +++ b/docs/commit_parsing.rst @@ -49,7 +49,7 @@ Built-in Commit Parsers The following parsers are built in to Python Semantic Release: - :ref:`ConventionalCommitParser ` -- :ref:`AngularCommitParser ` *(deprecated in ${NEW_RELEASE_TAG})* +- :ref:`AngularCommitParser ` *(deprecated in v9.19.0)* - :ref:`EmojiCommitParser ` - :ref:`ScipyCommitParser ` - :ref:`TagCommitParser ` *(deprecated in v9.12.0)* @@ -61,7 +61,7 @@ The following parsers are built in to Python Semantic Release: Conventional Commits Parser """"""""""""""""""""""""""" -*Introduced in ${NEW_RELEASE_TAG}* +*Introduced in v9.19.0* A parser that is designed to parse commits formatted according to the `Conventional Commits Specification`_. The parser is implemented with the following @@ -140,7 +140,7 @@ Angular Commit Parser """"""""""""""""""""" .. warning:: - This parser was deprecated in ``${NEW_RELEASE_TAG}``. It will be removed in a future release. + This parser was deprecated in ``v9.19.0``. It will be removed in a future release. This parser is being replaced by the :ref:`commit_parser-builtin-conventional`. A parser that is designed to parse commits formatted according to the diff --git a/docs/configuration.rst b/docs/configuration.rst index 35a3b821f..9163f11d8 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -790,8 +790,8 @@ Specify which commit parser Python Semantic Release should use to parse the comm within the Git repository. Built-in parsers: - * ``angular`` - :ref:`AngularCommitParser ` *(deprecated in ${NEW_RELEASE_TAG})* - * ``conventional`` - :ref:`ConventionalCommitParser ` *(available in ${NEW_RELEASE_TAG}+)* + * ``angular`` - :ref:`AngularCommitParser ` *(deprecated in v9.19.0)* + * ``conventional`` - :ref:`ConventionalCommitParser ` *(available in v9.19.0+)* * ``emoji`` - :ref:`EmojiCommitParser ` * ``scipy`` - :ref:`ScipyCommitParser ` * ``tag`` - :ref:`TagCommitParser ` *(deprecated in v9.12.0)* diff --git a/pyproject.toml b/pyproject.toml index 5666b1a86..31eef872b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "python-semantic-release" -version = "9.18.1" +version = "9.19.0" description = "Automatic Semantic Versioning for Python projects" requires-python = ">=3.8" license = { text = "MIT" } diff --git a/src/semantic_release/__init__.py b/src/semantic_release/__init__.py index 9e823e6de..790c3034f 100644 --- a/src/semantic_release/__init__.py +++ b/src/semantic_release/__init__.py @@ -24,7 +24,7 @@ tags_and_versions, ) -__version__ = "9.18.1" +__version__ = "9.19.0" __all__ = [ "CommitParser", From d25c19f4f48150a177b1ddc812cfe886819e9663 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Sun, 9 Feb 2025 21:00:38 -0700 Subject: [PATCH 06/15] Revert "9.19.0" This reverts commit 212683d1d33a85146b33a7add4c29893df579fb2. Revert commit because release & deploy process failed in CI. Must revert. --- CHANGELOG.rst | 27 ---------------------- docs/automatic-releases/github-actions.rst | 14 +++++------ docs/commit_parsing.rst | 6 ++--- docs/configuration.rst | 4 ++-- pyproject.toml | 4 ++-- src/semantic_release/__init__.py | 2 +- 6 files changed, 15 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 303e0d149..fb1e8ebfb 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,33 +4,6 @@ CHANGELOG ========= -.. _changelog-v9.19.0: - -v9.19.0 (2025-02-10) -==================== - -✨ Features ------------ - -* **parser-conventional**: Add official ``conventional-commits`` parser (`PR#1177`_, `27ddf84`_) - -📖 Documentation ----------------- - -* Update references to Angular parser to Conventional Commit Parser (`PR#1177`_, `27ddf84`_) - -💡 ADDITIONAL RELEASE INFORMATION ---------------------------------- - -* **parser-conventional**: The 'angular' commit parser has been renamed to 'conventional' to match - the official conventional-commits standard for which the 'angular' parser has evolved into. Please - update your configurations to specify 'conventional' as the 'commit_parser' value in place of - 'angular'. The 'angular' type will be removed in v11. - -.. _27ddf84: https://github.com/python-semantic-release/python-semantic-release/commit/27ddf840f8c812361c60bac9cf0b110d401f33d6 -.. _PR#1177: https://github.com/python-semantic-release/python-semantic-release/pull/1177 - - .. _changelog-v9.18.1: v9.18.1 (2025-02-08) diff --git a/docs/automatic-releases/github-actions.rst b/docs/automatic-releases/github-actions.rst index 2ea4ba2ff..c8cfd4098 100644 --- a/docs/automatic-releases/github-actions.rst +++ b/docs/automatic-releases/github-actions.rst @@ -337,7 +337,7 @@ before the :ref:`version ` subcommand. .. code:: yaml - - uses: python-semantic-release/python-semantic-release@v9.19.0 + - uses: python-semantic-release/python-semantic-release@v9.18.1 with: root_options: "-vv --noop" @@ -576,7 +576,7 @@ before the :ref:`publish ` subcommand. .. code:: yaml - - uses: python-semantic-release/publish-action@v9.19.0 + - uses: python-semantic-release/publish-action@v9.18.1 with: root_options: "-vv --noop" @@ -684,7 +684,7 @@ to the GitHub Release Assets as well. - name: Action | Semantic Version Release id: release # Adjust tag with desired version if applicable. - uses: python-semantic-release/python-semantic-release@v9.19.0 + uses: python-semantic-release/python-semantic-release@v9.18.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} git_committer_name: "github-actions" @@ -695,7 +695,7 @@ to the GitHub Release Assets as well. if: steps.release.outputs.released == 'true' - name: Publish | Upload to GitHub Release Assets - uses: python-semantic-release/publish-action@v9.19.0 + uses: python-semantic-release/publish-action@v9.18.1 if: steps.release.outputs.released == 'true' with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -744,7 +744,7 @@ The equivalent GitHub Action configuration would be: - name: Action | Semantic Version Release # Adjust tag with desired version if applicable. - uses: python-semantic-release/python-semantic-release@v9.19.0 + uses: python-semantic-release/python-semantic-release@v9.18.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} force: patch @@ -772,13 +772,13 @@ Publish Action. .. code:: yaml - name: Release Project 1 - uses: python-semantic-release/python-semantic-release@v9.19.0 + uses: python-semantic-release/python-semantic-release@v9.18.1 with: directory: ./project1 github_token: ${{ secrets.GITHUB_TOKEN }} - name: Release Project 2 - uses: python-semantic-release/python-semantic-release@v9.19.0 + uses: python-semantic-release/python-semantic-release@v9.18.1 with: directory: ./project2 github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/commit_parsing.rst b/docs/commit_parsing.rst index 25e70eb45..30cdf32b1 100644 --- a/docs/commit_parsing.rst +++ b/docs/commit_parsing.rst @@ -49,7 +49,7 @@ Built-in Commit Parsers The following parsers are built in to Python Semantic Release: - :ref:`ConventionalCommitParser ` -- :ref:`AngularCommitParser ` *(deprecated in v9.19.0)* +- :ref:`AngularCommitParser ` *(deprecated in ${NEW_RELEASE_TAG})* - :ref:`EmojiCommitParser ` - :ref:`ScipyCommitParser ` - :ref:`TagCommitParser ` *(deprecated in v9.12.0)* @@ -61,7 +61,7 @@ The following parsers are built in to Python Semantic Release: Conventional Commits Parser """"""""""""""""""""""""""" -*Introduced in v9.19.0* +*Introduced in ${NEW_RELEASE_TAG}* A parser that is designed to parse commits formatted according to the `Conventional Commits Specification`_. The parser is implemented with the following @@ -140,7 +140,7 @@ Angular Commit Parser """"""""""""""""""""" .. warning:: - This parser was deprecated in ``v9.19.0``. It will be removed in a future release. + This parser was deprecated in ``${NEW_RELEASE_TAG}``. It will be removed in a future release. This parser is being replaced by the :ref:`commit_parser-builtin-conventional`. A parser that is designed to parse commits formatted according to the diff --git a/docs/configuration.rst b/docs/configuration.rst index 9163f11d8..35a3b821f 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -790,8 +790,8 @@ Specify which commit parser Python Semantic Release should use to parse the comm within the Git repository. Built-in parsers: - * ``angular`` - :ref:`AngularCommitParser ` *(deprecated in v9.19.0)* - * ``conventional`` - :ref:`ConventionalCommitParser ` *(available in v9.19.0+)* + * ``angular`` - :ref:`AngularCommitParser ` *(deprecated in ${NEW_RELEASE_TAG})* + * ``conventional`` - :ref:`ConventionalCommitParser ` *(available in ${NEW_RELEASE_TAG}+)* * ``emoji`` - :ref:`EmojiCommitParser ` * ``scipy`` - :ref:`ScipyCommitParser ` * ``tag`` - :ref:`TagCommitParser ` *(deprecated in v9.12.0)* diff --git a/pyproject.toml b/pyproject.toml index 31eef872b..65aa99d94 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "python-semantic-release" -version = "9.19.0" +version = "9.18.1" description = "Automatic Semantic Versioning for Python projects" requires-python = ">=3.8" license = { text = "MIT" } @@ -398,7 +398,7 @@ ignore_names = ["change_to_ex_proj_dir", "init_example_project"] [tool.semantic_release] logging_use_named_masks = true -commit_parser = "conventional" +commit_parser = "angular" commit_parser_options = { parse_squash_commits = true, ignore_merge_commits = true } build_command = """ python -m pip install -e .[build] diff --git a/src/semantic_release/__init__.py b/src/semantic_release/__init__.py index 790c3034f..9e823e6de 100644 --- a/src/semantic_release/__init__.py +++ b/src/semantic_release/__init__.py @@ -24,7 +24,7 @@ tags_and_versions, ) -__version__ = "9.19.0" +__version__ = "9.18.1" __all__ = [ "CommitParser", From c02663855a94e46eb021441cd6fb85beb25abdf7 Mon Sep 17 00:00:00 2001 From: semantic-release Date: Mon, 10 Feb 2025 04:17:42 +0000 Subject: [PATCH 07/15] 9.19.0 Automatically generated by python-semantic-release --- CHANGELOG.rst | 27 ++++++++++++++++++++++ docs/automatic-releases/github-actions.rst | 14 +++++------ docs/commit_parsing.rst | 6 ++--- docs/configuration.rst | 4 ++-- pyproject.toml | 2 +- src/semantic_release/__init__.py | 2 +- 6 files changed, 41 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fb1e8ebfb..303e0d149 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,33 @@ CHANGELOG ========= +.. _changelog-v9.19.0: + +v9.19.0 (2025-02-10) +==================== + +✨ Features +----------- + +* **parser-conventional**: Add official ``conventional-commits`` parser (`PR#1177`_, `27ddf84`_) + +📖 Documentation +---------------- + +* Update references to Angular parser to Conventional Commit Parser (`PR#1177`_, `27ddf84`_) + +💡 ADDITIONAL RELEASE INFORMATION +--------------------------------- + +* **parser-conventional**: The 'angular' commit parser has been renamed to 'conventional' to match + the official conventional-commits standard for which the 'angular' parser has evolved into. Please + update your configurations to specify 'conventional' as the 'commit_parser' value in place of + 'angular'. The 'angular' type will be removed in v11. + +.. _27ddf84: https://github.com/python-semantic-release/python-semantic-release/commit/27ddf840f8c812361c60bac9cf0b110d401f33d6 +.. _PR#1177: https://github.com/python-semantic-release/python-semantic-release/pull/1177 + + .. _changelog-v9.18.1: v9.18.1 (2025-02-08) diff --git a/docs/automatic-releases/github-actions.rst b/docs/automatic-releases/github-actions.rst index c8cfd4098..2ea4ba2ff 100644 --- a/docs/automatic-releases/github-actions.rst +++ b/docs/automatic-releases/github-actions.rst @@ -337,7 +337,7 @@ before the :ref:`version ` subcommand. .. code:: yaml - - uses: python-semantic-release/python-semantic-release@v9.18.1 + - uses: python-semantic-release/python-semantic-release@v9.19.0 with: root_options: "-vv --noop" @@ -576,7 +576,7 @@ before the :ref:`publish ` subcommand. .. code:: yaml - - uses: python-semantic-release/publish-action@v9.18.1 + - uses: python-semantic-release/publish-action@v9.19.0 with: root_options: "-vv --noop" @@ -684,7 +684,7 @@ to the GitHub Release Assets as well. - name: Action | Semantic Version Release id: release # Adjust tag with desired version if applicable. - uses: python-semantic-release/python-semantic-release@v9.18.1 + uses: python-semantic-release/python-semantic-release@v9.19.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} git_committer_name: "github-actions" @@ -695,7 +695,7 @@ to the GitHub Release Assets as well. if: steps.release.outputs.released == 'true' - name: Publish | Upload to GitHub Release Assets - uses: python-semantic-release/publish-action@v9.18.1 + uses: python-semantic-release/publish-action@v9.19.0 if: steps.release.outputs.released == 'true' with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -744,7 +744,7 @@ The equivalent GitHub Action configuration would be: - name: Action | Semantic Version Release # Adjust tag with desired version if applicable. - uses: python-semantic-release/python-semantic-release@v9.18.1 + uses: python-semantic-release/python-semantic-release@v9.19.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} force: patch @@ -772,13 +772,13 @@ Publish Action. .. code:: yaml - name: Release Project 1 - uses: python-semantic-release/python-semantic-release@v9.18.1 + uses: python-semantic-release/python-semantic-release@v9.19.0 with: directory: ./project1 github_token: ${{ secrets.GITHUB_TOKEN }} - name: Release Project 2 - uses: python-semantic-release/python-semantic-release@v9.18.1 + uses: python-semantic-release/python-semantic-release@v9.19.0 with: directory: ./project2 github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/commit_parsing.rst b/docs/commit_parsing.rst index 30cdf32b1..25e70eb45 100644 --- a/docs/commit_parsing.rst +++ b/docs/commit_parsing.rst @@ -49,7 +49,7 @@ Built-in Commit Parsers The following parsers are built in to Python Semantic Release: - :ref:`ConventionalCommitParser ` -- :ref:`AngularCommitParser ` *(deprecated in ${NEW_RELEASE_TAG})* +- :ref:`AngularCommitParser ` *(deprecated in v9.19.0)* - :ref:`EmojiCommitParser ` - :ref:`ScipyCommitParser ` - :ref:`TagCommitParser ` *(deprecated in v9.12.0)* @@ -61,7 +61,7 @@ The following parsers are built in to Python Semantic Release: Conventional Commits Parser """"""""""""""""""""""""""" -*Introduced in ${NEW_RELEASE_TAG}* +*Introduced in v9.19.0* A parser that is designed to parse commits formatted according to the `Conventional Commits Specification`_. The parser is implemented with the following @@ -140,7 +140,7 @@ Angular Commit Parser """"""""""""""""""""" .. warning:: - This parser was deprecated in ``${NEW_RELEASE_TAG}``. It will be removed in a future release. + This parser was deprecated in ``v9.19.0``. It will be removed in a future release. This parser is being replaced by the :ref:`commit_parser-builtin-conventional`. A parser that is designed to parse commits formatted according to the diff --git a/docs/configuration.rst b/docs/configuration.rst index 35a3b821f..9163f11d8 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -790,8 +790,8 @@ Specify which commit parser Python Semantic Release should use to parse the comm within the Git repository. Built-in parsers: - * ``angular`` - :ref:`AngularCommitParser ` *(deprecated in ${NEW_RELEASE_TAG})* - * ``conventional`` - :ref:`ConventionalCommitParser ` *(available in ${NEW_RELEASE_TAG}+)* + * ``angular`` - :ref:`AngularCommitParser ` *(deprecated in v9.19.0)* + * ``conventional`` - :ref:`ConventionalCommitParser ` *(available in v9.19.0+)* * ``emoji`` - :ref:`EmojiCommitParser ` * ``scipy`` - :ref:`ScipyCommitParser ` * ``tag`` - :ref:`TagCommitParser ` *(deprecated in v9.12.0)* diff --git a/pyproject.toml b/pyproject.toml index 65aa99d94..ee97f49ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "python-semantic-release" -version = "9.18.1" +version = "9.19.0" description = "Automatic Semantic Versioning for Python projects" requires-python = ">=3.8" license = { text = "MIT" } diff --git a/src/semantic_release/__init__.py b/src/semantic_release/__init__.py index 9e823e6de..790c3034f 100644 --- a/src/semantic_release/__init__.py +++ b/src/semantic_release/__init__.py @@ -24,7 +24,7 @@ tags_and_versions, ) -__version__ = "9.18.1" +__version__ = "9.19.0" __all__ = [ "CommitParser", From 9ca7fe2cf5b72151c7e36433bb7949a947e323ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 9 Feb 2025 22:26:38 -0700 Subject: [PATCH 08/15] ci(deps): bump `python-semantic-release/publish-action@v9.18.1` to 9.19.0 (#1178) --- .github/workflows/cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 8ad586c6a..016c553a4 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -138,7 +138,7 @@ jobs: build: false - name: Release | Add distribution artifacts to GitHub Release Assets - uses: python-semantic-release/publish-action@v9.18.1 + uses: python-semantic-release/publish-action@v9.19.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ steps.release.outputs.tag }} From 249f37acc20a7334ff7a216b92b3970deabbae7a Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Sun, 9 Feb 2025 23:55:24 -0700 Subject: [PATCH 09/15] chore(config): change psr parser over to conventional-commits (#1179) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ee97f49ea..31eef872b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -398,7 +398,7 @@ ignore_names = ["change_to_ex_proj_dir", "init_example_project"] [tool.semantic_release] logging_use_named_masks = true -commit_parser = "angular" +commit_parser = "conventional" commit_parser_options = { parse_squash_commits = true, ignore_merge_commits = true } build_command = """ python -m pip install -e .[build] From ca42dbfffe54c2f2b96dae595012259a92893f38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 23:57:06 -0700 Subject: [PATCH 10/15] build(deps-dev): bump `mypy` from 1.14.1 to 1.15.0 (#1181) * chore(pre-commit): bump `mypy-plugin` from 1.14.0 to 1.15.0 --- .pre-commit-config.yaml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 70e871f44..f80f12a05 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -50,7 +50,7 @@ repos: name: ruff (format) - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v1.14.0" + rev: "v1.15.0" hooks: - id: mypy additional_dependencies: diff --git a/pyproject.toml b/pyproject.toml index 31eef872b..c6e99d898 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,7 +82,7 @@ dev = [ "ruff == 0.6.1" ] mypy = [ - "mypy == 1.14.1", + "mypy == 1.15.0", "types-requests ~= 2.32.0", "types-pyyaml ~= 6.0", ] From e8343eeb38d3b4e18953ac0f97538df396d22b76 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Sun, 6 Oct 2024 23:00:38 -0600 Subject: [PATCH 11/15] docs(automatic-releases): declutter the table of contents for automatic release guides --- docs/automatic-releases/index.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/automatic-releases/index.rst b/docs/automatic-releases/index.rst index 8fd44b1bf..c5e6d3453 100644 --- a/docs/automatic-releases/index.rst +++ b/docs/automatic-releases/index.rst @@ -13,6 +13,8 @@ Guides ^^^^^^ .. toctree:: + :maxdepth: 2 + travis github-actions cronjobs From 55d4a05ff56321cf9874f8f302fbe7e5163ad4f7 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Sun, 9 Feb 2025 20:48:33 -0700 Subject: [PATCH 12/15] docs: fix spelling errors & inaccurate descriptions --- CHANGELOG.rst | 34 +++++++++++++++++----------------- docs/algorithm.rst | 2 +- docs/changelog_templates.rst | 6 +++--- docs/commands.rst | 9 +++++---- docs/configuration.rst | 15 +++++++-------- docs/index.rst | 2 +- docs/multibranch_releases.rst | 6 +++--- docs/strict_mode.rst | 2 +- docs/troubleshooting.rst | 5 ++--- 9 files changed, 40 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 303e0d149..f2bc511ae 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -99,7 +99,7 @@ v9.18.0 (2025-02-06) * **vcs-github**: Add ``create_release_url`` & ``format_w_official_vcs_name`` filter functions (`PR#1161`_, `f853cf0`_) -* **vcs-gitlab**: Add ``create_release_url`` & ``format_w_official_vcs_name`` filter functiions +* **vcs-gitlab**: Add ``create_release_url`` & ``format_w_official_vcs_name`` filter functions (`PR#1161`_, `f853cf0`_) 🪲 Bug Fixes @@ -491,7 +491,7 @@ v9.14.0 (2024-11-11) 🪲 Bug Fixes ------------ -* **release-notes**: Override default wordwrap to non-wrap for in default template (`99ab99b`_) +* **release-notes**: Override default word-wrap to non-wrap for in default template (`99ab99b`_) 📖 Documentation ---------------- @@ -548,7 +548,7 @@ v9.13.0 (2024-11-10) * **parser-angular**: Drop the ``breaking`` category but still maintain a major level bump (`f1ffa54`_) -* **parsers**: Improve reliability of text unwordwrap of descriptions (`436374b`_) +* **parsers**: Improve reliability of descriptions after reverse word-wrap (`436374b`_) ⚡ Performance Improvements --------------------------- @@ -871,7 +871,7 @@ v9.9.0 (2024-09-28) 📖 Documentation ---------------- -* **automatic-releases**: Drop extrenous github push configuration (`PR#1011`_, `2135c68`_) +* **automatic-releases**: Drop extraneous github push configuration (`PR#1011`_, `2135c68`_) * **github-actions**: Add configuration & description of publish action (`PR#1011`_, `2135c68`_) @@ -1066,7 +1066,7 @@ v9.8.4 (2024-07-04) 🪲 Bug Fixes ------------ -* **changelog-cmd**: Remove usage strings when error occured, closes `#810`_ (`348a51d`_) +* **changelog-cmd**: Remove usage strings when error occurred, closes `#810`_ (`348a51d`_) * **changelog-cmd**: Render default changelog when user template directory exist but is empty (`bded8de`_) @@ -1077,7 +1077,7 @@ v9.8.4 (2024-07-04) * **publish-cmd**: Prevent error when provided tag does not exist locally (`16afbbb`_) -* **publish-cmd**: Remove usage strings when error occured, closes `#810`_ (`afbb187`_) +* **publish-cmd**: Remove usage strings when error occurred, closes `#810`_ (`afbb187`_) * **version-cmd**: Remove usage strings when error occurred, closes `#810`_ (`a7c17c7`_) @@ -1192,7 +1192,7 @@ v9.7.3 (2024-05-15) 🪲 Bug Fixes ------------ -* Enabled ``prelease-token`` parameter in github action (`PR#929`_, `1bb26b0`_) +* Enabled ``prerelease-token`` parameter in github action (`PR#929`_, `1bb26b0`_) .. _1bb26b0: https://github.com/python-semantic-release/python-semantic-release/commit/1bb26b0762d94efd97c06a3f1b6b10fb76901f6d .. _PR#929: https://github.com/python-semantic-release/python-semantic-release/pull/929 @@ -1705,7 +1705,7 @@ v8.7.1 (2024-01-03) 📖 Documentation ---------------- -* Add note on default envvar behaviour (`PR#780`_, `0b07cae`_) +* Add note on default envvar behavior (`PR#780`_, `0b07cae`_) * **configuration**: Change defaults definition of token default to table (`PR#786`_, `df1df0d`_) @@ -2034,7 +2034,7 @@ v8.0.3 (2023-07-21) 🪲 Bug Fixes ------------ -* Skip unparseable versions when calculating next version (`PR#649`_, `88f25ea`_) +* Skip non-parsable versions when calculating next version (`PR#649`_, `88f25ea`_) .. _88f25ea: https://github.com/python-semantic-release/python-semantic-release/commit/88f25eae62589cdf53dbc3dfcb167a3ae6cba2d3 .. _PR#649: https://github.com/python-semantic-release/python-semantic-release/pull/649 @@ -2105,7 +2105,7 @@ v8.0.0 (2023-07-16) * Make it easier to access commit messages in ParsedCommits (`PR#619`_, `ec30564`_) -* Remove publication of dists to artifact repository (`PR#619`_, `ec30564`_) +* Remove publication of ``dists/`` to artifact repository (`PR#619`_, `ec30564`_) * Rename 'upload' configuration section to 'publish' (`PR#619`_, `ec30564`_) @@ -2138,7 +2138,7 @@ v8.0.0 (2023-07-16) * Only call Github Action output callback once defaults are set (`PR#619`_, `ec30564`_) -* Remove commit amending behaviour (`PR#619`_, `ec30564`_) +* Remove commit amending behavior (`PR#619`_, `ec30564`_) * Resolve branch checkout logic in GHA (`PR#619`_, `ec30564`_) @@ -2405,7 +2405,7 @@ v7.33.0 (2023-01-15) 📖 Documentation ---------------- -* Update documentaton (`5cbdad2`_) +* Update documentation (`5cbdad2`_) .. _#521: https://github.com/python-semantic-release/python-semantic-release/issues/521 .. _#533: https://github.com/python-semantic-release/python-semantic-release/issues/533 @@ -2478,7 +2478,7 @@ v7.32.0 (2022-09-25) 📖 Documentation ---------------- -* Correct documented default behaviour for ``commit_version_number`` (`PR#497`_, `ffae2dc`_) +* Correct documented default behavior for ``commit_version_number`` (`PR#497`_, `ffae2dc`_) .. _#498: https://github.com/python-semantic-release/python-semantic-release/issues/498 .. _988437d: https://github.com/python-semantic-release/python-semantic-release/commit/988437d21e40d3e3b1c95ed66b535bdd523210de @@ -2796,7 +2796,7 @@ v7.27.1 (2022-04-03) 🪲 Bug Fixes ------------ -* **prerelase**: Pass prerelease option to get_current_version (`PR#432`_, `aabab0b`_) +* **prerelease**: Pass prerelease option to get_current_version (`PR#432`_, `aabab0b`_) .. _aabab0b: https://github.com/python-semantic-release/python-semantic-release/commit/aabab0b7ce647d25e0c78ae6566f1132ece9fcb9 .. _PR#432: https://github.com/python-semantic-release/python-semantic-release/pull/432 @@ -4079,7 +4079,7 @@ v5.0.0 (2020-03-22) 📖 Documentation ---------------- -* **pypi**: Update docstings in pypi.py (`6502d44`_) +* **pypi**: Update docstrings in pypi.py (`6502d44`_) 💥 BREAKING CHANGES ------------------- @@ -5237,7 +5237,7 @@ v2.1.0 (2015-08-20) ✨ Features ----------- -* **cli**: Add the possibility to repost the changelog (`4d028e2`_) +* **cli**: Add the possibility to re-post the changelog (`4d028e2`_) 🪲 Bug Fixes ------------ @@ -5292,7 +5292,7 @@ v2.0.0 (2015-08-19) 💥 BREAKING CHANGES ------------------- -* **history**: The default parser is now angular. Thus, the default behaviour of the commit log +* **history**: The default parser is now angular. Thus, the default behavior of the commit log evaluator will change. From now on it will use the angular commit message spec to determine the new version. diff --git a/docs/algorithm.rst b/docs/algorithm.rst index b6797bb4f..4ea9fa6dd 100644 --- a/docs/algorithm.rst +++ b/docs/algorithm.rst @@ -35,7 +35,7 @@ Implementation 1. Parse all the Git tags of the repository into semantic versions, and **sort** in descending (most recent first) order according to `semver precedence`_. - Ignore any tags which do not correspond to valid semantic vesrions according + Ignore any tags which do not correspond to valid semantic versions according to ``tag_format``. diff --git a/docs/changelog_templates.rst b/docs/changelog_templates.rst index 08f5eec78..1b6e5fc7d 100644 --- a/docs/changelog_templates.rst +++ b/docs/changelog_templates.rst @@ -49,7 +49,7 @@ PSR provides two default changelog output formats: Both formats are kept in sync with one another to display the equivalent information in the respective format. The default changelog template is located in the ``data/templates/`` directory within the PSR package. The templates are written in -modular style (ie. multiple files) and during the render proccess are ultimately +modular style (ie. multiple files) and during the render process are ultimately combined together to render the final changelog output. The rendering start point is the ``CHANGELOG.{FORMAT_EXT}.j2`` underneath the respective format directory. @@ -144,7 +144,7 @@ newly created changelog file. .. tip:: We have accomplished changelog updating through the use of the `Jinja`_ templating - and addtional context filters and context variables. This is notable because + and additional context filters and context variables. This is notable because in the case that you want to customize your changelog template, you now can use the same logic to enable changelog updates of your custom template! @@ -1220,7 +1220,7 @@ __ https://github.com/python-semantic-release/python-semantic-release/tree/maste maintain any content that should be included before the new release information. See ``data/templates/*/md/.components/changelog_update.md.j2`` for reference. -5. **Print your insertion flag.** This is impartive to ensure that the resulting +5. **Print your insertion flag.** This is imperative to ensure that the resulting changelog can be updated in the future. See ``data/templates/*/md/.components/changelog_update.md.j2`` for reference. diff --git a/docs/commands.rst b/docs/commands.rst index 66c01eff2..e7e8e5f21 100644 --- a/docs/commands.rst +++ b/docs/commands.rst @@ -272,8 +272,8 @@ the flag. This can be useful when making a single prerelease on a branch that would typically release normal versions. -If not specified in :ref:`cmd-version-option-prerelease-token`, the prerelease token is idenitified using the -:ref:`Multibranch Release Configuration ` +If not specified in :ref:`cmd-version-option-prerelease-token`, the prerelease token is identified +using the :ref:`Multibranch Release Configuration ` See the examples alongside :ref:`cmd-version-option-force-level` for how to use this flag. @@ -282,8 +282,9 @@ See the examples alongside :ref:`cmd-version-option-force-level` for how to use ``--prerelease-token [VALUE]`` ****************************** -Force the next version to use the value as the prerelease token. This overrides the configured value if one is -present. If not used during a release producing a prerelease version, this option has no effect. +Force the next version to use the value as the prerelease token. This overrides the configured +value if one is present. If not used during a release producing a prerelease version, this +option has no effect. .. _cmd-version-option-build-metadata: diff --git a/docs/configuration.rst b/docs/configuration.rst index 9163f11d8..a777c8f21 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -88,9 +88,12 @@ environment variable is: default = "default value" In this structure: + * ``env`` represents the environment variable that Python Semantic Release will search for + * ``default_env`` is a fallback environment variable to read in case the variable specified by ``env`` is not set. This is optional - if not specified then no fallback will be used. + * ``default`` is a default value to use in case the environment variable specified by ``env`` is not set. This is optional - if ``default`` is not specified then the environment variable specified by ``env`` is considered required. @@ -105,7 +108,7 @@ configuration setting. If there are type mis-matches, PSR will throw validation If a setting is not provided, than PSR will fill in the value with the default value. Python Semantic Release expects a root level key to start the configuration definition. Make -sure to use the correct root key dependending on the configuration format you are using. +sure to use the correct root key depending on the configuration format you are using. .. note:: If you are using ``pyproject.toml``, this heading should include the ``tool`` prefix as specified within PEP 517, resulting in ``[tool.semantic_release]``. @@ -405,7 +408,7 @@ This setting is used to specify the output format the default changelog template will use when rendering the changelog. PSR supports both Markdown (``md``) and reStructuredText (``rst``) formats. -This setting will take presendence over the file extension of the +This setting will take precedence over the file extension of the :ref:`config-changelog-default_templates-changelog_file` setting. If this setting is omitted, the file extension of the :ref:`config-changelog-default_templates-changelog_file` setting will be used to determine the output format. If the file extension is not recognized, @@ -695,10 +698,6 @@ A string that will be used to identify where the new version should be inserted changelog file (as defined by :ref:`config-changelog-changelog_file`) when the changelog mode is set to ``update``. -When the changelog mode is set to ``init``, this string will be included as part of the -header of the changelog file to initialize the changelog with a format that will be condusive -for future version insertions. - If you modify this value in your config, you will need to manually update any saved changelog file to match the new insertion flag if you use the ``update`` mode. In ``init`` mode, the changelog file will be overwritten as normal. @@ -965,7 +964,7 @@ calls rather than the primary domain (ex. ``api.github.com``). **Most on-premise HVCS installations will NOT use this setting!** Whether or not this value is used depends on the HVCS configured (and your server administration) -in the :ref:`remote.type ` setting and used in tadem with the +in the :ref:`remote.type ` setting and used in tandem with the :ref:`remote.domain ` setting. When using a custom :ref:`remote.domain ` and a HVCS @@ -1058,7 +1057,7 @@ used for the connection. If the protocol scheme is provided in the field value, match this setting or it will throw an error. The purpose of this flag is to prevent any typos in provided ``domain`` and ``api_domain`` -values that accidently specify an insecure connection but allow users to toggle the protection +values that accidentally specify an insecure connection but allow users to toggle the protection scheme off when desired. **Default:** ``false`` diff --git a/docs/index.rst b/docs/index.rst index 16eaabec0..f8273c5b7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -219,7 +219,7 @@ and changelogs. The user has three options to push changes to the repository: - :ref:`Changelog ` - customize your project's changelog. - :ref:`changelog-templates-custom_release_notes` - customize the published release notes - :ref:`upload_to_vcs_release ` - - enable/disable uploading artefacts to VCS releases + enable/disable uploading artifacts to VCS releases - :ref:`version --vcs-release/--no-vcs-release ` - enable/disable VCS release creation. - `upload-to-gh-release`_, a GitHub Action for running ``semantic-release publish`` diff --git a/docs/multibranch_releases.rst b/docs/multibranch_releases.rst index 97574be6d..276561a35 100644 --- a/docs/multibranch_releases.rst +++ b/docs/multibranch_releases.rst @@ -45,12 +45,12 @@ a situation may occur in the following scenario: Suppose that Python Semantic Release has been configured to use the same prerelease token ``"alpha"`` for all ``feature-*`` branches, and the default tag format ``"v{version}"``. In this case, running a pre-release from branch ``feature-1`` -will recognise that since the last release, ``1.1.0``, a **feature** has been +will recognize that since the last release, ``1.1.0``, a **feature** has been introduced and therefore the next tag to be applied to ``feature-1`` will be ``v1.2.0-alpha.1``. However, suppose we then try to run a release against ``feature-2``. This will also -recognise that a **feature** has been introduced against the last released version of +recognize that a **feature** has been introduced against the last released version of ``v1.1.0`` and therefore will try to create the tag ``v1.2.0-alpha.1``, leading to an error as this tag was already created against ``feature-1``. @@ -91,7 +91,7 @@ Each release group is configured as a nested mapping under the ``tool.semantic_release.branches`` key in ``pyproject.toml``, or the equivalent structure in other formats. the mapping requires a single key that is used as a name for the release group, which can help to identify it in log messages but has -no effect on the behaviour of the release. For example, Python Semantic Release has +no effect on the behavior of the release. For example, Python Semantic Release has only one release group by default with the name ``main``. Inside each release group, the following key-value pairs can be set: diff --git a/docs/strict_mode.rst b/docs/strict_mode.rst index 4172855b6..475398244 100644 --- a/docs/strict_mode.rst +++ b/docs/strict_mode.rst @@ -4,7 +4,7 @@ Strict Mode =========== Strict Mode is enabled by use of the :ref:`strict ` parameter -to the main command for Python Semantic Release. Strict Mode alters the behaviour of +to the main command for Python Semantic Release. Strict Mode alters the behavior of Python Semantic Release when certain conditions are encountered that prevent Python Semantic Release from performing an action. Typically, this will result in a warning becoming an error, or a different exit code (0 vs non-zero) being produced when Python diff --git a/docs/troubleshooting.rst b/docs/troubleshooting.rst index 04e9c6331..d001104d4 100644 --- a/docs/troubleshooting.rst +++ b/docs/troubleshooting.rst @@ -10,7 +10,8 @@ Troubleshooting .. _troubleshooting-verbosity: Increasing Verbosity -==================== +-------------------- + If you are having trouble with Python Semantic Release or would like to see additional information about the actions that it is taking, you can use the top-level :ref:`cmd-main-option-verbosity` option. This can be supplied multiple times to increase @@ -24,12 +25,10 @@ For example:: semantic-release -vv version --print - .. note:: The :ref:`cmd-main-option-verbosity` option must be supplied to the top-level ``semantic-release`` command, before the name of any sub-command. - .. warning:: The volume of logs when using ``DEBUG`` verbosity may be significantly increased, compared to ``INFO`` or the default ``WARNING``, and as a result executing commands From 903c8ba68d797f7cd9e5025c9a3a3ad471c805ae Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Tue, 11 Feb 2025 00:03:33 -0700 Subject: [PATCH 13/15] fix(config): handle invalid `commit_parser` type gracefully (#1180) * refactor(cli): improve global error logging --- src/semantic_release/__main__.py | 10 +++++++--- src/semantic_release/cli/commands/main.py | 9 +++------ src/semantic_release/cli/config.py | 11 +++++++++++ src/semantic_release/globals.py | 6 ++++-- src/semantic_release/helpers.py | 6 ++++++ 5 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/semantic_release/__main__.py b/src/semantic_release/__main__.py index 7ec9adac7..5743bcace 100644 --- a/src/semantic_release/__main__.py +++ b/src/semantic_release/__main__.py @@ -8,6 +8,7 @@ from semantic_release import globals from semantic_release.cli.commands.main import main as cli_main +from semantic_release.enums import SemanticReleaseLogLevels def main() -> None: @@ -18,7 +19,7 @@ def main() -> None: print("\n-- User Abort! --", file=sys.stderr) sys.exit(127) except Exception as err: # noqa: BLE001, graceful error handling across application - if globals.debug: + if globals.log_level <= SemanticReleaseLogLevels.DEBUG: print(f"{err.__class__.__name__}: {err}\n", file=sys.stderr) etype, value, traceback = sys.exc_info() print( @@ -35,9 +36,12 @@ def main() -> None: file=sys.stderr, ) - print(f"::ERROR:: {err}", file=sys.stderr) + print( + str.join("\n", [f"::ERROR:: {line}" for line in str(err).splitlines()]), + file=sys.stderr, + ) - if not globals.debug: + if globals.log_level > SemanticReleaseLogLevels.DEBUG: print( "Run semantic-release in very verbose mode (-vv) to see the full traceback.", file=sys.stderr, diff --git a/src/semantic_release/cli/commands/main.py b/src/semantic_release/cli/commands/main.py index 885898dfb..7f0d170e2 100644 --- a/src/semantic_release/cli/commands/main.py +++ b/src/semantic_release/cli/commands/main.py @@ -116,10 +116,10 @@ def main( SemanticReleaseLogLevels.SILLY, ] - log_level = log_levels[verbosity] + globals.log_level = log_levels[verbosity] logging.basicConfig( - level=log_level, + level=globals.log_level, format=FORMAT, datefmt="[%X]", handlers=[ @@ -130,10 +130,7 @@ def main( ) logger = logging.getLogger(__name__) - logger.debug("logging level set to: %s", logging.getLevelName(log_level)) - - if log_level <= logging.DEBUG: - globals.debug = True + logger.debug("logging level set to: %s", logging.getLevelName(globals.log_level)) if noop: rprint( diff --git a/src/semantic_release/cli/config.py b/src/semantic_release/cli/config.py index 496e97428..721028281 100644 --- a/src/semantic_release/cli/config.py +++ b/src/semantic_release/cli/config.py @@ -665,6 +665,17 @@ def from_raw_config( # noqa: C901 if raw.commit_parser in _known_commit_parsers else dynamic_import(raw.commit_parser) ) + except ValueError as err: + raise ParserLoadError( + str.join( + "\n", + [ + f"Unrecognized commit parser value: {raw.commit_parser!r}.", + str(err), + "Unable to load the given parser! Check your configuration!", + ], + ) + ) from err except ModuleNotFoundError as err: raise ParserLoadError( str.join( diff --git a/src/semantic_release/globals.py b/src/semantic_release/globals.py index 3780b84bb..a0ac61ddb 100644 --- a/src/semantic_release/globals.py +++ b/src/semantic_release/globals.py @@ -2,5 +2,7 @@ from __future__ import annotations -debug: bool = False -"""bool: Enable debug level logging and runtime actions.""" +from semantic_release.enums import SemanticReleaseLogLevels + +log_level: SemanticReleaseLogLevels = SemanticReleaseLogLevels.WARNING +"""int: Logging level for semantic-release""" diff --git a/src/semantic_release/helpers.py b/src/semantic_release/helpers.py index 46358b8d0..5f6723ec4 100644 --- a/src/semantic_release/helpers.py +++ b/src/semantic_release/helpers.py @@ -157,6 +157,12 @@ def dynamic_import(import_path: str) -> Any: Dynamically import an object from a conventionally formatted "module:attribute" string """ + if ":" not in import_path: + raise ValueError( + f"Invalid import path {import_path!r}, must use 'module:Class' format" + ) + + # Split the import path into module and attribute module_name, attr = import_path.split(":", maxsplit=1) # Check if the module is a file path, if it can be resolved and exists on disk then import as a file From 81f9e80c3df185ef5e553e024b903ce153e14304 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Tue, 11 Feb 2025 00:15:26 -0700 Subject: [PATCH 14/15] fix(changelog): standardize heading format for across all version sections (#1182) * test(fixtures): update changelog generator to match adjusted default template * test(release-notes): update test cases to match adjusted default template * test(changelog): update test cases to match adjusted default template * fix(changelog-rst): standardize heading format for extra release information * fix(changelog-md): standardize heading format for extra release information * fix(release-notes): standardize heading format for extra release information * docs(commit-parsing): update reference to section name of additional release info * chore(psr-changelog-tpls): standardize all headings & resolve additnl release info usage --- config/release-templates/.components/changes.md.j2 | 10 +++++----- config/release-templates/.components/changes.rst.j2 | 8 ++++---- config/release-templates/.release_notes.md.j2 | 4 ++-- docs/commit_parsing.rst | 2 +- .../templates/angular/md/.components/changes.md.j2 | 8 ++++---- .../data/templates/angular/md/.release_notes.md.j2 | 4 ++-- .../templates/angular/rst/.components/changes.rst.j2 | 8 ++++---- tests/fixtures/git_repo.py | 6 +++--- .../changelog/test_default_changelog.py | 12 ++++++------ .../semantic_release/changelog/test_release_notes.py | 12 ++++++------ 10 files changed, 37 insertions(+), 37 deletions(-) diff --git a/config/release-templates/.components/changes.md.j2 b/config/release-templates/.components/changes.md.j2 index 87d600924..d2a062d9a 100644 --- a/config/release-templates/.components/changes.md.j2 +++ b/config/release-templates/.components/changes.md.j2 @@ -19,7 +19,7 @@ EXAMPLE: - Fix bug ([#11](https://domain.com/namespace/repo/pull/11), [`abcdef1`](https://domain.com/namespace/repo/commit/HASH)) -### 💥 BREAKING CHANGES +### 💥 Breaking Changes - With the change _____, the change causes ___ effect. Ultimately, this section it is a more detailed description of the breaking change. With an optional @@ -28,7 +28,7 @@ EXAMPLE: - **scope**: this breaking change has a scope to identify the part of the code that this breaking change applies to for better context. -### 💡 ADDITIONAL RELEASE INFORMATION +### 💡 Additional Release Information - This is a release note that provides additional information about the release that is not a breaking change or a feature/bug fix. @@ -65,7 +65,7 @@ EXAMPLE: #}{% set breaking_commits = [] %}{% set notice_commits = [] %}{% for commits in commit_objects.values() -%}{% set valid_commits = commits | rejectattr("error", "defined") +%}{% set valid_commits = commits | rejectattr("error", "defined") | list %}{# # Filter out breaking change commits that have no breaking descriptions #}{% set _ = breaking_commits.extend( valid_commits | selectattr("breaking_descriptions.0") @@ -94,7 +94,7 @@ EXAMPLE: %}{# # # PRINT BREAKING CHANGE DESCRIPTIONS (header & descriptions) #}{{ "\n" -}}{{ "### %s BREAKING CHANGES\n" | format(emoji_map["breaking"]) +}}{{ "### %s Breaking Changes\n" | format(emoji_map["breaking"]) }}{{ "\n%s\n" | format(brking_descriptions | unique | join("\n\n")) }}{# @@ -118,7 +118,7 @@ EXAMPLE: %}{# # # PRINT RELEASE NOTICE INFORMATION (header & descriptions) #}{{ "\n" -}}{{ "### %s ADDITIONAL RELEASE INFORMATION\n" | format(emoji_map["release_note"]) +}}{{ "### %s Additional Release Information\n" | format(emoji_map["release_note"]) }}{{ "\n%s\n" | format(release_notices | unique | join("\n\n")) }}{# diff --git a/config/release-templates/.components/changes.rst.j2 b/config/release-templates/.components/changes.rst.j2 index ba9180e87..90434bfdb 100644 --- a/config/release-templates/.components/changes.rst.j2 +++ b/config/release-templates/.components/changes.rst.j2 @@ -20,7 +20,7 @@ * Fix bug (`#11`_, `8a7b8ec`_) -💥 BREAKING CHANGES +💥 Breaking Changes ------------------- * With the change _____, the change causes ___ effect. Ultimately, this section @@ -30,7 +30,7 @@ * **scope**: this breaking change has a scope to identify the part of the code that this breaking change applies to for better context. -💡 ADDITIONAL RELEASE INFORMATION +💡 Additional Release Information --------------------------------- * This is a release note that provides additional information about the release @@ -132,7 +132,7 @@ %}{# # # PRINT BREAKING CHANGE DESCRIPTIONS (header & descriptions) #}{{ "\n" -}}{{ "%s BREAKING CHANGES\n" | format(emoji_map["breaking"]) +}}{{ "%s Breaking Changes\n" | format(emoji_map["breaking"]) }}{{ '-------------------\n' }}{{ "\n%s\n" | format(brking_descriptions | unique | join("\n\n")) @@ -157,7 +157,7 @@ %}{# # # PRINT RELEASE NOTICE INFORMATION (header & descriptions) #}{{ "\n" -}}{{ "%s ADDITIONAL RELEASE INFORMATION\n" | format(emoji_map["release_note"]) +}}{{ "%s Additional Release Information\n" | format(emoji_map["release_note"]) }}{{ "---------------------------------\n" }}{{ "\n%s\n" | format(release_notices | unique | join("\n\n")) diff --git a/config/release-templates/.release_notes.md.j2 b/config/release-templates/.release_notes.md.j2 index 584269ead..ee9fde4c4 100644 --- a/config/release-templates/.release_notes.md.j2 +++ b/config/release-templates/.release_notes.md.j2 @@ -15,13 +15,13 @@ _This release is published under the MIT License._ - Fix bug ([PR#11](https://domain.com/namespace/repo/pull/11), [`abcdef1`](https://domain.com/namespace/repo/commit/HASH)) -### 💥 BREAKING CHANGES +### 💥 Breaking Changes - With the change _____, the change causes ___ effect. Ultimately, this section it is a more detailed description of the breaking change. With an optional scope prefix like the commit messages above. - **scope**: this breaking change has a scope to identify the part of the code that this breaking change applies to for better context. -### 💡 ADDITIONAL RELEASE INFORMATION +### 💡 Additional Release Information - This is a release note that provides additional information about the release that is not a breaking change or a feature/bug fix. diff --git a/docs/commit_parsing.rst b/docs/commit_parsing.rst index 25e70eb45..65e523d98 100644 --- a/docs/commit_parsing.rst +++ b/docs/commit_parsing.rst @@ -423,7 +423,7 @@ a ``release_notices`` attribute that is a tuple of string paragraphs to identify release notice. In the default changelog and release notes template, these release notices will be -formatted into their own section called **ADDITIONAL RELEASE INFORMATION**. Each will +formatted into their own section called **Additional Release Information**. Each will include any commit scope defined and each release notice in alphabetical order. ---- diff --git a/src/semantic_release/data/templates/angular/md/.components/changes.md.j2 b/src/semantic_release/data/templates/angular/md/.components/changes.md.j2 index bf4cd98b5..b2b89ff12 100644 --- a/src/semantic_release/data/templates/angular/md/.components/changes.md.j2 +++ b/src/semantic_release/data/templates/angular/md/.components/changes.md.j2 @@ -18,7 +18,7 @@ EXAMPLE: - Fix bug ([#11](https://domain.com/namespace/repo/pull/11), [`abcdef1`](https://domain.com/namespace/repo/commit/HASH)) -### BREAKING CHANGES +### Breaking Changes - With the change _____, the change causes ___ effect. Ultimately, this section it is a more detailed description of the breaking change. With an optional @@ -27,7 +27,7 @@ EXAMPLE: - **scope**: this breaking change has a scope to identify the part of the code that this breaking change applies to for better context. -### ADDITIONAL RELEASE INFORMATION +### Additional Release Information - This is a release note that provides additional information about the release that is not a breaking change or a feature/bug fix. @@ -96,7 +96,7 @@ EXAMPLE: %}{# # # PRINT BREAKING CHANGE DESCRIPTIONS (header & descriptions) #}{{ "\n" -}}{{ "### BREAKING CHANGES\n" +}}{{ "### Breaking Changes\n" }}{{ "\n%s\n" | format(brking_descriptions | unique | join("\n\n")) }}{# @@ -129,7 +129,7 @@ EXAMPLE: %}{# # # PRINT RELEASE NOTICE INFORMATION (header & descriptions) #}{{ "\n" -}}{{ "### ADDITIONAL RELEASE INFORMATION\n" +}}{{ "### Additional Release Information\n" }}{{ "\n%s\n" | format(release_notices | unique | join("\n\n")) }}{# diff --git a/src/semantic_release/data/templates/angular/md/.release_notes.md.j2 b/src/semantic_release/data/templates/angular/md/.release_notes.md.j2 index 8bfd679cc..7fe7d9228 100644 --- a/src/semantic_release/data/templates/angular/md/.release_notes.md.j2 +++ b/src/semantic_release/data/templates/angular/md/.release_notes.md.j2 @@ -14,13 +14,13 @@ _This release is published under the MIT License._ - Fix bug (#11, [`abcdef1`](https://domain.com/namespace/repo/commit/HASH)) -### BREAKING CHANGES +### Breaking Changes - With the change _____, the change causes ___ effect. Ultimately, this section it is a more detailed description of the breaking change. With an optional scope prefix like the commit messages above. - **scope**: this breaking change has a scope to identify the part of the code that this breaking change applies to for better context. -### ADDITIONAL RELEASE INFORMATION +### Additional Release Information - This is a release note that provides additional information about the release that is not a breaking change or a feature/bug fix. diff --git a/src/semantic_release/data/templates/angular/rst/.components/changes.rst.j2 b/src/semantic_release/data/templates/angular/rst/.components/changes.rst.j2 index 2ff88c892..c6ef1cced 100644 --- a/src/semantic_release/data/templates/angular/rst/.components/changes.rst.j2 +++ b/src/semantic_release/data/templates/angular/rst/.components/changes.rst.j2 @@ -18,7 +18,7 @@ Bug Fixes * Fix bug (`#11`_, `8a7b8ec`_) -BREAKING CHANGES +Breaking Changes ---------------- * With the change _____, the change causes ___ effect. Ultimately, this section @@ -28,7 +28,7 @@ BREAKING CHANGES * **scope**: this breaking change has a scope to identify the part of the code that this breaking change applies to for better context. -ADDITIONAL RELEASE INFORMATION +Additional Release Information ------------------------------ * This is a release note that provides additional information about the release @@ -124,7 +124,7 @@ ADDITIONAL RELEASE INFORMATION %}{# # # PRINT BREAKING CHANGE DESCRIPTIONS (header & descriptions) #}{{ "\n" -}}{{ "BREAKING CHANGES\n" +}}{{ "Breaking Changes\n" }}{{ '----------------\n' }}{{ "\n%s\n" | format(brking_descriptions | unique | join("\n\n")) @@ -158,7 +158,7 @@ ADDITIONAL RELEASE INFORMATION %}{# # # PRINT RELEASE NOTICE INFORMATION (header & descriptions) #}{{ "\n" -}}{{ "ADDITIONAL RELEASE INFORMATION\n" +}}{{ "Additional Release Information\n" }}{{ "------------------------------\n" }}{{ "\n%s\n" | format(release_notices | unique | join("\n\n")) diff --git a/tests/fixtures/git_repo.py b/tests/fixtures/git_repo.py index 0c8faeeb5..048f77b3a 100644 --- a/tests/fixtures/git_repo.py +++ b/tests/fixtures/git_repo.py @@ -1689,7 +1689,7 @@ def build_version_entry_markdown( # Add breaking changes to the end of the version entry if brking_descriptions: - version_entry.append("### BREAKING CHANGES\n") + version_entry.append("### Breaking Changes\n") version_entry.extend([*sorted(brking_descriptions), ""]) return str.join("\n", version_entry) @@ -1822,7 +1822,7 @@ def build_version_entry_restructured_text( # Add breaking changes to the end of the version entry if brking_descriptions: - version_entry.append("BREAKING CHANGES") + version_entry.append("Breaking Changes") version_entry.append("-" * len(version_entry[-1]) + "\n") version_entry.extend([*sorted(brking_descriptions), ""]) @@ -2067,7 +2067,7 @@ def build_version_entry_markdown( # Add breaking changes to the end of the version entry if brking_descriptions: - version_entry.append("### BREAKING CHANGES\n") + version_entry.append("### Breaking Changes\n") version_entry.extend([*sorted(brking_descriptions), ""]) return str.join("\n", version_entry) diff --git a/tests/unit/semantic_release/changelog/test_default_changelog.py b/tests/unit/semantic_release/changelog/test_default_changelog.py index e3c01b7d7..adbbdc241 100644 --- a/tests/unit/semantic_release/changelog/test_default_changelog.py +++ b/tests/unit/semantic_release/changelog/test_default_changelog.py @@ -180,7 +180,7 @@ def test_default_changelog_template_w_a_brk_change( f"- **{brk_fix_commit_obj.scope}**: {brk_fix_description.capitalize()}", f" ([`{brk_fix_commit_obj.commit.hexsha[:7]}`]({brk_fix_commit_url}))", "", - "### BREAKING CHANGES", + "### Breaking Changes", "", # Currently does not consider the 100 character limit because the current # descriptions are short enough to fit in one line @@ -317,7 +317,7 @@ def test_default_changelog_template_w_multiple_brk_changes( f"- {brk_feat_description.capitalize()}", f" ([`{brk_feat_commit_obj.commit.hexsha[:7]}`]({brk_feat_commit_url}))", "", - "### BREAKING CHANGES", + "### Breaking Changes", "", # Currently does not consider the 100 character limit because the current # descriptions are short enough to fit in one line @@ -638,7 +638,7 @@ def test_default_changelog_template_w_a_notice( f"- **{notice_commit_obj.scope}**: {notice_commit_description.capitalize().rstrip()}", f" ([`{notice_commit_obj.commit.hexsha[:7]}`]({notice_commit_url}))", "", - "### ADDITIONAL RELEASE INFORMATION", + "### Additional Release Information", "", "- {commit_scope}{change_desc}".format( commit_scope=( @@ -787,7 +787,7 @@ def test_default_changelog_template_w_a_notice_n_brk_change( ), f" ([`{notice_commit_obj.commit.hexsha[:7]}`]({notice_commit_url}))", "", - "### BREAKING CHANGES", + "### Breaking Changes", "", "- {commit_scope}{change_desc}".format( commit_scope=( @@ -798,7 +798,7 @@ def test_default_changelog_template_w_a_notice_n_brk_change( change_desc=brk_fix_brking_description.capitalize().rstrip(), ), "", - "### ADDITIONAL RELEASE INFORMATION", + "### Additional Release Information", "", "- {commit_scope}{change_desc}".format( commit_scope=( @@ -947,7 +947,7 @@ def test_default_changelog_template_w_multiple_notices( ), f" ([`{refactor_notice_commit_obj.commit.hexsha[:7]}`]({refactor_commit_url}))", "", - "### ADDITIONAL RELEASE INFORMATION", + "### Additional Release Information", "", "- {commit_scope}{change_desc}".format( commit_scope=( diff --git a/tests/unit/semantic_release/changelog/test_release_notes.py b/tests/unit/semantic_release/changelog/test_release_notes.py index f0c959c27..2b95ec827 100644 --- a/tests/unit/semantic_release/changelog/test_release_notes.py +++ b/tests/unit/semantic_release/changelog/test_release_notes.py @@ -211,7 +211,7 @@ def test_default_release_notes_template_w_a_brk_description( url=brk_fix_commit_url, ), "", - "### BREAKING CHANGES", + "### Breaking Changes", "", "- {commit_scope}{change_desc}".format( commit_scope=( @@ -323,7 +323,7 @@ def test_default_release_notes_template_w_multiple_brk_changes( url=brk_feat_commit_url, ), "", - "### BREAKING CHANGES", + "### Breaking Changes", "", "- {commit_scope}{change_desc}".format( commit_scope=( @@ -770,7 +770,7 @@ def test_default_release_notes_template_w_a_notice( url=notice_commit_url, ), "", - "### ADDITIONAL RELEASE INFORMATION", + "### Additional Release Information", "", "- {commit_scope}{change_desc}".format( commit_scope=( @@ -880,7 +880,7 @@ def test_default_release_notes_template_w_a_notice_n_brk_change( url=notice_commit_url, ), "", - "### BREAKING CHANGES", + "### Breaking Changes", "", "- {commit_scope}{change_desc}".format( commit_scope=( @@ -891,7 +891,7 @@ def test_default_release_notes_template_w_a_notice_n_brk_change( change_desc=brk_fix_brking_description.capitalize().rstrip(), ), "", - "### ADDITIONAL RELEASE INFORMATION", + "### Additional Release Information", "", "- {commit_scope}{change_desc}".format( commit_scope=( @@ -997,7 +997,7 @@ def test_default_release_notes_template_w_multiple_notices( url=refactor_commit_url, ), "", - "### ADDITIONAL RELEASE INFORMATION", + "### Additional Release Information", "", "- {commit_scope}{change_desc}".format( commit_scope=( From 0a6013c422396066ede0383ca2c443859397252d Mon Sep 17 00:00:00 2001 From: semantic-release Date: Tue, 11 Feb 2025 07:27:52 +0000 Subject: [PATCH 15/15] 9.19.1 Automatically generated by python-semantic-release --- CHANGELOG.rst | 39 ++++++++++++++++++++++ docs/automatic-releases/github-actions.rst | 14 ++++---- pyproject.toml | 2 +- src/semantic_release/__init__.py | 2 +- 4 files changed, 48 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f2bc511ae..db8c86e47 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,45 @@ CHANGELOG ========= +.. _changelog-v9.19.1: + +v9.19.1 (2025-02-11) +==================== + +🪲 Bug Fixes +------------ + +* **changelog**: Standardize heading format for across all version sections (`PR#1182`_, `81f9e80`_) + +* **changelog-md**: Standardize heading format for extra release information (`PR#1182`_, + `81f9e80`_) + +* **changelog-rst**: Standardize heading format for extra release information (`PR#1182`_, + `81f9e80`_) + +* **config**: Handle invalid ``commit_parser`` type gracefully (`PR#1180`_, `903c8ba`_) + +* **release-notes**: Standardize heading format for extra release information (`PR#1182`_, + `81f9e80`_) + +📖 Documentation +---------------- + +* Fix spelling errors & inaccurate descriptions (`55d4a05`_) + +* **automatic-releases**: Declutter the table of contents for automatic release guides (`e8343ee`_) + +* **commit-parsing**: Update reference to section name of additional release info (`PR#1182`_, + `81f9e80`_) + +.. _55d4a05: https://github.com/python-semantic-release/python-semantic-release/commit/55d4a05ff56321cf9874f8f302fbe7e5163ad4f7 +.. _81f9e80: https://github.com/python-semantic-release/python-semantic-release/commit/81f9e80c3df185ef5e553e024b903ce153e14304 +.. _903c8ba: https://github.com/python-semantic-release/python-semantic-release/commit/903c8ba68d797f7cd9e5025c9a3a3ad471c805ae +.. _e8343ee: https://github.com/python-semantic-release/python-semantic-release/commit/e8343eeb38d3b4e18953ac0f97538df396d22b76 +.. _PR#1180: https://github.com/python-semantic-release/python-semantic-release/pull/1180 +.. _PR#1182: https://github.com/python-semantic-release/python-semantic-release/pull/1182 + + .. _changelog-v9.19.0: v9.19.0 (2025-02-10) diff --git a/docs/automatic-releases/github-actions.rst b/docs/automatic-releases/github-actions.rst index 2ea4ba2ff..b192eb6f9 100644 --- a/docs/automatic-releases/github-actions.rst +++ b/docs/automatic-releases/github-actions.rst @@ -337,7 +337,7 @@ before the :ref:`version ` subcommand. .. code:: yaml - - uses: python-semantic-release/python-semantic-release@v9.19.0 + - uses: python-semantic-release/python-semantic-release@v9.19.1 with: root_options: "-vv --noop" @@ -576,7 +576,7 @@ before the :ref:`publish ` subcommand. .. code:: yaml - - uses: python-semantic-release/publish-action@v9.19.0 + - uses: python-semantic-release/publish-action@v9.19.1 with: root_options: "-vv --noop" @@ -684,7 +684,7 @@ to the GitHub Release Assets as well. - name: Action | Semantic Version Release id: release # Adjust tag with desired version if applicable. - uses: python-semantic-release/python-semantic-release@v9.19.0 + uses: python-semantic-release/python-semantic-release@v9.19.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} git_committer_name: "github-actions" @@ -695,7 +695,7 @@ to the GitHub Release Assets as well. if: steps.release.outputs.released == 'true' - name: Publish | Upload to GitHub Release Assets - uses: python-semantic-release/publish-action@v9.19.0 + uses: python-semantic-release/publish-action@v9.19.1 if: steps.release.outputs.released == 'true' with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -744,7 +744,7 @@ The equivalent GitHub Action configuration would be: - name: Action | Semantic Version Release # Adjust tag with desired version if applicable. - uses: python-semantic-release/python-semantic-release@v9.19.0 + uses: python-semantic-release/python-semantic-release@v9.19.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} force: patch @@ -772,13 +772,13 @@ Publish Action. .. code:: yaml - name: Release Project 1 - uses: python-semantic-release/python-semantic-release@v9.19.0 + uses: python-semantic-release/python-semantic-release@v9.19.1 with: directory: ./project1 github_token: ${{ secrets.GITHUB_TOKEN }} - name: Release Project 2 - uses: python-semantic-release/python-semantic-release@v9.19.0 + uses: python-semantic-release/python-semantic-release@v9.19.1 with: directory: ./project2 github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index c6e99d898..f0d1eb911 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "python-semantic-release" -version = "9.19.0" +version = "9.19.1" description = "Automatic Semantic Versioning for Python projects" requires-python = ">=3.8" license = { text = "MIT" } diff --git a/src/semantic_release/__init__.py b/src/semantic_release/__init__.py index 790c3034f..cad1767ec 100644 --- a/src/semantic_release/__init__.py +++ b/src/semantic_release/__init__.py @@ -24,7 +24,7 @@ tags_and_versions, ) -__version__ = "9.19.0" +__version__ = "9.19.1" __all__ = [ "CommitParser",