From 4613dc25b26d762b8adfcc718bfec441b5b3f249 Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Wed, 8 Dec 2021 10:27:15 +0800 Subject: [PATCH 1/4] ci(github-actions): add back 3.7 runner to pythonpackage --- .github/workflows/pythonpackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 82078d4b93..b718ea84c5 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -6,7 +6,7 @@ jobs: python-check: strategy: matrix: - python-version: [3.6, 3.8, 3.9] + python-version: [3.6, 3.7, 3.8, 3.9] platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: From b5c66e121e5e7c0840884c1c41bffe1964538f20 Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Wed, 8 Dec 2021 10:33:12 +0800 Subject: [PATCH 2/4] ci(github-actions): upgrade setup-python to v2 --- .github/workflows/pythonpackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index b718ea84c5..51fb46832d 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -14,7 +14,7 @@ jobs: with: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dependencies From 732133e31dfcfd5517c0b91ea01ad2a7eb9ad8ce Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Wed, 8 Dec 2021 10:11:25 +0800 Subject: [PATCH 3/4] build(poetry): update black version for python 3.9 and upgrade least support python version to python 3.6.2 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d1d0e37a47..a8a7da5782 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ classifiers = [ ] [tool.poetry.dependencies] -python = "^3.6.1" +python = "^3.6.2" questionary = "^1.4.0" decli = "^0.5.2" colorama = "^0.4.1" @@ -57,7 +57,7 @@ argcomplete = "^1.12.1" [tool.poetry.dev-dependencies] ipython = "^7.2" -black = "^19.3b0" +black = "^21.12b0" pytest = "^5.0" flake8 = "^3.6" pytest-cov = "^2.6" From 65645e05df7cc404831546a7289406e2b9f76e11 Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Wed, 8 Dec 2021 10:39:29 +0800 Subject: [PATCH 4/4] style: format the code through the latest black --- tests/commands/test_check_command.py | 6 +++++- tests/test_bump_find_version.py | 18 +++++++++++------- tests/test_cli.py | 5 ++++- tests/test_cz_conventional_commits.py | 15 ++++++++++++--- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/tests/commands/test_check_command.py b/tests/commands/test_check_command.py index ac545e3a6a..7377a8a388 100644 --- a/tests/commands/test_check_command.py +++ b/tests/commands/test_check_command.py @@ -125,7 +125,11 @@ def test_check_conventional_commit_succeeds(mocker, capsys): @pytest.mark.parametrize( - "commit_msg", ("feat!(lang): removed polish language", "no conventional commit",), + "commit_msg", + ( + "feat!(lang): removed polish language", + "no conventional commit", + ), ) def test_check_no_conventional_commit(commit_msg, config, mocker, tmpdir): with pytest.raises(InvalidCommitMessageError): diff --git a/tests/test_bump_find_version.py b/tests/test_bump_find_version.py index 1436d9bd1e..2899dfcf97 100644 --- a/tests/test_bump_find_version.py +++ b/tests/test_bump_find_version.py @@ -82,16 +82,20 @@ def test_generate_version(test_input, expected): @pytest.mark.parametrize( - "test_input,expected", itertools.chain(local_versions), + "test_input,expected", + itertools.chain(local_versions), ) def test_generate_version_local(test_input, expected): current_version = test_input[0] increment = test_input[1] prerelease = test_input[2] is_local_version = True - assert generate_version( - current_version, - increment=increment, - prerelease=prerelease, - is_local_version=is_local_version, - ) == Version(expected) + assert ( + generate_version( + current_version, + increment=increment, + prerelease=prerelease, + is_local_version=is_local_version, + ) + == Version(expected) + ) diff --git a/tests/test_cli.py b/tests/test_cli.py index 2b73bbd5cf..44f182b0d5 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -73,7 +73,10 @@ def test_commitizen_excepthook(capsys): def test_commitizen_debug_excepthook(capsys): with pytest.raises(SystemExit) as excinfo: cli.commitizen_excepthook( - NotAGitProjectError, NotAGitProjectError(), "", debug=True, + NotAGitProjectError, + NotAGitProjectError(), + "", + debug=True, ) assert excinfo.type == SystemExit diff --git a/tests/test_cz_conventional_commits.py b/tests/test_cz_conventional_commits.py index b84144e94c..27445cd57c 100644 --- a/tests/test_cz_conventional_commits.py +++ b/tests/test_cz_conventional_commits.py @@ -144,9 +144,18 @@ def test_info(config): @pytest.mark.parametrize( ("commit_message", "expected_message"), [ - ("test(test_scope): this is test msg", "this is test msg",), - ("test(test_scope)!: this is test msg", "this is test msg",), - ("test!(test_scope): this is test msg", "",), + ( + "test(test_scope): this is test msg", + "this is test msg", + ), + ( + "test(test_scope)!: this is test msg", + "this is test msg", + ), + ( + "test!(test_scope): this is test msg", + "", + ), ], ) def test_process_commit(commit_message, expected_message, config):