Python and KDE: Documentation, Cross-Platform Dev, & pypi

Hi,

Firstly, thanks to the devs for all the work on the Python bindings! I have gone through the tutorial and on Ubuntu 24.10 got a new project up and running with PySide6 and Kirigami.

I have a few questions related to documentation, internationalization, packaging, and pypi.

Documentation

With Python and Kirigami working on Ubuntu 24.10 is it OK to now update the documentation pages with install instructions with a note that on Ubuntu need to be running 24.10 or later? If so, I am happy to do this - especially as that’d let me do an easy first merge request.

Internationalization

Whilst the other main Kirigami pages assume C++, I managed to figure out following them, but I had to replace i18n() and i18nc() with plain strings as it requires KI18n.

With KI18n now having Python bindings, should i18n() and i18nc() work? I tried installing libkf6i18n-dev, but still receiving “ReferrenceError: i18n is not defined”. I am unsure if that’s due to Ubuntu 24.10 not having the Python bindings and/or additional steps are required when working with Python.

Packaging

I assume it is possible to package Python with Kirigami and/or other KDE Frameworks for Android, Windows, and macOS? If so, are there any existing app repos I can look at for examples for how to set this up?

pypi

Are there any plans to make the Kirigami and KDE Framework Python bindings available via pypi? That would provide another way to ensure PySide, Kirigami, and KDE Frameworks are built from same Qt version and make it far easier for non-Linux users to contribute to Python apps. I also have plans for a data analysis app, where it’d be good to be able to have this available as a simple pip install ....

If there is nothing preventing setting this up, I’d be happy to help contribute to - and maintain - the pypi packages. As my experience so far is mainly with Python for personal and work projects, I may need someone with patience to help get started though.

Cheers!

Yes, with an orange alert mentioning the version there and probably another one in the bindings page saying whether the bindings are available on Ubuntu or not (I haven’t checked this yet).

See Ship Kirigami via pip (#13) ¡ Issues ¡ Teams / KDE Goals / Streamlined Application Development Experience ¡ GitLab

I’m not sure of how that would work for the bindings.


As for the other questions, it’s probably a good idea to ask in the Matrix
room for KDE Python (https://go.kde.org/matrix/#/#kde-python:kde.org) and Streamlined App Dev Experience (https://go.kde.org/matrix/#/#kde-apps-initiative:kde.org) unless someone shows up here to answer those :smiley:

1 Like

Well trying to figure out the necessary packages in a clean Ubuntu 24.10 install has been an adventure. Ubuntu 24.10 packages all the pyside6 and qml6 modules separately. Have option of tedium of figuring out the precise list of modules needed across the tutorial, or wildcard them all:

pipx python3-pyqt6 python3-pyside6* qml6-module-* flatpak-builder appstream-compose

Ubuntu 25.04 has a new python3-qtpy-pyside6 metapackage (which is equivalent to python3-pyside6*) but looks like remains no metapackage for the qml6 modules.

Whilst usually ‘not recommended’, I am guessing apt install with wildcards in the tutorial is OK rather than a 30+ list of packages?

It’s probably a good idea to assess that in an MR.

Keeping the list comprehensive might make it clearer to the user what they’re installing, is easier to compare to the other listed distro packages in case something is missing, and doesn’t fill your system with unnecessary deps.

Keeping the list compact reduces cognitive load, makes it seem less overbearing (not sure if that’s the right word), and probably reduces the amount of times the line needs to be changed.

There’s other things to think about like shells too (for example, fish would need the wildcard to be \* or in quotes rather than raw *, zsh seems to require quotes).

If we go the wildcard way it’s probably not a good idea to simply install all available QML modules in the repository ( qml6-module-*), and those might pull way too many deps. :stuck_out_tongue: