From ee73478ef71795fa14c8a632cea17c7951085e16 Mon Sep 17 00:00:00 2001 From: Kenichi Maehashi <939877+kmaehashi@users.noreply.github.com> Date: Sat, 7 Sep 2024 17:05:54 +0900 Subject: [PATCH 1/3] add CI for Python 3.12 & Flake8 v7 --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a128a52..0fd937d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,11 +11,12 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] flake8: [ 'flake8==4.*', 'flake8==5.*', 'flake8==6.*', + 'flake8==7.*', 'git+https://github.com/pycqa/flake8.git@main', ] exclude: @@ -23,6 +24,8 @@ jobs: flake8: 'git+https://github.com/pycqa/flake8.git@main' - python: '3.7' flake8: 'flake8==6.*' + - python: '3.7' + flake8: 'flake8==7.*' steps: - name: Git Checkout From 694b15bf84d7e076a37bbca6f1ac011ed1ffe2c8 Mon Sep 17 00:00:00 2001 From: Kenichi Maehashi Date: Sun, 8 Sep 2024 03:51:09 +0000 Subject: [PATCH 2/3] fix for Python 3.12 --- tests/test_flake8_force.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/test_flake8_force.py b/tests/test_flake8_force.py index fbfe388..fceb4f2 100644 --- a/tests/test_flake8_force.py +++ b/tests/test_flake8_force.py @@ -57,10 +57,17 @@ def test_invalid_token(): results_force = _flake8("invalid_token.py", force=True) assert len(results_force) == 2 - assert results_force[0] == results[0] - assert results_force[1].row == 2 - assert results_force[1].code == "E902" - assert "TokenError" in results_force[1].text + if results_force[0] == results[0]: + # Python 3.11 or earlier + token_error = results_force[1] + assert token_error.row == 2 + else: + # Python 3.12+ + assert results_force[1] == results[0] # SyntaxError + token_error = results_force[0] + assert token_error.row == 1 + assert token_error.code == "E902" + assert "TokenError" in token_error.text def test_invalid_indent(): From bb66bae9cadaf01c251ae8abb668d70a5139299c Mon Sep 17 00:00:00 2001 From: Kenichi Maehashi Date: Sun, 8 Sep 2024 07:00:58 +0000 Subject: [PATCH 3/3] exclude unsupported Python 3.12 + flake8 v4 --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0fd937d..1b6370e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,10 +22,12 @@ jobs: exclude: - python: '3.7' flake8: 'git+https://github.com/pycqa/flake8.git@main' - - python: '3.7' - flake8: 'flake8==6.*' - python: '3.7' flake8: 'flake8==7.*' + - python: '3.7' + flake8: 'flake8==6.*' + - python: '3.12' + flake8: 'flake8==4.*' steps: - name: Git Checkout