From 154683d58bbdf57e37847dd2ee2244d37ad7d848 Mon Sep 17 00:00:00 2001 From: Stavros Ntentos <133706+stdedos@users.noreply.github.com> Date: Fri, 16 Dec 2022 15:40:42 +0200 Subject: [PATCH] CI requested changes: * `py37` has no `flake8 v6` * `flake8.options.manager.OptionManager` seems to require a `formatter_names` `kwarg` https://github.com/PyCQA/flake8/commit/48b29191303b271a162b3acbdfba3e5cf310b50c etc seem to indicate that `[]` is what we need, "since we are not a formatter library" (Documentation https://flake8.pycqa.org/en/latest/internal/option_handling.html seems non-existent) Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com> --- run_tests.py | 7 +++++++ tox.ini | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/run_tests.py b/run_tests.py index f54e43e..a7aa5a0 100644 --- a/run_tests.py +++ b/run_tests.py @@ -72,10 +72,17 @@ def load_tests(lines): def parse_options(checker, options): """Parse the CLI-style flags from `options` and expose to `checker`""" + extra_kwargs = {} + if int(flake8.__version__.split('.')) >= 6: + extra_kwargs = { + "formatter_names": [] + } + options_manager = OptionManager( version=flake8.__version__, plugin_versions=f"naming: {pep8ext_naming.__version__}", parents=[], + **extra_kwargs, ) options_manager.add_option('--select', default=[]) options_manager.add_option('--extended-default-select', default=['N']) diff --git a/tox.ini b/tox.ini index 119e4e4..2c83421 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py37-flake8{5,6}, + py37-flake86, py38-flake8{5,6}, py39-flake8{5,6}, py310-flake8{5,6},