core icon indicating copy to clipboard operation
core copied to clipboard

`execnet` missing in deltachat-rpc-client's pyproject.toml

Open missytake opened this issue 1 month ago • 1 comments

  • Operating System (Linux/Mac/Windows/iOS/Android): xubuntu 24.04
  • Core Version: 2.23.0
  • Client Version:

Expected behavior

I tried running the chatmail/relay tests with:

cd chatmaild
pipx run tox

And expected the tests to import deltachat-rpc-client's testplugin without problem.

Actual behavior

Instead I saw a ModuleNotFoundError, because execnet isn't installed. Since https://github.com/chatmail/core/commit/d75a78d4463787b223e199c2f546908c0cf5009d it is imported in deltachat-rpc-client's testplugin.py.

But execnet doesn't appear in https://github.com/chatmail/core/blob/main/deltachat-rpc-client/pyproject.toml, and is not automatically installed, so programs which import deltachat-rpc-client don't install it automatically either. I don't know whether it should be a dependency or a devDependency, but somehow we need to add it.

Steps to reproduce the problem

  1. git clone github.com/chatmail/relay/
  2. cd relay/chatmaild
  3. pipx run tox

Logs

⚠️  tox is already on your PATH and installed at /home/user/.local/bin/tox. Downloading and running anyway.
lint: commands[0]> ruff format --quiet --diff src/
lint: commands[1]> ruff check src/
All checks passed!
lint: OK ✔ in 0.1 seconds
.pkg: _optional_hooks> python /home/user/.cache/pipx/4dda6e8601a4f42/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: get_requires_for_build_sdist> python /home/user/.cache/pipx/4dda6e8601a4f42/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: build_sdist> python /home/user/.cache/pipx/4dda6e8601a4f42/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta
py: install_package> python -I -m pip install --force-reinstall --no-deps /home/user/code/pyinfra-sysadmin/servers/nine.testrun.org/chatmail/chatmaild/.tox/.tmp/package/10/chatmaild-0.2.tar.gz
py: commands[0]> pytest -v -rsXx
Traceback (most recent call last):
  File "/home/user/code/pyinfra-sysadmin/servers/nine.testrun.org/chatmail/chatmaild/.tox/py/bin/pytest", line 7, in <module>
    sys.exit(console_main())
             ^^^^^^^^^^^^^^
  File "/home/user/code/pyinfra-sysadmin/servers/nine.testrun.org/chatmail/chatmaild/.tox/py/lib/python3.12/site-packages/_pytest/config/__init__.py", line 221, in console_main
    code = main()
           ^^^^^^
  File "/home/user/code/pyinfra-sysadmin/servers/nine.testrun.org/chatmail/chatmaild/.tox/py/lib/python3.12/site-packages/_pytest/config/__init__.py", line 191, in main
    config = _prepareconfig(new_args, plugins)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/code/pyinfra-sysadmin/servers/nine.testrun.org/chatmail/chatmaild/.tox/py/lib/python3.12/site-packages/_pytest/config/__init__.py", line 358, in _prepareconfig
    config: Config = pluginmanager.hook.pytest_cmdline_parse(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/code/pyinfra-sysadmin/servers/nine.testrun.org/chatmail/chatmaild/.tox/py/lib/python3.12/site-packages/pluggy/_hooks.py", line 512, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/code/pyinfra-sysadmin/servers/nine.testrun.org/chatmail/chatmaild/.tox/py/lib/python3.12/site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/code/pyinfra-sysadmin/servers/nine.testrun.org/chatmail/chatmaild/.tox/py/lib/python3.12/site-packages/pluggy/_callers.py", line 167, in _multicall
    raise exception
  File "/home/user/code/pyinfra-sysadmin/servers/nine.testrun.org/chatmail/chatmaild/.tox/py/lib/python3.12/site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File "/home/user/code/pyinfra-sysadmin/servers/nine.testrun.org/chatmail/chatmaild/.tox/py/lib/python3.12/site-packages/_pytest/helpconfig.py", line 124, in pytest_cmdline_parse
    config = yield
             ^^^^^
  File "/home/user/code/pyinfra-sysadmin/servers/nine.testrun.org/chatmail/chatmaild/.tox/py/lib/python3.12/site-packages/pluggy/_callers.py", line 121, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/code/pyinfra-sysadmin/servers/nine.testrun.org/chatmail/chatmaild/.tox/py/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1155, in pytest_cmdline_parse
    self.parse(args)
  File "/home/user/code/pyinfra-sysadmin/servers/nine.testrun.org/chatmail/chatmaild/.tox/py/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1508, in parse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/home/user/code/pyinfra-sysadmin/servers/nine.testrun.org/chatmail/chatmaild/.tox/py/lib/python3.12/site-packages/pluggy/_manager.py", line 416, in load_setuptools_entrypoints
    plugin = ep.load()
             ^^^^^^^^^
  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 205, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/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 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "/home/user/code/pyinfra-sysadmin/servers/nine.testrun.org/chatmail/chatmaild/.tox/py/lib/python3.12/site-packages/_pytest/assertion/rewrite.py", line 197, in exec_module
    exec(co, module.__dict__)
  File "/home/user/code/pyinfra-sysadmin/servers/nine.testrun.org/chatmail/chatmaild/.tox/py/lib/python3.12/site-packages/deltachat_rpc_client/pytestplugin.py", line 13, in <module>
    import execnet
ModuleNotFoundError: No module named 'execnet'
py: exit 1 (0.38 seconds) /home/user/code/pyinfra-sysadmin/servers/nine.testrun.org/chatmail/chatmaild> pytest -v -rsXx pid=688435
  lint: OK (0.10=setup[0.06]+cmd[0.02,0.02] seconds)
  py: FAIL code 1 (5.20=setup[4.82]+cmd[0.38] seconds)
  evaluation failed :( (5.34 seconds)

missytake avatar Dec 06 '25 19:12 missytake

It is only needed for test plugin, and is installed as a dependency of pytest-xdist already if you install "dev" dependency-group, that's why the tests work.

I install it in https://github.com/chatmail/relay/pull/750

link2xt avatar Dec 06 '25 19:12 link2xt