Skip to content

Commit af89472

Browse files
authored
Update pep8-naming compatibility with flake8 (#210)
`pep8-naming` tests fail for `flake8` v3/v4; avoid suggesting that it works Additionally, v6 added one more required `kwarg`. Let's add that one too.
1 parent b3492ee commit af89472

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

run_tests.py

+7
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,17 @@ def load_tests(lines):
7272

7373
def parse_options(checker, options):
7474
"""Parse the CLI-style flags from `options` and expose to `checker`"""
75+
extra_kwargs = {}
76+
if flake8.__version_info__[0] >= 6:
77+
extra_kwargs = {
78+
"formatter_names": []
79+
}
80+
7581
options_manager = OptionManager(
7682
version=flake8.__version__,
7783
plugin_versions=f"naming: {pep8ext_naming.__version__}",
7884
parents=[],
85+
**extra_kwargs,
7986
)
8087
options_manager.add_option('--select', default=[])
8188
options_manager.add_option('--extended-default-select', default=['N'])

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def run_tests(self):
4242
license='Expat license',
4343
package_dir={'': 'src'},
4444
py_modules=['pep8ext_naming'],
45-
install_requires=['flake8>=3.9.1'],
45+
install_requires=['flake8>=5.0.0'],
4646
zip_safe=False,
4747
python_requires='>=3.7',
4848
entry_points={

tox.ini

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
[tox]
2-
envlist = py37,py38,py39,py310,py310-flake8,pypy3
2+
envlist =
3+
py37-flake85,
4+
py38-flake8-{v5,v6,latest},
5+
py39-flake8-{v5,v6,latest},
6+
py310-flake8-{v5,v6,latest},
7+
py310-flake8,
8+
pypy3
39

410
[gh-actions]
511
python =
@@ -12,7 +18,9 @@ python =
1218
[testenv]
1319
commands = python run_tests.py
1420
deps =
15-
flake8 >= 5.0.0
21+
flake8-v5: flake8 >= 5.0.0, < 6.0.0
22+
flake8-v6: flake8 >= 6.0.0, < 7.0.0
23+
flake8-latest: flake8
1624

1725
[testenv:py310-flake8]
1826
basepython = python3.10

0 commit comments

Comments
 (0)