GSoC/2024/StatusReports/ManuelAlcaraz: Difference between revisions
Create page |
Add personal repo |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Python bindings for KDE Frameworks == | == Python bindings for KDE Frameworks == | ||
KDE Frameworks is a collection of C++ addon libraries to Qt that provide common functionality for desktop applications built with the Qt framework. While Qt itself provides support for developing applications using other programming languages, such as Python, KDE Frameworks does not. | |||
This project aims to create Python bindings (along with comprehensive developer documentation) for a subset of the KDE Frameworks using the same technologies (Shiboken) that Qt uses for their Python port. | |||
== Mentor == | == Mentor == | ||
Line 6: | Line 10: | ||
== Work report == | == Work report == | ||
=== Summary === | |||
I have added a new module to Extra CMake Modules (ECM) that handles the generation of Python bindings using Shiboken. It's currently waiting to be merged while we figure out some building errors on some distributions. | |||
Using the new module, I wrote Python bindings for the following libraries: | |||
* KWidgetsAddons | |||
* KUnitConversion | |||
* KCoreAddons | |||
* KGuiAddons | |||
* KI18n | |||
* KNotifications | |||
* KXmlGui | |||
The first two of them have open merge requests. The rest will be upstreamed once the ECM one is merged and they are on [https://invent.kde.org/manuelal/pykde6 a separate repository] where I started working on the project until it was ready to be upstreamed. | |||
Writing the definitions of the bindings was mostly a repetitive task (that sometimes became boring), although sometimes Shiboken didn't properly handle some functions and required some manual tweaking. | |||
=== Future work === | |||
This project only added Python bindings to a few KDE Frameworks, so writing bindings for the rest of them is an expansion point. | |||
Due to the language differences between Python and C++, some functions can't be ported properly (namely those which have pointers as arguments, e.g. <code>bool*</code>). This wan't addressed on the project. | |||
=== Merge requests === | |||
* [https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/450 Extra CMake Modules] | |||
* [https://invent.kde.org/frameworks/kwidgetsaddons/-/merge_requests/258 KWidgetsAddons] | |||
* [https://invent.kde.org/frameworks/kunitconversion/-/merge_requests/48 KUnitConversion] | |||
* [https://invent.kde.org/sysadmin/ci-images/-/merge_requests/307 ci-images: Add required packages] (merged) | |||
== Links to Blogs and other writing == | == Links to Blogs and other writing == | ||
* [https://alcarazzam.dev/ | * [https://alcarazzam.dev/posts/python-bindings-for-kde-frameworks/ Introduction post] | ||
* [https://alcarazzam.dev/posts/the-last-2-weeks-in-gsoc/ Report 1] | |||
* [https://alcarazzam.dev/posts/the-last-2-weeks-in-gsoc-ii/ Report 2] | |||
* [https://alcarazzam.dev/posts/python-bindings-for-kde-frameworks-gsoc-midterm-review/ Report 3] | |||
* [https://alcarazzam.dev/posts/the-last-month-in-gsoc/ Report 4] | |||
* [https://alcarazzam.dev/posts/generate-python-bindings-shiboken/ Tutorial post] | |||
* [https://alcarazzam.dev/posts/gsoc-final-update/ Final update] |
Latest revision as of 16:56, 9 September 2024
Python bindings for KDE Frameworks
KDE Frameworks is a collection of C++ addon libraries to Qt that provide common functionality for desktop applications built with the Qt framework. While Qt itself provides support for developing applications using other programming languages, such as Python, KDE Frameworks does not.
This project aims to create Python bindings (along with comprehensive developer documentation) for a subset of the KDE Frameworks using the same technologies (Shiboken) that Qt uses for their Python port.
Mentor
Carl Schwan
Work report
Summary
I have added a new module to Extra CMake Modules (ECM) that handles the generation of Python bindings using Shiboken. It's currently waiting to be merged while we figure out some building errors on some distributions.
Using the new module, I wrote Python bindings for the following libraries:
- KWidgetsAddons
- KUnitConversion
- KCoreAddons
- KGuiAddons
- KI18n
- KNotifications
- KXmlGui
The first two of them have open merge requests. The rest will be upstreamed once the ECM one is merged and they are on a separate repository where I started working on the project until it was ready to be upstreamed.
Writing the definitions of the bindings was mostly a repetitive task (that sometimes became boring), although sometimes Shiboken didn't properly handle some functions and required some manual tweaking.
Future work
This project only added Python bindings to a few KDE Frameworks, so writing bindings for the rest of them is an expansion point.
Due to the language differences between Python and C++, some functions can't be ported properly (namely those which have pointers as arguments, e.g. bool*
). This wan't addressed on the project.