Skip to content

Commit 3f058ca

Browse files
committed
Test on newer Python and Flake8
1 parent 6df2e22 commit 3f058ca

File tree

8 files changed

+151
-60
lines changed

8 files changed

+151
-60
lines changed

.github/workflows/python_ci.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,24 @@ jobs:
2222
runs-on: "windows-2019"
2323
continue-on-error: ${{ matrix.config.experimental }}
2424
env:
25-
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11,pypy-3.6,pypy-3.7,pypy-3.8,pypy-3.9'
25+
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11,3.12,3.13,pypy-3.6,pypy-3.7,pypy-3.8,pypy-3.9'
2626

2727
strategy:
2828
fail-fast: False
2929
matrix:
3030
config:
31-
- {python-version: "3.6", testenvs: "py36,build", experimental: False}
32-
- {python-version: "3.7", testenvs: "py37,build", experimental: False}
33-
- {python-version: "3.8", testenvs: "py38,build", experimental: False}
34-
- {python-version: "3.9", testenvs: "py39,build", experimental: False}
35-
- {python-version: "3.10", testenvs: "py310,build", experimental: False}
36-
- {python-version: "3.11", testenvs: "py311,build", experimental: False}
37-
- {python-version: "pypy-3.6", testenvs: "pypy36", experimental: False}
38-
- {python-version: "pypy-3.7", testenvs: "pypy37,build", experimental: False}
39-
- {python-version: "pypy-3.8", testenvs: "pypy38,build", experimental: False}
40-
- {python-version: "pypy-3.9-v7.3.15", testenvs: "pypy39,build", experimental: True}
31+
- {python-version: "3.6", testenvs: "py36-flake8{4,5},build", experimental: False}
32+
- {python-version: "3.7", testenvs: "py37-flake8{4,5},build", experimental: False}
33+
- {python-version: "3.8", testenvs: "py38-flake8{4,5,6,7},build", experimental: False}
34+
- {python-version: "3.9", testenvs: "py39-flake8{4,5,6,7},build", experimental: False}
35+
- {python-version: "3.10", testenvs: "py310-flake8{4,5,6,7},build", experimental: False}
36+
- {python-version: "3.11", testenvs: "py311-flake8{4,5,6,7},build", experimental: False}
37+
- {python-version: "3.12", testenvs: "py312-flake8{6,7},build", experimental: False}
38+
- {python-version: "3.13", testenvs: "py313-flake8{6,7},build", experimental: False}
39+
- {python-version: "pypy-3.6", testenvs: "pypy36-flake8{4,5}", experimental: False}
40+
- {python-version: "pypy-3.7", testenvs: "pypy37-flake8{4,5},build", experimental: False}
41+
- {python-version: "pypy-3.8", testenvs: "pypy38-flake8{4,5,6,7},build", experimental: False}
42+
- {python-version: "pypy-3.9-v7.3.15", testenvs: "pypy39-flake8{4,5,6,7},build", experimental: True}
4143

4244
steps:
4345
- name: Checkout 🛎️

.github/workflows/python_ci_linux.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,24 @@ jobs:
2323
runs-on: "ubuntu-20.04"
2424
continue-on-error: ${{ matrix.config.experimental }}
2525
env:
26-
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11,pypy-3.6,pypy-3.7,pypy-3.8,pypy-3.9'
26+
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11,3.12,3.13,pypy-3.6,pypy-3.7,pypy-3.8,pypy-3.9'
2727

