#1146037 python-hupper: FTBFS: ModuleNotFoundError: No module named 'pytest_cov.embed'

#1146037#5
Date:
2026-08-29 10:32:39 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202608/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:python-hupper, so that this is still
visible in the BTS web page for this package.

Thanks.
--------------------------------------------------------------------------------
[...]
======================================================================
ERROR: tests.myapp (unittest.loader._FailedTest.tests.myapp)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.myapp
Traceback (most recent call last):
  File "/usr/lib/python3.14/unittest/loader.py", line 467, in _find_test_path
    package = self._get_module_from_name(name)
  File "/usr/lib/python3.14/unittest/loader.py", line 374, in _get_module_from_name
    __import__(name)
    ~~~~~~~~~~^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_hupper/build/tests/myapp/__init__.py", line 1, in <module>
    import pytest_cov.embed
ModuleNotFoundError: No module named 'pytest_cov.embed'
---------------------------------------------------------------------- Ran 1 test in 0.000s FAILED (errors=1) E: pybuild pybuild:485: test: plugin distutils failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_hupper/build; python3.14 -m unittest discover -v dh_auto_test: error: pybuild --test -i python{version} -p 3.14 --parallel=2 returned exit code 13 make: *** [debian/rules:9: binary] Error 25 dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2 --------------------------------------------------------------------------------
#1146037#10
Date:
2026-09-06 14:59:34 UTC
From:
To:
user debian-python@lists.debian.org
usertags 1146037 python3.15
tags 1146037 patch
thanks

Hi!

While rebuilding the python related packages against the Python 3.15rc1
version we found that python-hupper fails to build from source [1].

The error is `No module named 'pytest_cov.embed'. Did you mean:
'pytest_cov.engine'?` and it's due to the fact that pytest_cov no longer
ships the embed module.

I'm proposing here a workaround that only uses the embed module if it
exists. This makes the test pass on both old and new pytest-cov. The
consequence of this is that the subprocess coverage is lost when running
against pytest-cov >= 7.

I applied this fix in the sandbox [2] to be able to build the packages
that depend on python-hupper, please consider applying the patch to
support the upcoming 3.15 version.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4399490/
[2]: https://debusine.debian.net/debian/r-python-python3.15/