Is it possible to use Cython in a Python macro?

Hello there, I’m writing an extension to sort wordlists in ancient Asian languages alphebetical order.
I’m trying to optimize my main.py. After profiling the code, I spotted a greedy function.
I managed to reduce its running time, but I’d love to try using Cython, and see if it can improve further.

I compiled the function using the same Python version of my LibreOffice installation (3.9.20), put the .so file in the .oxt, alongside the main.py, updated the manifest.xml; but I keep getting the error :

Istantanea_2024-10-23_18-05-04

here’s the content of the oxt :

Question is : is there a way to use Cython in LibreOffice, and if so, what else do I need to do? I never used Cython before…

Thanks

thats not the content, its simply a screenshot!

Apologies, you’re right. It was just to confirm if the .so file name were compatible with the import, but I tried to rename it and the situation didn’t change…
If it can be useful, I can upload the codes in some gist files. But if Cython is not compatible with LibreOffice, there’s no point in doing that!

-------- Messaggio originale --------
23/10/24 19:26, karolus via Ask LibreOffice ha scritto:
karolus
October 23
 petrix:
here’s the content of the oxt :
thats not the content, its simply a screenshot!
Visit Topic or reply to this email to respond.
To unsubscribe from these emails, click here.

try to move this »optimized_insert.cpython-39-x86_64-linux-gnu.so« into a subfolder called »pythonpath«

Unfortunately, it didn’t work (I updated the manifest.xml too), but thanks for the suggestion :slightly_smiling_face:

I solved it modifying the import instruction in the main.py, but apparently I’m not experiencing any improvement using cython.