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 broken #124

Open
Romern opened this issue Sep 12, 2024 · 4 comments
Open

CI broken #124

Romern opened this issue Sep 12, 2024 · 4 comments

Comments

@Romern
Copy link
Owner

Romern commented Sep 12, 2024

Run flake8 syncmymoodle
Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.10/site-packages/flake8/plugins/finder.py", line 291, in _load_plugin
    obj = plugin.entry_point.load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/runner/.local/lib/python3.10/site-packages/bugbear.py", line 49, in <module>
    @attr.s(unsafe_hash=False)
TypeError: attrs() got an unexpected keyword argument 'unsafe_hash'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/.local/bin/flake8", line 8, in <module>
    sys.exit(main())
  File "/home/runner/.local/lib/python3.10/site-packages/flake8/main/cli.py", line 23, in main
    app.run(argv)
  File "/home/runner/.local/lib/python3.10/site-packages/flake8/main/application.py", line 198, in run
    self._run(argv)
  File "/home/runner/.local/lib/python3.10/site-packages/flake8/main/application.py", line 186, in _run
    self.initialize(argv)
  File "/home/runner/.local/lib/python3.10/site-packages/flake8/main/application.py", line 165, in initialize
    self.plugins, self.options = parse_args(argv)
  File "/home/runner/.local/lib/python3.10/site-packages/flake8/options/parse_args.py", line 42, in parse_args
    plugins = finder.load_plugins(raw_plugins, plugin_opts)
  File "/home/runner/.local/lib/python3.10/site-packages/flake8/plugins/finder.py", line 365, in load_plugins
    return _classify_plugins(_import_plugins(plugins, opts), opts)
  File "/home/runner/.local/lib/python3.10/site-packages/flake8/plugins/finder.py", line 307, in _import_plugins
    return [_load_plugin(p) for p in plugins]
  File "/home/runner/.local/lib/python3.10/site-packages/flake8/plugins/finder.py", line 307, in <listcomp>
    return [_load_plugin(p) for p in plugins]
  File "/home/runner/.local/lib/python3.10/site-packages/flake8/plugins/finder.py", line 293, in _load_plugin
    raise FailedToLoadPlugin(plugin.package, e)
flake8.exceptions.FailedToLoadPlugin: Flake8 failed to load plugin "flake8-bugbear" due to attrs() got an unexpected keyword argument 'unsafe_hash'.

https://github.com/Romern/syncMyMoodle/actions/runs/10824777198/job/30032576313

@D-VR
Copy link
Collaborator

D-VR commented Sep 23, 2024

Seems to be because of PyCQA/flake8-bugbear#486 and PyCQA/flake8-bugbear#490

When bugbear gets a new release it will be resolved (attrs version is not compatible otherwise?)
Otherwise we could add a attrs requirement

@septatrix
Copy link
Collaborator

Or we could replace flake with ruff

@D-VR
Copy link
Collaborator

D-VR commented Sep 23, 2024

Ruff seems like it could also replace black and isort.
I'd be for replacing all three tools with Ruff, imo you can make a PR for it, unless someone is of another opinion

@D-VR
Copy link
Collaborator

D-VR commented Sep 23, 2024

According to this, ruff even supports bugbear, so it would be a drop-in replacement

https://docs.astral.sh/ruff/faq/#how-does-ruffs-linter-compare-to-flake8

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

No branches or pull requests

3 participants