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] flake8 version is too old to be compatible with Python 3.12 #47991

Open
MortalHappiness opened this issue Oct 11, 2024 · 1 comment
Open
Assignees
Labels
bug Something that is supposed to be working; but isn't ci-test

Comments

@MortalHappiness
Copy link
Member

What happened + What you expected to happen

While running the pre-commit hook of flake8, the following error occurs if Python version is 3.12.

flake8...................................................................Failed
- hook id: flake8
- exit code: 1

Traceback (most recent call last):
  File "/home/mortalhappiness/.cache/pre-commit/repo785be_6i/py_env-python3.12/bin/flake8", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/mortalhappiness/.cache/pre-commit/repo785be_6i/py_env-python3.12/lib/python3.12/site-packages/flake8/main/cli.py", line 22, in main
    app.run(argv)
  File "/home/mortalhappiness/.cache/pre-commit/repo785be_6i/py_env-python3.12/lib/python3.12/site-packages/flake8/main/application.py", line 363, in run
    self._run(argv)
  File "/home/mortalhappiness/.cache/pre-commit/repo785be_6i/py_env-python3.12/lib/python3.12/site-packages/flake8/main/application.py", line 350, in _run
    self.initialize(argv)
  File "/home/mortalhappiness/.cache/pre-commit/repo785be_6i/py_env-python3.12/lib/python3.12/site-packages/flake8/main/application.py", line 330, in initialize
    self.find_plugins(config_finder)
  File "/home/mortalhappiness/.cache/pre-commit/repo785be_6i/py_env-python3.12/lib/python3.12/site-packages/flake8/main/application.py", line 153, in find_plugins
    self.check_plugins = plugin_manager.Checkers(local_plugins.extension)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mortalhappiness/.cache/pre-commit/repo785be_6i/py_env-python3.12/lib/python3.12/site-packages/flake8/plugins/manager.py", line 356, in __init__
    self.manager = PluginManager(
                   ^^^^^^^^^^^^^^
  File "/home/mortalhappiness/.cache/pre-commit/repo785be_6i/py_env-python3.12/lib/python3.12/site-packages/flake8/plugins/manager.py", line 238, in __init__
    self._load_entrypoint_plugins()
  File "/home/mortalhappiness/.cache/pre-commit/repo785be_6i/py_env-python3.12/lib/python3.12/site-packages/flake8/plugins/manager.py", line 254, in _load_entrypoint_plugins
    eps = importlib_metadata.entry_points().get(self.namespace, ())
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'EntryPoints' object has no attribute 'get'

Versions / Dependencies

Python 3.12

Reproduction script

If python version is 3.9 -> no error

If python version is 3.12 -> has error

Upgrade the following packages to the newest version solves this issue:

  • flake8
  • flake8-comprehensions
  • flake8-quotes
  • flake8-bugbear

Issue Severity

Low: It annoys or frustrates me.

@MortalHappiness MortalHappiness added bug Something that is supposed to be working; but isn't ci-test labels Oct 11, 2024
@CheyuWu
Copy link

CheyuWu commented Oct 11, 2024

@MortalHappiness I'd like to help with this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to be working; but isn't ci-test
Projects
None yet
Development

No branches or pull requests

2 participants