From 57951951303498a79eb14fc4a4c734535365d80f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20=E2=80=9CFreso=E2=80=9D=20S=2E=20Olesen?= Date: Wed, 27 Mar 2024 13:39:03 +0100 Subject: [PATCH] Fix version check of Urwid Urwid used to provide `VERSION` both in its main namespace (`urwid.VERSION`) and under `version` (`urwid.version.VERSION`), but as of commit 8d8e4b678cc0f93149a4a964b26ee11fb136ea0f[1] this is now only available in the main namespace[2], as setuptools-scm does not include `VERSION` in its generated `version.py`[3]. This breaks audiotools with urwid>=2.2.0 (2023-09-21). The simple fix is to just look at `urwid.VERSION` instead of `urwid.version.VERSION`, which is what this patch does. [1] https://github.com/urwid/urwid/commit/8d8e4b678cc0f93149a4a964b26ee11fb136ea0f [2] https://github.com/urwid/urwid/commit/8d8e4b678cc0f93149a4a964b26ee11fb136ea0f#diff-622c6cdaa0aebea827e82ba7a1e6127f21fe51c58ff6a88ff6b018c3885ea2e9L105-R217 [3] https://github.com/pypa/setuptools_scm/blob/main/src/setuptools_scm/_integration/dump_version.py --- audiotools/ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audiotools/ui.py b/audiotools/ui.py index 6f4037dce..7c81af653 100644 --- a/audiotools/ui.py +++ b/audiotools/ui.py @@ -52,7 +52,7 @@ def choice_selection_unicode(metadata): try: import urwid - if urwid.version.VERSION < (1, 0, 0): + if urwid.VERSION < (1, 0, 0): raise ImportError() def Screen():