quodlibet / quodlibet

Music player and music library manager for Linux, Windows, and macOS
https://quodlibet.readthedocs.io
GNU General Public License v2.0
1.41k stars 222 forks source link

Build issues with python 3.13 of quodlibet 4.6.0 #4473

Open hannes101 opened 5 months ago

hannes101 commented 5 months ago

Steps to reproduce

During the preparations for fedora 40 there is a mass rebuild to check if the python packages can be built with python 3.13.

There are a couple of issues with quodlibet, which I think can be fixed rather easily. The details can be found in the following bug report https://bugzilla.redhat.com/show_bug.cgi?id=2259638 `quodlibet fails to build with Python 3.13.03.

+ /usr/bin/pytest -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.13.0a3, pytest-7.4.3, pluggy-1.3.0
rootdir: /builddir/build/BUILD/quodlibet-4.6.0
configfile: setup.cfg
collected 4561 items / 5 errors / 9 deselected / 1 skipped / 4552 selected

==================================== ERRORS ====================================
_______________ ERROR collecting tests/test_browsers_podcasts.py _______________
ImportError while importing test module '/builddir/build/BUILD/quodlibet-4.6.0/tests/test_browsers_podcasts.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_browsers_podcasts.py:9: in <module>
    from quodlibet.browsers.podcasts import Podcasts, AddFeedDialog, Feed
quodlibet/browsers/podcasts.py:17: in <module>
    import feedparser
/usr/lib/python3.13/site-packages/feedparser/__init__.py:28: in <module>
    from .api import parse
/usr/lib/python3.13/site-packages/feedparser/api.py:35: in <module>
    from .encodings import convert_to_utf8
/usr/lib/python3.13/site-packages/feedparser/encodings.py:29: in <module>
    import cgi
E   ModuleNotFoundError: No module named 'cgi'
_________________ ERROR collecting tests/test_qltk_exfalso.py __________________
ImportError while importing test module '/builddir/build/BUILD/quodlibet-4.6.0/tests/test_qltk_exfalso.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_qltk_exfalso.py:6: in <module>
    from quodlibet.qltk import exfalsowindow
quodlibet/qltk/exfalsowindow.py:41: in <module>
    from quodlibet.update import UpdateDialog
quodlibet/update.py:22: in <module>
    import feedparser
/usr/lib/python3.13/site-packages/feedparser/__init__.py:28: in <module>
    from .api import parse
/usr/lib/python3.13/site-packages/feedparser/api.py:35: in <module>
    from .encodings import convert_to_utf8
/usr/lib/python3.13/site-packages/feedparser/encodings.py:29: in <module>
    import cgi
E   ModuleNotFoundError: No module named 'cgi'
_____________ ERROR collecting tests/test_qltk_quodlibetwindow.py ______________
ImportError while importing test module '/builddir/build/BUILD/quodlibet-4.6.0/tests/test_qltk_quodlibetwindow.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_qltk_quodlibetwindow.py:11: in <module>
    from quodlibet.qltk.quodlibetwindow import QuodLibetWindow, PlaybackErrorDialog
quodlibet/qltk/quodlibetwindow.py:30: in <module>
    from quodlibet.update import UpdateDialog
quodlibet/update.py:22: in <module>
    import feedparser
/usr/lib/python3.13/site-packages/feedparser/__init__.py:28: in <module>
    from .api import parse
/usr/lib/python3.13/site-packages/feedparser/api.py:35: in <module>
    from .encodings import convert_to_utf8
/usr/lib/python3.13/site-packages/feedparser/encodings.py:29: in <module>
    import cgi
E   ModuleNotFoundError: No module named 'cgi'
____________________ ERROR collecting tests/test_update.py _____________________
ImportError while importing test module '/builddir/build/BUILD/quodlibet-4.6.0/tests/test_update.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_update.py:8: in <module>
    from quodlibet.update import UpdateDialog
quodlibet/update.py:22: in <module>
    import feedparser
/usr/lib/python3.13/site-packages/feedparser/__init__.py:28: in <module>
    from .api import parse
/usr/lib/python3.13/site-packages/feedparser/api.py:35: in <module>
    from .encodings import convert_to_utf8
/usr/lib/python3.13/site-packages/feedparser/encodings.py:29: in <module>
    import cgi
E   ModuleNotFoundError: No module named 'cgi'
_________________ ERROR collecting tests/plugin/test_prefs.py __________________
ImportError while importing test module '/builddir/build/BUILD/quodlibet-4.6.0/tests/plugin/test_prefs.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/plugin/test_prefs.py:13: in <module>
    from quodlibet.ext._shared.squeezebox.server import SqueezeboxException
quodlibet/ext/_shared/squeezebox/server.py:10: in <module>
    from telnetlib import Telnet
E   ModuleNotFoundError: No module named 'telnetlib'

According to https://docs.python.org/3.13/whatsnew/3.13.html: PEP 594: Remove the telnetlib module, deprecated in Python 3.11: use the projects telnetlib3 or Exscript instead. (Contributed by Victor Stinner in gh-104773.)

https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06939269-quodlibet/

For all our attempts to build quodlibet with Python 3.13, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/quodlibet/

declension commented 5 months ago

Hmm yeah

feedparser (cgi)

I think we're on a really old version, and I suspect that upstream will have fixed this ages ago, but can check

telnet

Options (not exclusive)

  1. retire that plugin, I can't test it any more either.
  2. Rewrite the telnet stuff using even lower level socket code (etc)
  3. But at least it should catch the import error and fail just the plugin
declension commented 5 months ago

Looks like the feedparser issue is resolved upstream

hannes101 commented 5 months ago

Thanks, will check on updating python3-feedparser in fedora. It currently is at 6.0.10, so should be fixed, when this is updated. Of course this only goes for the feedparser error, the telnet one is still present. Is this correct that this is the Squeezebox plugin? I am wondering how big the user base for this might still be, given that apparently these were discontinued to be sold in 2012, according to https://en.wikipedia.org/wiki/Squeezebox_(network_music_player)

declension commented 5 months ago

Is this correct that this is the Squeezebox plugin? I am wondering how big the user base for this might still be, given that apparently these were discontinued to be sold in 2012, according to https://en.wikipedia.org/wiki/Squeezebox_(network_music_player)

Yes. Who knows. I wrote it for myself originally but no longer have that setup. But it's a strong DIY and alternative-hardware (RPi, Chromecast, etc) ecosystem when i last checked so might be nice to keep it alive.

declension commented 4 months ago

The immediate build issues should be fixed - can we retest @hannes101 ?

hannes101 commented 4 months ago

I also got python-feedparser updated in fedora, so yes I think it should be testable. Will try to build it soon.

hannes101 commented 2 weeks ago

Is there a guide somewhere to setup the repo or a tarball the same as the release tarballs?

declension commented 2 weeks ago

https://quodlibet.readthedocs.io/en/latest/packaging.html#packagingguide might help

(also https://quodlibet.readthedocs.io/en/latest/development/devenv.html)

hannes101 commented 2 weeks ago

I am not able to build directly from a git snapshot, not sure what I am missing, but there's also nothing on these pages, which might explain that. I guess there's something in the release preparation, which needs to be done to create a proper tarball.