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

TST: all CI is broken by pytest 8.1.0 #16146

Closed
neutrinoceros opened this issue Mar 4, 2024 · 8 comments
Closed

TST: all CI is broken by pytest 8.1.0 #16146

neutrinoceros opened this issue Mar 4, 2024 · 8 comments
Labels

Comments

@neutrinoceros
Copy link
Contributor

Running pytest astropy crashes at startup with

pluggy._manager.PluginValidationError: Plugin 'pytest_filter_subpackage' for hook 'pytest_ignore_collect'
hookimpl definition: pytest_ignore_collect(path, config)
Argument(s) {'path'} are declared in the hookimpl but can not be found in the hookspec
Full Traceback
Traceback (most recent call last):
  File "/Users/clm/.pyenv/versions/astropy.devdeps/bin/pytest", line 8, in <module>
    sys.exit(console_main())
             ^^^^^^^^^^^^^^
  File "/Users/clm/.pyenv/versions/astropy.devdeps/lib/python3.12/site-packages/_pytest/config/__init__.py", line 195, in console_main
    code = main()
           ^^^^^^
  File "/Users/clm/.pyenv/versions/astropy.devdeps/lib/python3.12/site-packages/_pytest/config/__init__.py", line 153, in main
    config = _prepareconfig(args, plugins)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/clm/.pyenv/versions/astropy.devdeps/lib/python3.12/site-packages/_pytest/config/__init__.py", line 335, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/clm/.pyenv/versions/astropy.devdeps/lib/python3.12/site-packages/pluggy/_hooks.py", line 501, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/clm/.pyenv/versions/astropy.devdeps/lib/python3.12/site-packages/pluggy/_manager.py", line 119, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/clm/.pyenv/versions/astropy.devdeps/lib/python3.12/site-packages/pluggy/_callers.py", line 138, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "/Users/clm/.pyenv/versions/astropy.devdeps/lib/python3.12/site-packages/pluggy/_callers.py", line 121, in _multicall
    teardown.throw(exception)  # type: ignore[union-attr]
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/clm/.pyenv/versions/astropy.devdeps/lib/python3.12/site-packages/_pytest/helpconfig.py", line 105, in pytest_cmdline_parse
    config = yield
             ^^^^^
  File "/Users/clm/.pyenv/versions/astropy.devdeps/lib/python3.12/site-packages/pluggy/_callers.py", line 102, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/clm/.pyenv/versions/astropy.devdeps/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1141, in pytest_cmdline_parse
    self.parse(args)
  File "/Users/clm/.pyenv/versions/astropy.devdeps/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1490, in parse
    self._preparse(args, addopts=addopts)
  File "/Users/clm/.pyenv/versions/astropy.devdeps/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1377, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/Users/clm/.pyenv/versions/astropy.devdeps/lib/python3.12/site-packages/pluggy/_manager.py", line 415, in load_setuptools_entrypoints
    self.register(plugin, name=ep.name)
  File "/Users/clm/.pyenv/versions/astropy.devdeps/lib/python3.12/site-packages/_pytest/config/__init__.py", line 497, in register
    plugin_name = super().register(plugin, name)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/clm/.pyenv/versions/astropy.devdeps/lib/python3.12/site-packages/pluggy/_manager.py", line 167, in register
    self._verify_hook(hook, hookimpl)
  File "/Users/clm/.pyenv/versions/astropy.devdeps/lib/python3.12/site-packages/pluggy/_manager.py", line 342, in _verify_hook
    raise PluginValidationError(
pluggy._manager.PluginValidationError: Plugin 'pytest_filter_subpackage' for hook 'pytest_ignore_collect'
hookimpl definition: pytest_ignore_collect(path, config)
Argument(s) {'path'} are declared in the hookimpl but can not be found in the hookspec

Example Logs

pytest 8.1's release notes read that some internal changes may break user plugins, which seems to be what we're seeing here, however this exact change isn't mentioned, so it's not 100% clear whether this should be fixed in pytest_filter_subpackage or pytest itself yet. Will report upstream when I know more. In the mean time, an obvious mitigation we can apply on our side is to pin pytest.

@matteobachetti
Copy link
Contributor

In affiliated packages too, as expected https://github.com/StingraySoftware/stingray/actions/runs/8136691328/job/22233514077

@MridulS
Copy link
Contributor

MridulS commented Mar 4, 2024

Just for ref: this is across the pytest plugin infrastructure pytest-dev/pytest#12069

Let's quickly get #16147 in to make our CIs happy.

@effigies
Copy link

effigies commented Mar 4, 2024

@pllim pllim added testing 🔥 Critical labels Mar 4, 2024
@pllim
Copy link
Member

pllim commented Mar 4, 2024

How is this possible? We test against pytest-dev and it never came up. 😩

@effigies
Copy link

effigies commented Mar 4, 2024

They consider the failure to remove in the 8.0 release a bug: pytest-dev/pytest#12069

Looks like they're reverting, though.

@MridulS
Copy link
Contributor

MridulS commented Mar 4, 2024

It's being yanked, @pllim we need a new release of doctest-plus

@pllim
Copy link
Member

pllim commented Mar 4, 2024

I released pytest-doctestplus anyway, so this should no longer be a problem going forward.

@pllim pllim closed this as completed Mar 4, 2024
@pllim
Copy link
Member

pllim commented Mar 4, 2024

For completeness, I also released pytest-filter-subpackage .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants