labgrid-project / labgrid

Embedded systems control library for development, testing and installation
https://labgrid.readthedocs.io/
Other
327 stars 164 forks source link

doctest error with setuptools 71.0.1 #1445

Closed Bastian-Krause closed 1 month ago

Bastian-Krause commented 1 month ago

Scheduled CI runs on master fail in the doctest step (make -C doc doctest SPHINXOPTS=-W) since setuptools 71.0.1 is used: https://github.com/labgrid-project/labgrid/actions/runs/9988119563/job/27603896357

File "usage.rst", line 1091, in pytest-example
Failed example:
    import pytest

    plugins = ['labgrid.pytestplugin']
    pytest.main(['--lg-env', 'shell-example.yaml', 'test_shell.py'], plugins)
Exception raised:
    Traceback (most recent call last):
      File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/doctest.py", line 1368, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest pytest-example[0]>", line 4, in <module>
        pytest.main(['--lg-env', 'shell-example.yaml', 'test_shell.py'], plugins)
      File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/config/__init__.py", line 159, in main
        config = _prepareconfig(args, plugins)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/config/__init__.py", line 346, in _prepareconfig
        config = pluginmanager.hook.pytest_cmdline_parse(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/pluggy/_hooks.py", line 513, in __call__
        return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/pluggy/_manager.py", line 120, in _hookexec
        return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/pluggy/_callers.py", line 139, in _multicall
        raise exception.with_traceback(exception.__traceback__)
      File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/pluggy/_callers.py", line 122, in _multicall
        teardown.throw(exception)  # type: ignore[union-attr]
        ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/helpconfig.py", line 106, in pytest_cmdline_parse
        config = yield
                 ^^^^^
      File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/pluggy/_callers.py", line 103, in _multicall
        res = hook_impl.function(*args)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1152, in pytest_cmdline_parse
        self.parse(args)
      File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1501, in parse
        self._preparse(args, addopts=addopts)
      File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/_pytest/config/__init__.py", line [138](https://github.com/labgrid-project/labgrid/actions/runs/9988119563/job/27603896357#step:12:139)8, in _preparse
        self.pluginmanager.load_setuptools_entrypoints("pytest11")
      File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/pluggy/_manager.py", line 421, in load_setuptools_entrypoints
        plugin = ep.load()
                 ^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/importlib/metadata/__init__.py", line 205, in load
        module = import_module(match.group('module'))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/importlib/__init__.py", line 90, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
      File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 995, in exec_module
      File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
      File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/setuptools/_vendor/typeguard/__init__.py", line 21, in <module>
        from ._importhook import ImportHookManager as ImportHookManager
      File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/setuptools/_vendor/typeguard/_importhook.py", line 35, in <module>
        OPTIMIZATION = "typeguard" + "".join(version("typeguard").split(".")[:3])
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: 'NoneType' object has no attribute 'split'

Tracked in setuptools in issue https://github.com/pypa/setuptools/issues/4480.

Bastian-Krause commented 1 month ago

setuptools 71.0.1 has been yanked: https://pypi.org/project/setuptools/71.0.1/

CI passes again: https://github.com/labgrid-project/labgrid/actions/runs/9988119563/job/27621983100