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 extension is incompatible with Flake8 6 #22

Closed
mdickinson opened this issue Dec 7, 2022 · 1 comment · Fixed by #21
Closed

Flake8 extension is incompatible with Flake8 6 #22

mdickinson opened this issue Dec 7, 2022 · 1 comment · Fixed by #21

Comments

@mdickinson
Copy link
Member

This extension is incompatible with the recently-released flake8 6.0. Attempting to run flake8 on the extension gives the following output:

(ets-copyright-checker) mdickinson@mirzakhani ets-copyright-checker % python -m flake8
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/mdickinson/.venvs/ets-copyright-checker/lib/python3.10/site-packages/flake8/__main__.py", line 7, in <module>
    raise SystemExit(main())
  File "/Users/mdickinson/.venvs/ets-copyright-checker/lib/python3.10/site-packages/flake8/main/cli.py", line 23, in main
    app.run(argv)
  File "/Users/mdickinson/.venvs/ets-copyright-checker/lib/python3.10/site-packages/flake8/main/application.py", line 198, in run
    self._run(argv)
  File "/Users/mdickinson/.venvs/ets-copyright-checker/lib/python3.10/site-packages/flake8/main/application.py", line 186, in _run
    self.initialize(argv)
  File "/Users/mdickinson/.venvs/ets-copyright-checker/lib/python3.10/site-packages/flake8/main/application.py", line 165, in initialize
    self.plugins, self.options = parse_args(argv)
  File "/Users/mdickinson/.venvs/ets-copyright-checker/lib/python3.10/site-packages/flake8/options/parse_args.py", line 51, in parse_args
    option_manager.register_plugins(plugins)
  File "/Users/mdickinson/.venvs/ets-copyright-checker/lib/python3.10/site-packages/flake8/options/manager.py", line 259, in register_plugins
    add_options(self)
  File "/Users/mdickinson/Enthought/ETS/ets-copyright-checker/flake8_ets/copyright_header.py", line 189, in add_options
    option_manager.add_option(
  File "/Users/mdickinson/.venvs/ets-copyright-checker/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/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/argparse.py", line 1428, in add_argument
    raise ValueError('%r is not callable' % (type_func,))
ValueError: 'int' is not callable

A secondary problem is that our current CI doesn't pick up the issue, since it only works with flake8 from EDM. We should have a workflow that uses the latest flake8 from PyPI.

@mdickinson
Copy link
Member Author

See PyCQA/flake8#1739 for the relevant upstream change.

mdickinson added a commit that referenced this issue Dec 7, 2022
This PR:

- Adds a non-EDM-based test workflow (which fails with the bug
identified with #22)
- Fixes that bug.

Closes #22
mdickinson added a commit that referenced this issue Dec 7, 2022
This PR:

- Adds a non-EDM-based test workflow (which fails with the bug
identified with #22)
- Fixes that bug.

Closes #22

(cherry picked from commit 1fb4847)
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.

1 participant