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

CI issues after flake8 has been bumped to 6.0.0 #342

Closed
DimitriPapadopoulos opened this issue Dec 1, 2022 · 2 comments
Closed

CI issues after flake8 has been bumped to 6.0.0 #342

DimitriPapadopoulos opened this issue Dec 1, 2022 · 2 comments

Comments

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Dec 1, 2022

PyCQA/flake8#1760

  • 'choice' is not callable

    partial error backtrace from CI logs
       File "/home/runner/work/python-stdnum/python-stdnum/.tox/flake8/lib/python3.11/site-packages/flake8/main/application.py", line 165, in initialize
        self.plugins, self.options = parse_args(argv)
                                     ^^^^^^^^^^^^^^^^
      File "/home/runner/work/python-stdnum/python-stdnum/.tox/flake8/lib/python3.11/site-packages/flake8/options/parse_args.py", line 51, in parse_args
        option_manager.register_plugins(plugins)
      File "/home/runner/work/python-stdnum/python-stdnum/.tox/flake8/lib/python3.11/site-packages/flake8/options/manager.py", line 259, in register_plugins
        add_options(self)
      File "/home/runner/work/python-stdnum/python-stdnum/.tox/flake8/lib/python3.11/site-packages/flake8_quotes/__init__.py", line 109, in add_options
        cls._register_opt(parser, '--quotes', action='store',
      File "/home/runner/work/python-stdnum/python-stdnum/.tox/flake8/lib/python3.11/site-packages/flake8_quotes/__init__.py", line 99, in _register_opt
        parser.add_option(*args, **kwargs)
      File "/home/runner/work/python-stdnum/python-stdnum/.tox/flake8/lib/python3.11/site-packages/flake8/options/manager.py", line 281, in add_option
        self._current_group.add_argument(*option_args, **option_kwargs)
      File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/argparse.py", line 1448, in add_argument
        raise ValueError('%r is not callable' % (type_func,))
    ValueError: 'choice' is not callable
    ERROR: InvocationError for command /home/runner/work/python-stdnum/python-stdnum/.tox/flake8/bin/flake8 stdnum tests update setup.py (exited with code 1)
    

    Plugin flake8-quotes is incompatible with flake8 v6, see Incompatibility with flake8 v6 zheller/flake8-quotes#110. Either we disable flake8-quotes in CI, or we pin flake8 to v5.

  • ValueError: Error code '#' supplied to 'ignore' option does not match '^[A-Z]{1,3}[0-9]{0,3}$'

    partial error backtrace from CI logs
      File "/home/runner/work/python-stdnum/python-stdnum/.tox/flake8/lib/python3.11/site-packages/flake8/main/application.py", line 165, in initialize
        self.plugins, self.options = parse_args(argv)
                                     ^^^^^^^^^^^^^^^^
      File "/home/runner/work/python-stdnum/python-stdnum/.tox/flake8/lib/python3.11/site-packages/flake8/options/parse_args.py", line 53, in parse_args
        opts = aggregator.aggregate_options(option_manager, cfg, cfg_dir, rest)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/runner/work/python-stdnum/python-stdnum/.tox/flake8/lib/python3.11/site-packages/flake8/options/aggregator.py", line 30, in aggregate_options
        parsed_config = config.parse_config(manager, cfg, cfg_dir)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/runner/work/python-stdnum/python-stdnum/.tox/flake8/lib/python3.11/site-packages/flake8/options/config.py", line 131, in parse_config
        raise ValueError(
    ValueError: Error code '#' supplied to 'ignore' option does not match '^[A-Z]{1,3}[0-9]{0,3}$'
    ERROR: InvocationError for command /home/runner/work/python-stdnum/python-stdnum/.tox/flake8/bin/flake8 stdnum tests update setup.py (exited with code 1)
    

    The syntax of setup.cfg is incorrect. While pinning flake8 will silence this error, we can easily fix the root cause.

@arthurdejong
Copy link
Owner

In 7a91a98 flake8 was pinned to avoid version 6.0 but since then I've not seem much movement in flake8. In #410 it was suggested to use ruff in place of flake8 which seems promising (but it is a bit weird to have a tool written in Rust and flake8 performance has never been a thing that I thought was a problem).

Anyway, I'm closing this issue due to the fix in 7a91a98 but if there are other concerns feel free to re-open or add feedback to any of the other issues.

@DimitriPapadopoulos
Copy link
Contributor Author

It looks like flake8-quotes has been updated to support flake8 6.0:
zheller/flake8-quotes#111

An alternative to 7a91a98 would be to require version 3.3.2 released on 19 December 2022.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants