Can't configure some variables with setup.cfg (i.e. max-complexity)
$ python -V
Python 3.4.2
$ pip --version
pip 8.0.2 from /home/sk/.virtualenvs/test/lib/python3.4/site-packages (python 3.4)
$ python -c 'import setuptools; print(setuptools.__version__)'
20.1.1
$ flake8 --version
2.5.4 (pep8: 1.7.0, naming: 0.3.3, pyflakes: 1.0.0, mccabe: 0.4.0) CPython 3.4.2 on Linux
I can't override max-complexity variable in setup.cfg:
$ cat setup.cfg
[flake8]
max-complexity = 10
$ python setup.py flake8
running flake8
Traceback (most recent call last):
File "setup.py", line 150, in <module>
'interactive': ["ipython>=2.3.0"],
File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/sk/.virtualenvs/test/lib/python3.4/site-packages/flake8/main.py", line 136, in run
**self.options_dict)
File "/home/sk/.virtualenvs/test/lib/python3.4/site-packages/flake8/engine.py", line 247, in get_style_guide
options_hook(options)
File "/home/sk/.virtualenvs/test/lib/python3.4/site-packages/mccabe.py", line 243, in parse_options
cls.max_complexity = int(options.max_complexity)
TypeError: int() argument must be a string or a number, not 'list'
Similar issue (but for max-line-length) was reported before as https://gitlab.com/pycqa/flake8/issues/23 and was closes as pep8-related. I believe - problem is on your side. In case of max-line-length, traceback slightly different:
$ python setup.py flake8
running flake8
Traceback (most recent call last):
File "setup.py", line 150, in <module>
'interactive': ["ipython>=2.3.0"],
File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/sk/.virtualenvs/test/lib/python3.4/site-packages/flake8/main.py", line 139, in run
report = flake8_style.check_files()
File "/home/sk/.virtualenvs/test/lib/python3.4/site-packages/flake8/engine.py", line 181, in check_files
return self._retry_serial(self._styleguide.check_files, paths=paths)
File "/home/sk/.virtualenvs/test/lib/python3.4/site-packages/flake8/engine.py", line 172, in _retry_serial
return func(*args, **kwargs)
File "/home/sk/.virtualenvs/test/lib/python3.4/site-packages/pep8.py", line 1840, in check_files
self.input_dir(path)
File "/home/sk/.virtualenvs/test/lib/python3.4/site-packages/pep8.py", line 1876, in input_dir
runner(os.path.join(root, filename))
File "/home/sk/.virtualenvs/test/lib/python3.4/site-packages/flake8/engine.py", line 126, in input_file
return fchecker.check_all(expected=expected, line_offset=line_offset)
File "/home/sk/.virtualenvs/test/lib/python3.4/site-packages/pep8.py", line 1582, in check_all
for token in self.generate_tokens():
File "/home/sk/.virtualenvs/test/lib/python3.4/site-packages/pep8.py", line 1534, in generate_tokens
self.maybe_check_physical(token)
File "/home/sk/.virtualenvs/test/lib/python3.4/site-packages/pep8.py", line 1565, in maybe_check_physical
self.check_physical(line + '\n')
File "/home/sk/.virtualenvs/test/lib/python3.4/site-packages/pep8.py", line 1441, in check_physical
result = self.run_check(check, argument_names)
File "/home/sk/.virtualenvs/test/lib/python3.4/site-packages/pep8.py", line 1429, in run_check
return check(*arguments)
File "/home/sk/.virtualenvs/test/lib/python3.4/site-packages/pep8.py", line 212, in maximum_line_length
if length > max_line_length and not noqa(line):
TypeError: unorderable types: int() > list()
I tried (as it was suggested in the above report) to do setuptools upgrade and reinstalling flake8 too, but this was unsuccessful.