agronholm / typeguard

Run-time type checker for Python
Other
1.52k stars 114 forks source link

4.2.1: not ready for pytest 8.2.1 🤔 ? #461

Closed kloczek closed 4 months ago

kloczek commented 4 months ago

Things to check first

Typeguard version

4.2.1

Python version

3.10.14

What happened?

Looks like test suite fails with latest pytest 8.2.1.

Here is pytest output: ```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-typeguard-4.2.1-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-typeguard-4.2.1-2.fc37.x86_64/usr/lib/python3.10/site-packages + /usr/bin/pytest -ra -m 'not network' Traceback (most recent call last): File "/usr/bin/pytest", line 8, in sys.exit(console_main()) File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 206, in console_main code = main() File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 159, in main config = _prepareconfig(args, plugins) File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 346, in _prepareconfig config = pluginmanager.hook.pytest_cmdline_parse( File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] File "/usr/lib/python3.10/site-packages/_pytest/helpconfig.py", line 106, in pytest_cmdline_parse config = yield File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1152, in pytest_cmdline_parse self.parse(args) File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1501, in parse self._preparse(args, addopts=addopts) File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1405, in _preparse self.hook.pytest_load_initial_conftests( File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] File "/usr/lib/python3.10/site-packages/_pytest/warnings.py", line 150, in pytest_load_initial_conftests return (yield) File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] File "/usr/lib/python3.10/site-packages/_pytest/capture.py", line 153, in pytest_load_initial_conftests yield File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1230, in pytest_load_initial_conftests self.pluginmanager._set_initial_conftests( File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 588, in _set_initial_conftests self._try_load_conftest( File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 626, in _try_load_conftest self._loadconftestmodules( File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 666, in _loadconftestmodules mod = self._importconftest( File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 742, in _importconftest self.consider_conftest(mod, registration_name=conftestpath_plugin_name) File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 823, in consider_conftest self.register(conftestmodule, name=registration_name) File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 508, in register plugin_name = super().register(plugin, name) File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 168, in register self._verify_hook(hook, hookimpl) File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 360, in _verify_hook _warn_for_function(argname_warning, hookimpl.function) File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 41, in _warn_for_function warnings.warn_explicit( pytest.PytestRemovedIn9Warning: The (path: py.path.local) argument is deprecated, please use (collection_path: pathlib.Path) see https://docs.pytest.org/en/latest/deprecations.html#py-path-local-arguments-for-hooks-replaced-with-pathlib-path ```
List of installed modules in build env: ```console Package Version ----------------------------- ----------- alabaster 0.7.16 Babel 2.15.0 build 1.2.1 charset-normalizer 3.3.2 defusedxml 0.7.1 docutils 0.20.1 exceptiongroup 1.1.3 idna 3.7 imagesize 1.4.1 importlib_metadata 7.1.0 iniconfig 2.0.0 installer 0.7.0 Jinja2 3.1.4 MarkupSafe 2.1.5 mypy 1.10.0 mypy_extensions 1.0.0 packaging 24.0 pluggy 1.5.0 Pygments 2.18.0 pyproject_hooks 1.0.0 pytest 8.2.1 python-dateutil 2.9.0.post0 requests 2.32.2 setuptools 69.4.0 setuptools-scm 8.1.0 snowballstemmer 2.2.0 Sphinx 7.3.7 sphinx-autodoc-typehints 2.1.0 sphinxcontrib-applehelp 1.0.8 sphinxcontrib-devhelp 1.0.6 sphinxcontrib-htmlhelp 2.0.5 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.7 sphinxcontrib-serializinghtml 1.1.10 tokenize_rt 5.2.0 tomli 2.0.1 typing_extensions 4.12.0 urllib3 2.2.1 wheel 0.43.0 zipp 3.18.2 ```

Please let me know if you need more details or want me to perform some diagnostics.

How can we reproduce the bug?

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

kloczek commented 4 months ago

Tested and ItWorks™️ Thx 👍