2828
strategy:
2929
fail-fast: False
3030
matrix:
3131
config:
32-
- {python-version: "3.6", testenvs: "py36,build", experimental: False}
33-
- {python-version: "3.7", testenvs: "py37,build", experimental: False}
34-
- {python-version: "3.8", testenvs: "py38,build", experimental: False}
35-
- {python-version: "3.9", testenvs: "py39,build", experimental: False}
36-
- {python-version: "3.10", testenvs: "py310,build", experimental: False}
37-
- {python-version: "3.11", testenvs: "py311,build", experimental: False}
38-
- {python-version: "pypy-3.6", testenvs: "pypy36,build", experimental: False}
39-
- {python-version: "pypy-3.7", testenvs: "pypy37,build", experimental: False}
40-
- {python-version: "pypy-3.8", testenvs: "pypy38,build", experimental: False}
41-
- {python-version: "pypy-3.9", testenvs: "pypy39,build", experimental: True}
32+
- {python-version: "3.6", testenvs: "py36-flake8{4,5},build", experimental: False}
33+
- {python-version: "3.7", testenvs: "py37-flake8{4,5},build", experimental: False}
34+
- {python-version: "3.8", testenvs: "py38-flake8{4,5,6,7},build", experimental: False}
35+
- {python-version: "3.9", testenvs: "py39-flake8{4,5,6,7},build", experimental: False}
36+
- {python-version: "3.10", testenvs: "py310-flake8{4,5,6,7},build", experimental: False}
37+
- {python-version: "3.11", testenvs: "py311-flake8{4,5,6,7},build", experimental: False}
38+
- {python-version: "3.12", testenvs: "py312-flake8{6,7},build", experimental: False}
39+
- {python-version: "3.13", testenvs: "py313-flake8{6,7},build", experimental: False}
40+
- {python-version: "pypy-3.6", testenvs: "pypy36-flake8{4,5},build", experimental: False}
41+
- {python-version: "pypy-3.7", testenvs: "pypy37-flake8{4,5},build", experimental: False}
42+
- {python-version: "pypy-3.8", testenvs: "pypy38-flake8{4,5,6,7},build", experimental: False}
43+
- {python-version: "pypy-3.9", testenvs: "pypy39-flake8{4,5,6,7},build", experimental: True}
4244

4345
steps:
4446
- name: Checkout 🛎️

.github/workflows/python_ci_macos.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,23 @@ jobs:
2222
runs-on: "macos-13"
2323
continue-on-error: ${{ matrix.config.experimental }}
2424
env:
25-
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11,pypy-3.7,pypy-3.8,pypy-3.9'
25+
USING_COVERAGE: '3.6,3.7,3.8,3.9,3.10,3.11,3.12,3.13,pypy-3.7,pypy-3.8,pypy-3.9'
2626

2727
strategy:
2828
fail-fast: False
2929
matrix:
3030
config:
31-
- {python-version: "3.6", testenvs: "py36,build", experimental: False}
32-
- {python-version: "3.7", testenvs: "py37,build", experimental: False}
33-
- {python-version: "3.8", testenvs: "py38,build", experimental: False}
34-
- {python-version: "3.9", testenvs: "py39,build", experimental: False}
35-
- {python-version: "3.10", testenvs: "py310,build", experimental: False}
36-
- {python-version: "3.11", testenvs: "py311,build", experimental: False}
37-
- {python-version: "pypy-3.7", testenvs: "pypy37,build", experimental: False}
38-
- {python-version: "pypy-3.8", testenvs: "pypy38,build", experimental: False}
39-
- {python-version: "pypy-3.9", testenvs: "pypy39,build", experimental: True}
31+
- {python-version: "3.6", testenvs: "py36-flake8{4,5},build", experimental: False}
32+
- {python-version: "3.7", testenvs: "py37-flake8{4,5},build", experimental: False}
33+
- {python-version: "3.8", testenvs: "py38-flake8{4,5,6,7},build", experimental: False}
34+
- {python-version: "3.9", testenvs: "py39-flake8{4,5,6,7},build", experimental: False}
35+
- {python-version: "3.10", testenvs: "py310-flake8{4,5,6,7},build", experimental: False}
36+
- {python-version: "3.11", testenvs: "py311-flake8{4,5,6,7},build", experimental: False}
37+
- {python-version: "3.12", testenvs: "py312-flake8{6,7},build", experimental: False}
38+
- {python-version: "3.13", testenvs: "py313-flake8{6,7},build", experimental: False}
39+
- {python-version: "pypy-3.7", testenvs: "pypy37-flake8{4,5},build", experimental: False}
40+
- {python-version: "pypy-3.8", testenvs: "pypy38-flake8{4,5,6,7},build", experimental: False}
41+
- {python-version: "pypy-3.9", testenvs: "pypy39-flake8{4,5,6,7},build", experimental: True}
4042

