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 version 6.0.0 regression in parsing arguments (seen with flake8-import-order extension) #189

Closed
zzzeek opened this issue Nov 23, 2022 · 1 comment · Fixed by #190

Comments

@zzzeek
Copy link
Contributor

zzzeek commented Nov 23, 2022

[classic@photon3 foo]$ virtualenv .venv
created virtual environment CPython3.10.0.final.0-64 in 284ms

[classic@photon3 foo]$ source .venv/bin/activate
(.venv) [classic@photon3 foo]$ pip install flake8 flake8_import_order
Collecting flake8
  Using cached flake8-6.0.0-py2.py3-none-any.whl (57 kB)
Collecting flake8_import_order
  Using cached flake8_import_order-0.18.1-py2.py3-none-any.whl (15 kB)

  ... install continues ...

Successfully installed flake8-6.0.0 flake8_import_order-0.18.1 mccabe-0.7.0 pycodestyle-2.10.0 pyflakes-3.0.0


$  flake8 --bug-report
Traceback (most recent call last):
  File "/home/classic/tmp/foo/.venv/bin/flake8", line 8, in <module>
    sys.exit(main())
  File "/home/classic/tmp/foo/.venv/lib/python3.10/site-packages/flake8/main/cli.py", line 23, in main
    app.run(argv)
  File "/home/classic/tmp/foo/.venv/lib/python3.10/site-packages/flake8/main/application.py", line 198, in run
    self._run(argv)
  File "/home/classic/tmp/foo/.venv/lib/python3.10/site-packages/flake8/main/application.py", line 186, in _run
    self.initialize(argv)
  File "/home/classic/tmp/foo/.venv/lib/python3.10/site-packages/flake8/main/application.py", line 165, in initialize
    self.plugins, self.options = parse_args(argv)
  File "/home/classic/tmp/foo/.venv/lib/python3.10/site-packages/flake8/options/parse_args.py", line 51, in parse_args
    option_manager.register_plugins(plugins)
  File "/home/classic/tmp/foo/.venv/lib/python3.10/site-packages/flake8/options/manager.py", line 259, in register_plugins
    add_options(self)
  File "/home/classic/tmp/foo/.venv/lib/python3.10/site-packages/flake8_import_order/flake8_linter.py", line 44, in add_options
    register_opt(
  File "/home/classic/tmp/foo/.venv/lib/python3.10/site-packages/flake8_import_order/flake8_linter.py", line 98, in register_opt
    parser.add_option(*args, **kwargs)
  File "/home/classic/tmp/foo/.venv/lib/python3.10/site-packages/flake8/options/manager.py", line 281, in add_option
    self._current_group.add_argument(*option_args, **option_kwargs)
  File "/opt/python-3.10.0/lib/python3.10/argparse.py", line 1423, in add_argument
    raise ValueError('%r is not callable' % (type_func,))
ValueError: 'string' is not callable

apparently this is optparse syntax and is no longer supported by flake8

zzzeek added a commit to sqlalchemyorg/flake8-import-order that referenced this issue Nov 23, 2022
flake8 uses only argparse option styles now, use
str instead of "string" for types given.

Fixes: PyCQA#189
sqlalchemy-bot pushed a commit to sqlalchemy/sqlalchemy that referenced this issue Nov 23, 2022
…closed all comments, thank you! I'll get on that right away

pyqca/flake8-import-order does not seem to have a release or a commit
in the past two years, so while I have created an issue and PR [1] [2],
for now vendor our fork so we can get on with things.

Also fix one issue for flake8 6.0

[1] PyCQA/flake8-import-order#189
[2] PyCQA/flake8-import-order#190

Change-Id: I53045f65b8716cceaf2104fccc1d26f80b398fef
References: PyCQA/flake8#1751
sqlalchemy-bot pushed a commit to sqlalchemy/sqlalchemy that referenced this issue Nov 23, 2022
…closed all comments, thank you! I'll get on that right away

pyqca/flake8-import-order does not seem to have a release or a commit
in the past two years, so while I have created an issue and PR [1] [2],
for now vendor our fork so we can get on with things.

Also fix one issue for flake8 6.0

[1] PyCQA/flake8-import-order#189
[2] PyCQA/flake8-import-order#190

Change-Id: I53045f65b8716cceaf2104fccc1d26f80b398fef
References: PyCQA/flake8#1751
(cherry picked from commit fbec926)
alex added a commit to pyca/cryptography that referenced this issue Nov 24, 2022
it's not compatible with the latest flake8-import-order: PyCQA/flake8-import-order#189
reaperhulk pushed a commit to pyca/cryptography that referenced this issue Nov 24, 2022
it's not compatible with the latest flake8-import-order: PyCQA/flake8-import-order#189
sigmavirus24 pushed a commit that referenced this issue Nov 24, 2022
flake8 uses only argparse option styles now, use
str instead of "string" for types given.

Fixes: #189
tristan0x added a commit to BlueBrain/hpc-coding-conventions that referenced this issue Nov 25, 2022
Because latest release of plugin `flake8-import-order` is not working with version 6 of flake8 released on 2022/11/23
See PyCQA/flake8-import-order#189
@sigmavirus24
Copy link
Member

Fix released, thanks for the pull request @zzzeek

tristan0x added a commit to BlueBrain/hpc-coding-conventions that referenced this issue Nov 29, 2022
Because latest release of plugin `flake8-import-order` is not working with version 6 of flake8 released on 2022/11/23
See PyCQA/flake8-import-order#189
jneo8 pushed a commit to canonical/charm-duplicity that referenced this issue Dec 21, 2023
openstack-mirroring pushed a commit to openstack/octavia that referenced this issue Jan 18, 2024
Hacking 6.1.0 pulls flake8 6.1.x which is not compatible[1] with
flake8-import-order 0.12.0 pulled in this branch.

[1] PyCQA/flake8-import-order#189

Change-Id: I5a5d746657da3501fb332361fee6ea25186285f3
openstack-mirroring pushed a commit to openstack/octavia that referenced this issue Jan 18, 2024
Hacking 6.1.0 pulls flake8 6.1.x which is not compatible[1] with
flake8-import-order 0.12.0 pulled in this branch.

[1] PyCQA/flake8-import-order#189

Change-Id: I5a5d746657da3501fb332361fee6ea25186285f3
(cherry picked from commit 421c7fd)
(cherry picked from commit 7d9f291)
openstack-mirroring pushed a commit to openstack/octavia that referenced this issue Jan 18, 2024
Hacking 6.1.0 pulls flake8 6.1.x which is not compatible[1] with
flake8-import-order 0.12.0 pulled in this branch.

[1] PyCQA/flake8-import-order#189

Change-Id: I5a5d746657da3501fb332361fee6ea25186285f3
(cherry picked from commit 421c7fd)
openstack-mirroring pushed a commit to openstack/octavia that referenced this issue Jan 18, 2024
Hacking 6.1.0 pulls flake8 6.1.x which is not compatible[1] with
flake8-import-order 0.12.0 pulled in this branch.

[1] PyCQA/flake8-import-order#189

Change-Id: I5a5d746657da3501fb332361fee6ea25186285f3
(cherry picked from commit 421c7fd)
(cherry picked from commit 7d9f291)
(cherry picked from commit 85f94c2)
(cherry picked from commit fd5185f)
openstack-mirroring pushed a commit to openstack/octavia that referenced this issue Jan 19, 2024
Hacking 6.1.0 pulls flake8 6.1.x which is not compatible[1] with
flake8-import-order 0.12.0 pulled in this branch.

[1] PyCQA/flake8-import-order#189

Change-Id: I5a5d746657da3501fb332361fee6ea25186285f3
(cherry picked from commit 421c7fd)
(cherry picked from commit 7d9f291)
(cherry picked from commit 85f94c2)
nectar-gerrit pushed a commit to NeCTAR-RC/octavia that referenced this issue Apr 17, 2024
Hacking 6.1.0 pulls flake8 6.1.x which is not compatible[1] with
flake8-import-order 0.12.0 pulled in this branch.

[1] PyCQA/flake8-import-order#189

Change-Id: I5a5d746657da3501fb332361fee6ea25186285f3
(cherry picked from commit 421c7fd)
(cherry picked from commit 7d9f291)
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