diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 3b5d5305a..f0a517686 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -6,7 +6,7 @@ jobs: python-check: strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev"] platform: [ubuntu-20.04, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: diff --git a/tests/commands/test_bump_command.py b/tests/commands/test_bump_command.py index a0271c322..7278de90d 100644 --- a/tests/commands/test_bump_command.py +++ b/tests/commands/test_bump_command.py @@ -29,7 +29,7 @@ NotAllowed, NoVersionSpecifiedError, ) -from tests.utils import create_file_and_commit, create_tag, skip_below_py_3_10 +from tests.utils import create_file_and_commit, create_tag, skip_below_py_3_13 @pytest.mark.parametrize( @@ -1451,7 +1451,7 @@ def test_bump_changelog_contains_increment_only(mocker, tmp_commitizen_project, assert "2.0.0" not in out -@skip_below_py_3_10 +@skip_below_py_3_13 def test_bump_command_shows_description_when_use_help_option( mocker: MockFixture, capsys, file_regression ): diff --git a/tests/commands/test_bump_command/test_bump_command_shows_description_when_use_help_option.txt b/tests/commands/test_bump_command/test_bump_command_shows_description_when_use_help_option.txt index de76f2efc..c9b7bc0a0 100644 --- a/tests/commands/test_bump_command/test_bump_command_shows_description_when_use_help_option.txt +++ b/tests/commands/test_bump_command/test_bump_command_shows_description_when_use_help_option.txt @@ -33,9 +33,9 @@ options: --bump-message BUMP_MESSAGE template used to create the release commit, useful when working with CI - --prerelease {alpha,beta,rc}, -pr {alpha,beta,rc} + --prerelease, -pr {alpha,beta,rc} choose type of prerelease - --devrelease DEVRELEASE, -d DEVRELEASE + --devrelease, -d DEVRELEASE specify non-negative integer for dev. release --increment {MAJOR,MINOR,PATCH} manually specify the desired increment @@ -53,7 +53,7 @@ options: check consistency among versions defined in commitizen configuration and version_files --annotated-tag, -at create annotated tag instead of lightweight one - --annotated-tag-message ANNOTATED_TAG_MESSAGE, -atm ANNOTATED_TAG_MESSAGE + --annotated-tag-message, -atm ANNOTATED_TAG_MESSAGE create annotated tag message --gpg-sign, -s sign tag instead of lightweight one --changelog-to-stdout @@ -62,11 +62,10 @@ options: Redirect git output to stderr --retry retry commit if it fails the 1st time --major-version-zero keep major version at zero, even for breaking changes - --template TEMPLATE, -t TEMPLATE + --template, -t TEMPLATE changelog template file name (relative to the current working directory) - --extra EXTRA, -e EXTRA - a changelog extra variable (in the form 'key=value') + --extra, -e EXTRA a changelog extra variable (in the form 'key=value') --file-name FILE_NAME file name of changelog (default: 'CHANGELOG.md') --prerelease-offset PRERELEASE_OFFSET diff --git a/tests/commands/test_changelog_command.py b/tests/commands/test_changelog_command.py index 4694d3330..3d9a5c5c4 100644 --- a/tests/commands/test_changelog_command.py +++ b/tests/commands/test_changelog_command.py @@ -29,7 +29,7 @@ create_tag, get_current_branch, merge_branch, - skip_below_py_3_10, + skip_below_py_3_13, switch_branch, wait_for_tag, ) @@ -1640,7 +1640,7 @@ def test_export_changelog_template_from_plugin( assert target.read_text() == tpl -@skip_below_py_3_10 +@skip_below_py_3_13 def test_changelog_command_shows_description_when_use_help_option( mocker: MockFixture, capsys, file_regression ): diff --git a/tests/commands/test_changelog_command/test_changelog_command_shows_description_when_use_help_option.txt b/tests/commands/test_changelog_command/test_changelog_command_shows_description_when_use_help_option.txt index dae438ca2..461eb2edd 100644 --- a/tests/commands/test_changelog_command/test_changelog_command_shows_description_when_use_help_option.txt +++ b/tests/commands/test_changelog_command/test_changelog_command_shows_description_when_use_help_option.txt @@ -33,8 +33,7 @@ options: --export-template EXPORT_TEMPLATE Export the changelog template into this file instead of rendering it - --template TEMPLATE, -t TEMPLATE + --template, -t TEMPLATE changelog template file name (relative to the current working directory) - --extra EXTRA, -e EXTRA - a changelog extra variable (in the form 'key=value') + --extra, -e EXTRA a changelog extra variable (in the form 'key=value') diff --git a/tests/commands/test_check_command.py b/tests/commands/test_check_command.py index 328ebd78a..57bfe3f10 100644 --- a/tests/commands/test_check_command.py +++ b/tests/commands/test_check_command.py @@ -12,7 +12,7 @@ InvalidCommitMessageError, NoCommitsFoundError, ) -from tests.utils import create_file_and_commit, skip_below_py_3_10 +from tests.utils import create_file_and_commit, skip_below_py_3_13 COMMIT_LOG = [ "refactor: A code change that neither fixes a bug nor adds a feature", @@ -416,7 +416,7 @@ def test_check_conventional_commit_succeed_with_git_diff(mocker, capsys): assert "Commit validation: successful!" in out -@skip_below_py_3_10 +@skip_below_py_3_13 def test_check_command_shows_description_when_use_help_option( mocker: MockFixture, capsys, file_regression ): diff --git a/tests/commands/test_check_command/test_check_command_shows_description_when_use_help_option.txt b/tests/commands/test_check_command/test_check_command_shows_description_when_use_help_option.txt index 74b9df719..2ccf97270 100644 --- a/tests/commands/test_check_command/test_check_command_shows_description_when_use_help_option.txt +++ b/tests/commands/test_check_command/test_check_command_shows_description_when_use_help_option.txt @@ -13,7 +13,7 @@ options: MSG_FILE=$1 --rev-range REV_RANGE a range of git rev to check. e.g, master..HEAD - -m MESSAGE, --message MESSAGE + -m, --message MESSAGE commit message that needs to be checked --allow-abort allow empty commit messages, which typically abort a commit @@ -21,5 +21,5 @@ options: allowed commit message prefixes. If the message starts by one of these prefixes, the message won't be checked against the regex - -l MESSAGE_LENGTH_LIMIT, --message-length-limit MESSAGE_LENGTH_LIMIT + -l, --message-length-limit MESSAGE_LENGTH_LIMIT length limit of the commit message; 0 for no limit diff --git a/tests/commands/test_commit_command.py b/tests/commands/test_commit_command.py index 8ae7568a9..03ff51c42 100644 --- a/tests/commands/test_commit_command.py +++ b/tests/commands/test_commit_command.py @@ -19,7 +19,7 @@ NotAllowed, NothingToCommitError, ) -from tests.utils import skip_below_py_3_10 +from tests.utils import skip_below_py_3_13 @pytest.fixture @@ -410,7 +410,7 @@ def test_commit_command_with_message_length_limit(config, mocker: MockFixture): commands.Commit(config, {"message_length_limit": message_length - 1})() -@skip_below_py_3_10 +@skip_below_py_3_13 def test_commit_command_shows_description_when_use_help_option( mocker: MockFixture, capsys, file_regression ): diff --git a/tests/commands/test_commit_command/test_commit_command_shows_description_when_use_help_option.txt b/tests/commands/test_commit_command/test_commit_command_shows_description_when_use_help_option.txt index ebdb68446..92f3cf5e8 100644 --- a/tests/commands/test_commit_command/test_commit_command_shows_description_when_use_help_option.txt +++ b/tests/commands/test_commit_command/test_commit_command_shows_description_when_use_help_option.txt @@ -16,5 +16,5 @@ options: -a, --all Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected. - -l MESSAGE_LENGTH_LIMIT, --message-length-limit MESSAGE_LENGTH_LIMIT + -l, --message-length-limit MESSAGE_LENGTH_LIMIT length limit of the commit message; 0 for no limit diff --git a/tests/test_bump_create_commit_message.py b/tests/test_bump_create_commit_message.py index 517c7a045..000265939 100644 --- a/tests/test_bump_create_commit_message.py +++ b/tests/test_bump_create_commit_message.py @@ -24,7 +24,19 @@ def test_create_tag(test_input, expected): assert new_tag == expected -@pytest.mark.parametrize("retry", (True, False)) +@pytest.mark.parametrize( + "retry", + ( + pytest.param( + True, + marks=pytest.mark.skipif( + sys.version_info >= (3, 13), + reason="mirrors-prettier is not supported with Python 3.13 or higher", + ), + ), + False, + ), +) @pytest.mark.usefixtures("tmp_commitizen_project") def test_bump_pre_commit_changelog(mocker: MockFixture, freezer, retry): freezer.move_to("2022-04-01") diff --git a/tests/utils.py b/tests/utils.py index 971ff9182..5e26b2d70 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -12,7 +12,12 @@ skip_below_py_3_10 = pytest.mark.skipif( sys.version_info < (3, 10), - reason="The output meesage of argparse is different between Python 3.10 and lower than Python 3.10", + reason="The output message of argparse is different between Python 3.10 and lower than Python 3.10", +) + +skip_below_py_3_13 = pytest.mark.skipif( + sys.version_info < (3, 13), + reason="The output message of argparse is different between Python 3.13 and lower than Python 3.13", )