Skip to content

ci(github-actions): add "3.13-dev" to Python tests (#1145) #1170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tests/commands/test_bump_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/commands/test_changelog_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
4 changes: 2 additions & 2 deletions tests/commands/test_check_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ 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
--allowed-prefixes [ALLOWED_PREFIXES ...]
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
4 changes: 2 additions & 2 deletions tests/commands/test_commit_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 13 additions & 1 deletion tests/test_bump_create_commit_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
7 changes: 6 additions & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)


Expand Down
Loading