chore(linux): replace deprecated parse_version 🍒

`pkg_resources` which contains `parse_version` is deprecated. Latest
versions output a warning. This change uses the suggested replacement,
`package.version.parse` which is available in all supported Ubuntu
versions.

Cherry-pick: #14973
Fixes: #14957
Bug-Debian: https://bugs.debian.org/1149425
Test-bot: skip
This commit is contained in:
Eberhard Beilharz 2025-10-16 18:10:55 +02:00
parent abd92ce45b
commit f5eaffb86b
No known key found for this signature in database
GPG key ID: E9140597606020D3

View file

@ -12,7 +12,7 @@ import gi
gi.require_version('IBus', '1.0')
from gi.repository import IBus
from pkg_resources import parse_version
from packaging import version
from keyman_config.gnome_keyboards_util import is_gnome_desktop
from keyman_config.gsettings import GSettings
@ -156,7 +156,7 @@ def _get_ibus_version():
def _start_ibus_daemon(realuser):
try:
if parse_version(_get_ibus_version()) >= parse_version('1.5.28'):
if version.parse(_get_ibus_version()) >= version.parse('1.5.28'):
# IBus ~1.5.28 added the `start` command, so we use that if possible
# and let IBus deal with the necessary parameters
args = ['ibus', 'start', '-d']