4143
steps:
4244
- name: Checkout 🛎️

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ base-classifiers = [
3434
"Intended Audience :: Developers",
3535
"Typing :: Typed",
3636
]
37-
python-versions = [ "3.6", "3.7", "3.8", "3.9", "3.10", "3.11",]
37+
python-versions = [ "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13",]
3838
python-implementations = [ "CPython", "PyPy",]
3939
platforms = [ "Windows", "macOS", "Linux",]
4040
license-key = "MIT"

repo_helper.yml

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,42 @@ pre_commit_exclude: "^tests/bad_code.py$"
1818
use_whey: true
1919

2020
python_versions:
21-
- '3.6'
22-
- '3.7'
23-
- '3.8'
24-
- '3.9'
25-
- "3.10"
26-
- "3.11"
27-
# - 3.12-dev # Flake8<5 incompatible
28-
- pypy36
29-
- pypy37
30-
- pypy38
31-
- pypy39
21+
3.6:
22+
matrix_exclude:
23+
flake8:
24+
- 6
25+
- 7
26+
3.7:
27+
matrix_exclude:
28+
flake8:
29+
- 6
30+
- 7
31+
3.8:
32+
3.9:
33+
"3.10":
34+
3.11:
35+
3.12:
36+
matrix_exclude:
37+
flake8:
38+
- 4
39+
- 5
40+
3.13:
41+
matrix_exclude:
42+
flake8:
43+
- 4
44+
- 5
45+
pypy36:
46+
matrix_exclude:
47+
flake8:
48+
- 6
49+
- 7
50+
pypy37:
51+
matrix_exclude:
52+
flake8:
53+
- 6
54+
- 7
55+
pypy38:
56+
pypy39:
3257

3358
additional_ignore:
3459
- action.py
@@ -50,3 +75,10 @@ classifiers:
5075

5176
tox_unmanaged:
5277
- "testenv:lint"
78+
79+
third_party_version_matrix:
80+
flake8:
81+
- 4
82+
- 5
83+
- 6
84+
- 7

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
flake8<5,>=3.8.4
1+
flake8>=3.8.4

tests/test_output.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
# 3rd party
22
import pytest
33
from coincidence.regressions import FileRegressionFixture, check_file_regression
4+
from domdf_python_tools.compat import importlib_metadata
45
from domdf_python_tools.paths import PathPlus
56
from flake8.main import cli # type: ignore
67

78
bad_code = PathPlus(__file__).parent / "bad_code.py"
89

910

1011
def test_output(file_regression: FileRegressionFixture, capsys):
11-
with pytest.raises(SystemExit):
12-
cli.main([str(bad_code), "--select", "F401,F404,F821,F701,E303", "--format", "github"])
12+
args = [str(bad_code), "--select", "F401,F404,F821,F701,E303", "--format", "github"]
13+
14+
if int(importlib_metadata.version("flake8").split('.')[0]) >= 5:
15+
cli.main(args)
16+
17+
else:
18+
with pytest.raises(SystemExit):
19+
cli.main(args)
1320

1421
stdout = capsys.readouterr().out.replace(str(bad_code), "bad_code.py")
1522
check_file_regression(stdout, file_regression)

tox.ini

Lines changed: 59 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@
2222

