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

doctest error with setuptools 71.0.1 #1445

Closed
Bastian-Krause opened this issue Jul 18, 2024 · 1 comment
Closed

doctest error with setuptools 71.0.1 #1445

Bastian-Krause opened this issue Jul 18, 2024 · 1 comment
Labels

Comments

@Bastian-Krause
Copy link
Member

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 pypa/setuptools#4480.

@Bastian-Krause
Copy link
Member Author

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

1 participant