Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flake8 v6 alueError: 'choice' is not callable #1758

Closed
RyoYang opened this issue Nov 24, 2022 · 3 comments
Closed

flake8 v6 alueError: 'choice' is not callable #1758

RyoYang opened this issue Nov 24, 2022 · 3 comments
Labels

Comments

@RyoYang
Copy link

RyoYang commented Nov 24, 2022

how did you install flake8?

`pip install flake8>=3.8.4`

unmodified output of flake8 --bug-report

Success: no issues found in 173 source files
Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/conda/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/superbench_azpcontainer/.local/lib/python3.8/site-packages/flake8/__main__.py", line 7, in <module>
    raise SystemExit(main())
  File "/home/superbench_azpcontainer/.local/lib/python3.8/site-packages/flake8/main/cli.py", line 23, in main
    app.run(argv)
  File "/home/superbench_azpcontainer/.local/lib/python3.8/site-packages/flake8/main/application.py", line 198, in run
    self._run(argv)
  File "/home/superbench_azpcontainer/.local/lib/python3.8/site-packages/flake8/main/application.py", line 186, in _run
    self.initialize(argv)
  File "/home/superbench_azpcontainer/.local/lib/python3.8/site-packages/flake8/main/application.py", line 165, in initialize
    self.plugins, self.options = parse_args(argv)
  File "/home/superbench_azpcontainer/.local/lib/python3.8/site-packages/flake8/options/parse_args.py", line 51, in parse_args
    option_manager.register_plugins(plugins)
  File "/home/superbench_azpcontainer/.local/lib/python3.8/site-packages/flake8/options/manager.py", line 259, in register_plugins
    add_options(self)
  File "/home/superbench_azpcontainer/.local/lib/python3.8/site-packages/flake8_quotes/__init__.py", line 109, in add_options
    cls._register_opt(parser, '--quotes', action='store',
  File "/home/superbench_azpcontainer/.local/lib/python3.8/site-packages/flake8_quotes/__init__.py", line 99, in _register_opt
    parser.add_option(*args, **kwargs)
  File "/home/superbench_azpcontainer/.local/lib/python3.8/site-packages/flake8/options/manager.py", line 281, in add_option
    self._current_group.add_argument(*option_args, **option_kwargs)
  File "/opt/conda/lib/python3.8/argparse.py", line 1373, in add_argument
    raise ValueError('%r is not callable' % (type_func,))
ValueError: 'choice' is not callable
##[error]Bash exited with code '1'.

describe the problem

what I expected to happen

Can not use flake8 in pipeline after updating to v6

@jparisu
Copy link

jparisu commented Nov 24, 2022

I am having the same problem.
I checked the documentation and it does not seem to say that multiple files could be passed as argument. But in 5.0.4 could be done (and it was quite useful).

@looztra
Copy link

looztra commented Nov 24, 2022

Same error for me using python 3.9.15
I don't have the problem with python 3.10.7

@asottile
Copy link
Member

please report this to the plugin in question. optparse support has been deprecated for 2 years and warning about it and finally removed.

@PyCQA PyCQA locked as resolved and limited conversation to collaborators Nov 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants