hoosac22 [1] filed a request to merge bauh [2] into remove out-of-date
flag [3]:

Do not Delete. This is not out-of-date — please un-flag. 0.10.7 is the
latest upstream release (Jan 2024); there is no newer version to bump
to.

The traceback in the flag is a Python 3.14 incompatibility, not a
version lag: pkgutil.find_loader() was removed in 3.14, and
bauh/view/core/gems.py still calls it. The fix is a small source patch
in the PKGBUILD (swap pkgutil.find_loader ->
importlib.util.find_spec). Tested working on Python 3.14:

--- a/bauh/view/core/gems.py
+++ b/bauh/view/core/gems.py
@@
-import pkgutil
+import importlib
+import importlib.util
@@ def load_managers(...):
-            loader =
pkgutil.find_loader(f'bauh.gems.{f.name}.controller')
-            if loader:
-                module = loader.load_module()
+            module_name = f'bauh.gems.{f.name}.controller'
+            spec = importlib.util.find_spec(module_name)
+            if spec:
+                module = importlib.import_module(module_name)

Suggested PKGBUILD integration — add a prepare() step:

prepare() {
  cd "$pkgname-$pkgver"
  sed -i \
    -e 's/^import pkgutil$/import importlib\nimport importlib.util/' \
    bauh/view/core/gems.py
  sed -i \
    -e "s|loader = pkgutil.find_loader(\(.*\))|spec =
importlib.util.find_spec(\1)|" \
    -e 's|if loader:|if spec:|' \
    -e 's|module = loader.load_module()|module =
importlib.import_module(module_name)|' \
    bauh/view/core/gems.py
}

Please flag as not out-of-date and carry the patch instead — bumping
pkgver won't help since the version is already current. Thanks!

[1] https://aur.archlinux.org/account/hoosac22/
[2] https://aur.archlinux.org/pkgbase/bauh/
[3] https://aur.archlinux.org/pkgbase/remove out-of-date flag/

Reply via email to