#1101671 python-ytmusicapi: FTBFS: ModuleNotFoundError: No module named 'pytest'

#1101671#5
Date:
2025-03-30 00:27:38 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, your package failed to build:

[ Note 1: I recommend that you add a debian/salsa-ci.yml file to check for buildability ]

[ Note 2: The salsa project does not match the source package name, this is probably
an anomaly that you might want to fix ]
--------------------------------------------------------------------------------
[...]
adding 'ytmusicapi-0.0.0.dist-info/top_level.txt'
adding 'ytmusicapi-0.0.0.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
Successfully built ytmusicapi-0.0.0-py3-none-any.whl
I: pybuild plugin_pyproject:144: Unpacking wheel built for python3.13 with "installer" module
   dh_auto_test -O--buildsystem=pybuild
I: pybuild base:311: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build; python3.13 -m unittest discover -v
tests.auth.test_oauth (unittest.loader._FailedTest.tests.auth.test_oauth) ... ERROR
tests.mixins.test_browsing (unittest.loader._FailedTest.tests.mixins.test_browsing) ... ERROR
tests.mixins.test_library (unittest.loader._FailedTest.tests.mixins.test_library) ... ERROR
tests.mixins.test_playlists (unittest.loader._FailedTest.tests.mixins.test_playlists) ... ERROR
tests.mixins.test_search (unittest.loader._FailedTest.tests.mixins.test_search) ... ERROR
tests.mixins.test_uploads (unittest.loader._FailedTest.tests.mixins.test_uploads) ... ERROR
tests.mixins.test_watch (unittest.loader._FailedTest.tests.mixins.test_watch) ... ERROR
tests.test_ytmusic (unittest.loader._FailedTest.tests.test_ytmusic) ... ERROR

======================================================================
ERROR: tests.auth.test_oauth (unittest.loader._FailedTest.tests.auth.test_oauth)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.auth.test_oauth
Traceback (most recent call last):
  File "/usr/lib/python3.13/unittest/loader.py", line 396, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.13/unittest/loader.py", line 339, in _get_module_from_name
    __import__(name)
    ~~~~~~~~~~^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/tests/auth/test_oauth.py", line 8, in <module>
    import pytest
ModuleNotFoundError: No module named 'pytest'


======================================================================
ERROR: tests.mixins.test_browsing (unittest.loader._FailedTest.tests.mixins.test_browsing)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.mixins.test_browsing
Traceback (most recent call last):
  File "/usr/lib/python3.13/unittest/loader.py", line 396, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.13/unittest/loader.py", line 339, in _get_module_from_name
    __import__(name)
    ~~~~~~~~~~^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/tests/mixins/test_browsing.py", line 6, in <module>
    import pytest
ModuleNotFoundError: No module named 'pytest'


======================================================================
ERROR: tests.mixins.test_library (unittest.loader._FailedTest.tests.mixins.test_library)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.mixins.test_library
Traceback (most recent call last):
  File "/usr/lib/python3.13/unittest/loader.py", line 396, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.13/unittest/loader.py", line 339, in _get_module_from_name
    __import__(name)
    ~~~~~~~~~~^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/tests/mixins/test_library.py", line 3, in <module>
    import pytest
ModuleNotFoundError: No module named 'pytest'


======================================================================
ERROR: tests.mixins.test_playlists (unittest.loader._FailedTest.tests.mixins.test_playlists)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.mixins.test_playlists
Traceback (most recent call last):
  File "/usr/lib/python3.13/unittest/loader.py", line 396, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.13/unittest/loader.py", line 339, in _get_module_from_name
    __import__(name)
    ~~~~~~~~~~^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/tests/mixins/test_playlists.py", line 6, in <module>
    import pytest
ModuleNotFoundError: No module named 'pytest'


======================================================================
ERROR: tests.mixins.test_search (unittest.loader._FailedTest.tests.mixins.test_search)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.mixins.test_search
Traceback (most recent call last):
  File "/usr/lib/python3.13/unittest/loader.py", line 396, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.13/unittest/loader.py", line 339, in _get_module_from_name
    __import__(name)
    ~~~~~~~~~~^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/tests/mixins/test_search.py", line 1, in <module>
    import pytest
ModuleNotFoundError: No module named 'pytest'


======================================================================
ERROR: tests.mixins.test_uploads (unittest.loader._FailedTest.tests.mixins.test_uploads)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.mixins.test_uploads
Traceback (most recent call last):
  File "/usr/lib/python3.13/unittest/loader.py", line 396, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.13/unittest/loader.py", line 339, in _get_module_from_name
    __import__(name)
    ~~~~~~~~~~^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/tests/mixins/test_uploads.py", line 7, in <module>
    import pytest
ModuleNotFoundError: No module named 'pytest'


======================================================================
ERROR: tests.mixins.test_watch (unittest.loader._FailedTest.tests.mixins.test_watch)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.mixins.test_watch
Traceback (most recent call last):
  File "/usr/lib/python3.13/unittest/loader.py", line 396, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.13/unittest/loader.py", line 339, in _get_module_from_name
    __import__(name)
    ~~~~~~~~~~^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/tests/mixins/test_watch.py", line 1, in <module>
    import pytest
ModuleNotFoundError: No module named 'pytest'


======================================================================
ERROR: tests.test_ytmusic (unittest.loader._FailedTest.tests.test_ytmusic)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.test_ytmusic
Traceback (most recent call last):
  File "/usr/lib/python3.13/unittest/loader.py", line 396, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.13/unittest/loader.py", line 339, in _get_module_from_name
    __import__(name)
    ~~~~~~~~~~^^^^^^
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/tests/test_ytmusic.py", line 3, in <module>
    import pytest
ModuleNotFoundError: No module named 'pytest'
---------------------------------------------------------------------- Ran 8 tests in 0.000s FAILED (errors=8) E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build; python3.13 -m unittest discover -v dh_auto_test: error: pybuild --test -i python{version} -p 3.13 returned exit code 13 make: *** [debian/rules:4: binary] Error 25 dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2 -------------------------------------------------------------------------------- The above is just how the build ends and not necessarily the most relevant part. If required, the full build log is available here: https://people.debian.org/~sanvila/build-logs/202503/ 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 could not 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-ytmusicapi, so that this is still visible in the BTS web page for this package. Thanks.
#1101671#10
Date:
2025-04-07 17:45:05 UTC
From:
To:
As well as the obvious missing build-dependencies, the tests seem to
require a test.cfg with YouTube account credentials (judging by
.github/workflows/coverage.yml, anyway).

Salvo, should we just disable the tests?  It's not clear to me that
there are many other options here.

Thanks,

#1101671#15
Date:
2025-04-07 17:58:32 UTC
From:
To:
Hello,

the tests were not running in my chroot when I originally made the package, so
I'm not sure why they got ran later on.

As I had seen not depending on pytest would just skip them.

Anyway I was kinda sitting on this one on purpose because since there's no way
for audiotube to make it for trixie, there's also no reason for this to be in
trixie either, so I didn't really give this a priority.

I can look into it if you'd want it to be in trixie, but I'm 100% fine if it
will remain left out.

#1101671#20
Date:
2025-04-08 09:09:39 UTC
From:
To:
I'm not sure why they wouldn't have run before, in the absence of a
forked dh-python or something.  pybuild currently falls back to
"{interpreter} -m unittest discover -v".

No great rush specifically for trixie; I just try to stay on top of the
Python team's bug list.