libremidi
libremidi copied to clipboard
A python package on the way?
Hello Jean-Michaël, I noticed the recent addition of python bindings to the project. Is your intention to also build python packages in github actions and publish them to pypi.org? I think that would be of great value and would happily look into making a workflow for it if you agree.
Hello ! Yes, and help for the GH workflow especially for submitting to PyPI would be amazing!
I'm currently adding a GH workflow in https://github.com/celtera/libremidi/pull/140
python workflow merged !
Hello Jean-Michael, I have tried to import the pyd file generated by the workflow on windows 10 but it is failing: `Python 3.13.2 (tags/v3.13.2:4f8bb39, Feb 4 2025, 15:23:48) [MSC v.1942 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.
import sys import os import dlltracer os.add_dll_directory('C:\Windows\System32') <AddedDllDirectory('C:\Windows\System32')> with dlltracer.Trace(out=sys.stdout): ... import pylibremidi ... LoadLibrary C:\Windows\System32\kernel.appcore.dll LoadLibrary C:\code\jambuddy\pylibremidi.pyd LoadLibrary C:\Windows\System32\winmm.dll Failed \Device\HarddiskVolume3\Windows\System32\winmm.dll Failed \Device\HarddiskVolume3\code\jambuddy\pylibremidi.pyd Traceback (most recent call last): File "
", line 2, in import pylibremidi ImportError: DLL load failed while importing pylibremidi: The specified module could not be found.`
I suspect it is because the project is compile with --config Debug and I do not have the vc++ debug DLLs, I will try again with the --config flipped to Release to confirm this hypothesis.
this could definitely be a cause indeed, the MSVC toolchain does not support mixing debug and release DLLs
just tried on msvc and seems to be alright there:
I observed the same on my windows machine: even though the project was compiled against cpython 3.13.2, importing the dll on python 3.11.0 goes fine. What is more surprising is that it does not work when I try to import the same dll on python 3.13.2 (the exact same version the project is compiled against), I either get "DLL load failed" as mentioned earlier when compiling with --config Debug or import pylibremidi just hangs forever when compiled with --config Release. I did not get the chance to test this on Linux yet but hopefully I will be able to run some more tests on ubuntu as well.
I'll try with python 3.13.2 to see what happens
Okay, indeed here I'm getting a stall when doing import pylibremidi on 3.13
Also with 3.12, and also with msys's clang & python & .... 3.11 works fine everywhere.
I think I got a fix, it was some static variable that triggered too-early-loading of winrt
:)