spl0k / supysonic

Supysonic is a Python implementation of the Subsonic server API.
https://supysonic.readthedocs.io
GNU Affero General Public License v3.0
259 stars 57 forks source link

Testsuite failure with Python 3.11 #238

Closed baldurmen closed 1 year ago

baldurmen commented 1 year ago

Hello!

Debian is currently busy migrating to Python 3.11 and I'm getting some testsuite failures. Everything but the failure on test_unstar spawns from pony not supporting 3.11.

Somewhat unrelated, but there has been no commit to the pony source code since May 2022 and I fear it's a casualty of the current Russia-Ukraine war... Anyway, the current situation is worrisome.

I: pybuild base:240: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11/build; python3.11 -m unittest discover -v 
test_get_album_list (tests.api.test_album_songs.AlbumSongsTestCase.test_get_album_list) ... ERROR
test_get_album_list2 (tests.api.test_album_songs.AlbumSongsTestCase.test_get_album_list2) ... ERROR
test_get_random_songs (tests.api.test_album_songs.AlbumSongsTestCase.test_get_random_songs) ... ERROR
test_get_starred (tests.api.test_album_songs.AlbumSongsTestCase.test_get_starred) ... ERROR
test_get_starred2 (tests.api.test_album_songs.AlbumSongsTestCase.test_get_starred2) ... ERROR
test_now_playing (tests.api.test_album_songs.AlbumSongsTestCase.test_now_playing) ... ERROR
test_scrobble (tests.api.test_annotation.AnnotationTestCase.test_scrobble) ... ok
test_set_rating (tests.api.test_annotation.AnnotationTestCase.test_set_rating) ... ERROR
test_star (tests.api.test_annotation.AnnotationTestCase.test_star) ... ERROR
test_unstar (tests.api.test_annotation.AnnotationTestCase.test_unstar) ... FAIL
test_auth_basic (tests.api.test_api_setup.ApiSetupTestCase.test_auth_basic) ... ok
test_auth_post (tests.api.test_api_setup.ApiSetupTestCase.test_auth_post) ... ok
test_auth_query_params (tests.api.test_api_setup.ApiSetupTestCase.test_auth_query_params) ... ok
test_format (tests.api.test_api_setup.ApiSetupTestCase.test_format) ... ok
test_not_implemented (tests.api.test_api_setup.ApiSetupTestCase.test_not_implemented) ... ok
test_required_client (tests.api.test_api_setup.ApiSetupTestCase.test_required_client) ... ok
test_genres (tests.api.test_browse.BrowseTestCase.test_genres) ... ERROR
test_get_album (tests.api.test_browse.BrowseTestCase.test_get_album) ... ERROR
test_get_artist (tests.api.test_browse.BrowseTestCase.test_get_artist) ... ERROR
test_get_artists (tests.api.test_browse.BrowseTestCase.test_get_artists) ... ERROR
test_get_indexes (tests.api.test_browse.BrowseTestCase.test_get_indexes) ... ERROR
test_get_music_directory (tests.api.test_browse.BrowseTestCase.test_get_music_directory) ... ERROR
test_get_music_folders (tests.api.test_browse.BrowseTestCase.test_get_music_folders) ... ERROR
test_get_song (tests.api.test_browse.BrowseTestCase.test_get_song) ... ERROR
test_get_videos (tests.api.test_browse.BrowseTestCase.test_get_videos) ... ERROR
test_add_message (tests.api.test_chat.ChatTestCase.test_add_message) ... ERROR
test_get_messages (tests.api.test_chat.ChatTestCase.test_get_messages) ... ERROR
test_download (tests.api.test_media.MediaTestCase.test_download) ... ERROR
test_get_avatar (tests.api.test_media.MediaTestCase.test_get_avatar) ... ERROR
test_get_cover_art (tests.api.test_media.MediaTestCase.test_get_cover_art) ... ERROR
test_stream (tests.api.test_media.MediaTestCase.test_stream) ... ERROR
test_create_playlist (tests.api.test_playlist.PlaylistTestCase.test_create_playlist) ... ERROR
test_delete_playlist (tests.api.test_playlist.PlaylistTestCase.test_delete_playlist) ... ERROR
test_get_playlist (tests.api.test_playlist.PlaylistTestCase.test_get_playlist) ... ERROR
test_get_playlists (tests.api.test_playlist.PlaylistTestCase.test_get_playlists) ... ERROR
test_update_playlist (tests.api.test_playlist.PlaylistTestCase.test_update_playlist) ... ERROR
test_create_radio_station (tests.api.test_radio.RadioStationTestCase.test_create_radio_station) ... ERROR
test_delete_radio_station (tests.api.test_radio.RadioStationTestCase.test_delete_radio_station) ... ERROR
test_get_radio_stations (tests.api.test_radio.RadioStationTestCase.test_get_radio_stations) ... ERROR
test_update_radio_station (tests.api.test_radio.RadioStationTestCase.test_update_radio_station) ... ERROR
test_basic (tests.api.test_response_helper.ResponseHelperJsonTestCase.test_basic) ... ERROR
test_dicts (tests.api.test_response_helper.ResponseHelperJsonTestCase.test_dicts) ... ERROR
test_lists (tests.api.test_response_helper.ResponseHelperJsonTestCase.test_lists) ... ERROR
test_nesting (tests.api.test_response_helper.ResponseHelperJsonTestCase.test_nesting) ... ERROR
test_basic (tests.api.test_response_helper.ResponseHelperJsonpTestCase.test_basic) ... ERROR
test_basic (tests.api.test_response_helper.ResponseHelperXMLTestCase.test_basic) ... ERROR
test_dicts (tests.api.test_response_helper.ResponseHelperXMLTestCase.test_dicts) ... ERROR
test_lists (tests.api.test_response_helper.ResponseHelperXMLTestCase.test_lists) ... ERROR
test_nesting (tests.api.test_response_helper.ResponseHelperXMLTestCase.test_nesting) ... ERROR
test_root (tests.api.test_response_helper.ResponseHelperXMLTestCase.test_root) ... ERROR
test_unauthorized (tests.api.test_scan.ScanTestCase.test_unauthorized) ... ERROR
test_unavailable (tests.api.test_scan.ScanTestCase.test_unavailable) ... ERROR
test_getScanStatus (tests.api.test_scan.ScanWithDaemonTestCase.test_getScanStatus) ... ERROR
test_startScan (tests.api.test_scan.ScanWithDaemonTestCase.test_startScan) ... ERROR
test_search (tests.api.test_search.SearchTestCase.test_search) ... ERROR
test_search2 (tests.api.test_search.SearchTestCase.test_search2) ... ERROR
test_search3 (tests.api.test_search.SearchTestCase.test_search3) ... ERROR
test_get_license (tests.api.test_system.SystemTestCase.test_get_license) ... ERROR
test_ping (tests.api.test_system.SystemTestCase.test_ping) ... ERROR
test_decode_encode (tests.api.test_transcoding.TranscodingTestCase.test_decode_encode) ... ERROR
test_direct_transcode (tests.api.test_transcoding.TranscodingTestCase.test_direct_transcode) ... ERROR
test_last_chunk_close_transcoded_cached (tests.api.test_transcoding.TranscodingTestCase.test_last_chunk_close_transcoded_cached) ... ERROR
test_mostly_transcoded_cached (tests.api.test_transcoding.TranscodingTestCase.test_mostly_transcoded_cached) ... ERROR
test_no_transcoding_available (tests.api.test_transcoding.TranscodingTestCase.test_no_transcoding_available) ... ERROR
test_partly_transcoded_cached (tests.api.test_transcoding.TranscodingTestCase.test_partly_transcoded_cached) ... ERROR
test_change_password (tests.api.test_user.UserTestCase.test_change_password) ... ERROR
test_create_user (tests.api.test_user.UserTestCase.test_create_user) ... ERROR
test_delete_user (tests.api.test_user.UserTestCase.test_delete_user) ... ERROR
test_get_user (tests.api.test_user.UserTestCase.test_get_user) ... ERROR
test_get_users (tests.api.test_user.UserTestCase.test_get_users) ... ERROR
test_update_user (tests.api.test_user.UserTestCase.test_update_user) ... ERROR
test_access_data (tests.base.test_cache.CacheTestCase.test_access_data) ... ok
test_accessing_preserves (tests.base.test_cache.CacheTestCase.test_accessing_preserves) ... ok
test_automatic_delete_oldest (tests.base.test_cache.CacheTestCase.test_automatic_delete_oldest) ... ok
test_cleanup_on_error (tests.base.test_cache.CacheTestCase.test_cleanup_on_error) ... ok
test_delete (tests.base.test_cache.CacheTestCase.test_delete) ... ok
test_delete_missing (tests.base.test_cache.CacheTestCase.test_delete_missing) ... ok
test_existing_files_order (tests.base.test_cache.CacheTestCase.test_existing_files_order) ... ok
test_min_time_clear (tests.base.test_cache.CacheTestCase.test_min_time_clear) ... ok
test_missing (tests.base.test_cache.CacheTestCase.test_missing) ... ok
test_missing_cache_file (tests.base.test_cache.CacheTestCase.test_missing_cache_file) ... ok
test_no_auto_prune (tests.base.test_cache.CacheTestCase.test_no_auto_prune) ... ok
test_not_expired (tests.base.test_cache.CacheTestCase.test_not_expired) ... ok
test_parallel_generation (tests.base.test_cache.CacheTestCase.test_parallel_generation) ... ok
test_replace (tests.base.test_cache.CacheTestCase.test_replace) ... ok
test_store_generated (tests.base.test_cache.CacheTestCase.test_store_generated) ... ok
test_store_literal (tests.base.test_cache.CacheTestCase.test_store_literal) ... ok
test_store_to_fp (tests.base.test_cache.CacheTestCase.test_store_to_fp) ... ok
test_folder_add (tests.base.test_cli.CLITestCase.test_folder_add) ... ERROR
test_folder_add_errors (tests.base.test_cli.CLITestCase.test_folder_add_errors) ... ERROR
test_folder_delete (tests.base.test_cli.CLITestCase.test_folder_delete) ... ERROR
test_folder_list (tests.base.test_cli.CLITestCase.test_folder_list) ... ERROR
test_folder_scan (tests.base.test_cli.CLITestCase.test_folder_scan) ... ERROR
test_user_add (tests.base.test_cli.CLITestCase.test_user_add) ... ERROR
test_user_changepass (tests.base.test_cli.CLITestCase.test_user_changepass) ... ERROR
test_user_delete (tests.base.test_cli.CLITestCase.test_user_delete) ... ERROR
test_user_list (tests.base.test_cli.CLITestCase.test_user_list) ... ERROR
test_user_rename (tests.base.test_cli.CLITestCase.test_user_rename) ... ERROR
test_user_setadmin (tests.base.test_cli.CLITestCase.test_user_setadmin) ... ERROR
test_user_setjukebox (tests.base.test_cli.CLITestCase.test_user_setjukebox) ... ERROR
test_user_unsetadmin (tests.base.test_cli.CLITestCase.test_user_unsetadmin) ... ERROR
test_user_unsetjukebox (tests.base.test_cli.CLITestCase.test_user_unsetjukebox) ... ERROR
test_no_interpolation (tests.base.test_config.ConfigTestCase.test_no_interpolation) ... ok
test_sections (tests.base.test_config.ConfigTestCase.test_sections) ... ok
test_types (tests.base.test_config.ConfigTestCase.test_types) ... ok
test_album (tests.base.test_db.DbTestCase.test_album) ... ERROR
test_artist (tests.base.test_db.DbTestCase.test_artist) ... ERROR
test_chat (tests.base.test_db.DbTestCase.test_chat) ... ERROR
test_folder_annotation (tests.base.test_db.DbTestCase.test_folder_annotation) ... ERROR
test_folder_base (tests.base.test_db.DbTestCase.test_folder_base) ... ERROR
test_playlist (tests.base.test_db.DbTestCase.test_playlist) ... ERROR
test_playlist_fixing (tests.base.test_db.DbTestCase.test_playlist_fixing) ... ERROR
test_playlist_remove_tracks (tests.base.test_db.DbTestCase.test_playlist_remove_tracks) ... ERROR
test_playlist_tracks (tests.base.test_db.DbTestCase.test_playlist_tracks) ... ERROR
test_track (tests.base.test_db.DbTestCase.test_track) ... ERROR
test_user (tests.base.test_db.DbTestCase.test_user) ... ERROR
test_force_rescan (tests.base.test_scanner.ScannerTestCase.test_force_rescan) ... ERROR
test_move_file (tests.base.test_scanner.ScannerTestCase.test_move_file) ... ERROR
test_remove_file (tests.base.test_scanner.ScannerTestCase.test_remove_file) ... ERROR
test_rescan (tests.base.test_scanner.ScannerTestCase.test_rescan) ... ERROR
test_rescan_corrupt_file (tests.base.test_scanner.ScannerTestCase.test_rescan_corrupt_file) ... ERROR
test_rescan_removed_file (tests.base.test_scanner.ScannerTestCase.test_rescan_removed_file) ... ERROR
test_scan (tests.base.test_scanner.ScannerTestCase.test_scan) ... ERROR
test_scan_file (tests.base.test_scanner.ScannerTestCase.test_scan_file) ... ERROR
test_scan_tag_change (tests.base.test_scanner.ScannerTestCase.test_scan_tag_change) ... ERROR
test_stats (tests.base.test_scanner.ScannerTestCase.test_stats) ... ERROR
test_key (tests.base.test_secret.SecretTestCase.test_key) ... ERROR
test_add (tests.base.test_watcher.AudioWatcherTestCase.test_add) ... ERROR
test_add_delete (tests.base.test_watcher.AudioWatcherTestCase.test_add_delete) ... ERROR
test_add_multiple (tests.base.test_watcher.AudioWatcherTestCase.test_add_multiple) ... ERROR
test_add_nowait_stop (tests.base.test_watcher.AudioWatcherTestCase.test_add_nowait_stop) ... ERROR
test_add_rename (tests.base.test_watcher.AudioWatcherTestCase.test_add_rename) ... ERROR
test_add_rename_delete (tests.base.test_watcher.AudioWatcherTestCase.test_add_rename_delete) ... ERROR
test_change (tests.base.test_watcher.AudioWatcherTestCase.test_change) ... ERROR
test_delete (tests.base.test_watcher.AudioWatcherTestCase.test_delete) ... ERROR
test_move_in (tests.base.test_watcher.AudioWatcherTestCase.test_move_in) ... ERROR
test_move_out (tests.base.test_watcher.AudioWatcherTestCase.test_move_out) ... ERROR
test_rename (tests.base.test_watcher.AudioWatcherTestCase.test_rename) ... ERROR
test_rename_delete (tests.base.test_watcher.AudioWatcherTestCase.test_rename_delete) ... ERROR
test_rename_rename (tests.base.test_watcher.AudioWatcherTestCase.test_rename_rename) ... ERROR
test_add_cover_then_file (tests.base.test_watcher.CoverWatcherTestCase.test_add_cover_then_file) ... ERROR
test_add_file_then_cover (tests.base.test_watcher.CoverWatcherTestCase.test_add_file_then_cover) ... ERROR
test_add_to_folder_without_track (tests.base.test_watcher.CoverWatcherTestCase.test_add_to_folder_without_track) ... ERROR
test_add_track_to_empty_folder (tests.base.test_watcher.CoverWatcherTestCase.test_add_track_to_empty_folder) ... ERROR
test_naming_add_bad (tests.base.test_watcher.CoverWatcherTestCase.test_naming_add_bad) ... ERROR
test_naming_add_good (tests.base.test_watcher.CoverWatcherTestCase.test_naming_add_good) ... ERROR
test_naming_remove_bad (tests.base.test_watcher.CoverWatcherTestCase.test_naming_remove_bad) ... ERROR
test_naming_remove_good (tests.base.test_watcher.CoverWatcherTestCase.test_naming_remove_good) ... ERROR
test_remove_cover (tests.base.test_watcher.CoverWatcherTestCase.test_remove_cover) ... ERROR
test_remove_from_folder_without_track (tests.base.test_watcher.CoverWatcherTestCase.test_remove_from_folder_without_track) ... ERROR
test_rename (tests.base.test_watcher.CoverWatcherTestCase.test_rename) ... ERROR
test_add_get (tests.frontend.test_folder.FolderTestCase.test_add_get) ... ERROR
test_add_post (tests.frontend.test_folder.FolderTestCase.test_add_post) ... ERROR
test_delete (tests.frontend.test_folder.FolderTestCase.test_delete) ... ERROR
test_index (tests.frontend.test_folder.FolderTestCase.test_index) ... ERROR
test_scan (tests.frontend.test_folder.FolderTestCase.test_scan) ... ERROR
test_login_admin (tests.frontend.test_login.LoginTestCase.test_login_admin) ... ERROR
test_login_non_admin (tests.frontend.test_login.LoginTestCase.test_login_non_admin) ... ERROR
test_login_with_bad_data (tests.frontend.test_login.LoginTestCase.test_login_with_bad_data) ... ERROR
test_multiple_login (tests.frontend.test_login.LoginTestCase.test_multiple_login) ... ERROR
test_root_with_non_valid_session (tests.frontend.test_login.LoginTestCase.test_root_with_non_valid_session) ... ERROR
test_root_with_valid_session (tests.frontend.test_login.LoginTestCase.test_root_with_valid_session) ... ERROR
test_unauthorized_request (tests.frontend.test_login.LoginTestCase.test_unauthorized_request) ... ERROR
test_delete (tests.frontend.test_playlist.PlaylistTestCase.test_delete) ... ERROR
test_details (tests.frontend.test_playlist.PlaylistTestCase.test_details) ... ERROR
test_index (tests.frontend.test_playlist.PlaylistTestCase.test_index) ... ERROR
test_update (tests.frontend.test_playlist.PlaylistTestCase.test_update) ... ERROR
test_add_get (tests.frontend.test_user.UserTestCase.test_add_get) ... ERROR
test_add_post (tests.frontend.test_user.UserTestCase.test_add_post) ... ERROR
test_change_mail_get (tests.frontend.test_user.UserTestCase.test_change_mail_get) ... ERROR
test_change_mail_post (tests.frontend.test_user.UserTestCase.test_change_mail_post) ... ERROR
test_change_password_get (tests.frontend.test_user.UserTestCase.test_change_password_get) ... ERROR
test_change_password_post (tests.frontend.test_user.UserTestCase.test_change_password_post) ... ERROR
test_change_username_get (tests.frontend.test_user.UserTestCase.test_change_username_get) ... ERROR
test_change_username_post (tests.frontend.test_user.UserTestCase.test_change_username_post) ... ERROR
test_delete (tests.frontend.test_user.UserTestCase.test_delete) ... ERROR
test_details (tests.frontend.test_user.UserTestCase.test_details) ... ERROR
test_index (tests.frontend.test_user.UserTestCase.test_index) ... ERROR
test_lastfm_link (tests.frontend.test_user.UserTestCase.test_lastfm_link) ... ERROR
test_lastfm_unlink (tests.frontend.test_user.UserTestCase.test_lastfm_unlink) ... ERROR
test_update_client_prefs (tests.frontend.test_user.UserTestCase.test_update_client_prefs) ... ERROR
test_add_folder (tests.managers.test_manager_folder.FolderManagerTestCase.test_add_folder) ... ERROR
test_delete_by_name (tests.managers.test_manager_folder.FolderManagerTestCase.test_delete_by_name) ... ERROR
test_delete_folder (tests.managers.test_manager_folder.FolderManagerTestCase.test_delete_folder) ... ERROR
test_get_folder (tests.managers.test_manager_folder.FolderManagerTestCase.test_get_folder) ... ERROR
test_add_user (tests.managers.test_manager_user.UserManagerTestCase.test_add_user) ... ERROR
test_change_password (tests.managers.test_manager_user.UserManagerTestCase.test_change_password) ... ERROR
test_change_password2 (tests.managers.test_manager_user.UserManagerTestCase.test_change_password2) ... ERROR
test_delete_by_name (tests.managers.test_manager_user.UserManagerTestCase.test_delete_by_name) ... ERROR
test_delete_user (tests.managers.test_manager_user.UserManagerTestCase.test_delete_user) ... ERROR
test_encrypt_password (tests.managers.test_manager_user.UserManagerTestCase.test_encrypt_password) ... ERROR
test_get_user (tests.managers.test_manager_user.UserManagerTestCase.test_get_user) ... ERROR
test_try_auth (tests.managers.test_manager_user.UserManagerTestCase.test_try_auth) ... ERROR
test_issue (tests.issue101.Issue101TestCase.test_issue) ... ERROR
test_last_play (tests.issue129.Issue129TestCase.test_last_play) ... ERROR
test_rating (tests.issue129.Issue129TestCase.test_rating) ... ERROR
test_starred (tests.issue129.Issue129TestCase.test_starred) ... ERROR
test_issue133 (tests.issue133.Issue133TestCase.test_issue133) ... ERROR
test_float_bitrate (tests.issue139.Issue139TestCase.test_float_bitrate) ... ERROR
test_null_genre (tests.issue139.Issue139TestCase.test_null_genre) ... ERROR
test_issue (tests.issue148.Issue148TestCase.test_issue) ... ERROR
test_issue (tests.issue221.Issue221TestCase.test_issue) ... ERROR
test_issue (tests.issue85.Issue85TestCase.test_issue) ... ERROR

I'm attaching the full tracelog, as apparently, Github has decided I can't post more than 65536 characters in an issue (what nonsense).

supysonic_failure_3.11.txt

spl0k commented 1 year ago

Hello.

I was watching Pony for any news on Python 3.11, also getting worried about the lack of update. Even before the conflict started I was considering replacing Pony with something else as development seemed to slow down over the years, Pony requiring more time to be compatible for each new Python version. I guess this replacement is becoming a necessity now...

baldurmen commented 1 year ago

So we agree... I certainly don't want to pressure you, but I thought you should know that:

This pretty much means if ponyorm doesn't magically become Python 3.11 compatible and supysonic still depends on it, it won't be in the next Debian stable version :(

This whole situation makes me very sad, as supysonic is one of the packages I really care about in Debian, but there is little I can do on my side. One of my Debian colleagues has been looking at pony to see how it can be patched, but although he's a Python wizard, I don't think we can rely on him...

spl0k commented 1 year ago

Thank you for the information.

I started replacing pony with peewee which is already available in Debian packages and, if I understand correctly, is already safe for the next Debian stable. It's a few versions behind though so I'll aim for a compatibility with the 3.14.10 version. It's far from done but you can follow the progress on the peewee branch. Hopefully I'll get it ready before the freeze.

baldurmen commented 1 year ago

That's great news!

Peewee does seem to be in a good shape in Debian, yes.

If you need me to run tests, I'd be more than happy to.

baldurmen commented 1 year ago

Well well well, sometime heroes come through! My Debian colleagues worked hard and managed to patch Pony for 3.11.

The pony testsuite passes and with this patch, so does the supysonic one. I guess the move to peewee is less time critical then :)

https://salsa.debian.org/python-team/packages/ponyorm/-/blob/debian/master/debian/patches/0003-python-3.11.patch

I'm sure they'll make a proper PR on the pony git repo soon.

Cheers,

spl0k commented 1 year ago

Hello, happy New Year!

That's some impressive work, and it seems the PR triggered a bit of activity on pony's repo.

Meanwhile I progressed on replacing pony with peewee: all tests now pass. I still need to check some stuff as we don't have a 100% test coverage and some tests just call the code and aren't actually checking anything (especially the tests for the API endpoints provided by the supysonic.api.album_songs module)

spl0k commented 1 year ago

After using it a bit I didn't notice anything problematic, so I it got merged into master and I published a new version (0.7.3). Say hello to Supysonic now rid of Pony!

spl0k commented 1 year ago

Well, it seems a major issue eluded me: #241 :(

spl0k commented 1 year ago

Published a new version (0.7.4). It should now be stable.