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

pluggy._manager.PluginValidationError: Plugin 'ruff' for hook 'pytest_collect_file' #15

Closed
petrchiriboga opened this issue Mar 4, 2024 · 3 comments · Fixed by #16
Closed

Comments

@petrchiriboga
Copy link

Hi All,

We have found that new version 0.3 doesn't work with pytest 8.1.0, we are getting the following stack trace with that combination.

Traceback (most recent call last):
  File "/home/runner/actions-runner/_work/_tool/Python/3.8.18/x64/bin/pytest", line 8, in <module>
    sys.exit(console_main())
  File "/home/runner/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/config/__init__.py", line 19[5](), in console_main
    code = main()
  File "/home/runner/actions-runner/_work/_tool/Python/3.8.18/x[6]()4/lib/python3.8/site-packages/_pytest/config/__init__.py", line 153, in main
    config = _prepareconfig(args, plugins)
  File "/home/runner/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/config/__init__.py", line 335, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
  File "/home/runner/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_hooks.py", line 501, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  File "/home/runner/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_manager.py", line 119, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/home/runner/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_callers.py", line 138, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "/home/runner/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_callers.py", line 121, in _multicall
    teardown.throw(exception)  # type: ignore[union-attr]
  File "/home/runner/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/helpconfig.py", line 105, in pytest_cmdline_parse
    config = yield
  File "/home/runner/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_callers.py", line 102, in _multicall
    res = hook_impl.function(*args)
  File "/home/runner/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1141, in pytest_cmdline_parse
    self.parse(args)
  File "/home/runner/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1490, in parse
    self._preparse(args, addopts=addopts)
  File "/home/runner/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/config/__init__.py", line 13[7]()7, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/home/runner/actions-runner/_work/_tool/Python/3.[8]().18/x64/lib/python3.8/site-packages/pluggy/_manager.py", line 415, in load_setuptools_entrypoints
    self.register(plugin, name=ep.name)
  File "/home/runner/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/_pytest/config/__init__.py", line 4[9]()7, in register
    plugin_name = super().register(plugin, name)
  File "/home/runner/actions-runner/_work/_tool/Python/3.8.18/x64/lib/python3.8/site-packages/pluggy/_manager.py", line [16](7)7, in register
    self._verify_hook(hook, hookimpl)
  File "/home/runner/actions-runner/_work/_tool/Python/3.8.[18](9)/x64/lib/python3.8/site-packages/pluggy/_manager.py", line [34](5)2, in _verify_hook
    raise PluginValidationError(
pluggy._manager.PluginValidationError: Plugin 'ruff' for hook 'pytest_collect_file'
hookimpl definition: pytest_collect_file(path, parent, fspath=None)
Argument(s) {'path'} are declared in the hookimpl but can not be found in the hookspec

For the moment we have fallback to pytest-ruff 0.2.1 and pytest 8.0.2, we also found out that 8.1.0 pytest doesn't play either with 0.2.1 different stack trace.

Happy to get more information if you guys need any help,

@petrchiriboga
Copy link
Author

petrchiriboga commented Mar 4, 2024

Reference : pytest-dev/pytest#11779

@iurisilvio
Copy link
Contributor

Pytest 8.1 was yanked. pytest-dev/pytest#12069

I'll wait for the new release before merging the fix.

davvid added a commit to davvid/jsonpickle that referenced this issue Mar 8, 2024
@iurisilvio
Copy link
Contributor

Pytest 8.1.1 works great, without any fix.

I see the deprecated removal was postponed, I'd expect some deprecation warning.

For now, we're safe, but I'll keep the issue and PR open until I understand how to properly test it.

davvid referenced this issue in jsonpickle/jsonpickle Mar 12, 2024
* Fix #478 by whitelisting str for skipping read-only attrs

* Add changelog entry for str errors

* Move new fix from 3.0.3 to 3.0.4
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