2323
[tox]
2424
envlist =
25-
py36
26-
py37
27-
py38
28-
py39
29-
py310
30-
py311
31-
pypy36
32-
pypy37
33-
pypy38
34-
pypy39
25+
py36-flake8{4,5}
26+
py37-flake8{4,5}
27+
py38-flake8{4,5,6,7}
28+
py39-flake8{4,5,6,7}
29+
py310-flake8{4,5,6,7}
30+
py311-flake8{4,5,6,7}
31+
py312-flake8{6,7}
32+
py313-flake8{6,7}
33+
pypy36-flake8{4,5}
34+
pypy37-flake8{4,5}
35+
pypy38-flake8{4,5,6,7}
36+
pypy39-flake8{4,5,6,7}
3537
mypy
3638
build
3739
skip_missing_interpreters = True
@@ -43,16 +45,33 @@ requires =
4345
virtualenv!=20.16.0
4446

4547
[envlists]
46-
test = py36, py37, py38, py39, py310, py311, pypy36, pypy37, pypy38, pypy39
48+
test =
49+
py36-flake8{4,5}
50+
py37-flake8{4,5}
51+
py38-flake8{4,5,6,7}
52+
py39-flake8{4,5,6,7}
53+
py310-flake8{4,5,6,7}
54+
py311-flake8{4,5,6,7}
55+
py312-flake8{6,7}
56+
py313-flake8{6,7}
57+
pypy36-flake8{4,5}
58+
pypy37-flake8{4,5}
59+
pypy38-flake8{4,5,6,7}
60+
pypy39-flake8{4,5,6,7}
4761
qa = mypy, lint
48-
cov = py38, coverage
62+
cov = py38-flake84, coverage
4963

5064
[testenv]
5165
setenv =
5266
PYTHONDEVMODE=1
5367
PIP_DISABLE_PIP_VERSION_CHECK=1
5468
SETUPTOOLS_USE_DISTUTILS=stdlib
55-
deps = -r{toxinidir}/tests/requirements.txt
69+
deps =
70+
-r{toxinidir}/tests/requirements.txt
71+
flake84: flake8~=4.0
72+
flake85: flake8~=5.0
73+
flake86: flake8~=6.0
74+
flake87: flake8~=7.0
5675
commands =
5776
python --version
5877
python -m pytest --cov=flake8_github_actions -r aR tests/ {posargs}
@@ -62,6 +81,19 @@ setenv =
6281
PYTHONDEVMODE=1
6382
PIP_DISABLE_PIP_VERSION_CHECK=1
6483

84+
[testenv:py313]
85+
download = True
86+
setenv =
87+
PYTHONDEVMODE=1
88+
PIP_DISABLE_PIP_VERSION_CHECK=1
89+
UNSAFE_PYO3_SKIP_VERSION_CHECK=1
90+
91+
[testenv:py312]
92+
download = True
93+
setenv =
94+
PYTHONDEVMODE=1
95+
PIP_DISABLE_PIP_VERSION_CHECK=1
96+
6597
[testenv:build]
6698
setenv =
6799
PYTHONDEVMODE=1
@@ -176,6 +208,20 @@ filterwarnings =
176208
error
177209
ignore:SelectableGroups dict interface is deprecated. Use select.:DeprecationWarning:flake8
178210
ignore:can't resolve package from __spec__ or __package__, falling back on __name__ and __path__:ImportWarning
211+
ignore:ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead:DeprecationWarning
212+
213+
[testenv:py312-flake8{4,5,6,7}]
214+
download = True
215+
setenv =
216+
PYTHONDEVMODE=1
217+
PIP_DISABLE_PIP_VERSION_CHECK=1
218+
219+
[testenv:py313-flake8{4,5,6,7}]
220+
download = True
221+
setenv =
222+
PYTHONDEVMODE=1
223+
PIP_DISABLE_PIP_VERSION_CHECK=1
224+
UNSAFE_PYO3_SKIP_VERSION_CHECK=1
179225
180226
[testenv:lint]
181227
basepython = python3.8

0 commit comments

Comments
 (0)