I’ve made a binary Python extension using C++ with the help of PyBind11.
This extension come with a “binary script” which is a regular executable file.
Now I’m struggling with the creation of a wheel file to distribute it.
Using pyproject.toml and setuptools backend, I’m able to create wheel file to install a regular Python package (made of .py files) with regular script files (using entry points in .py files)
But how to deal with my .pyd file which contains my whole extension package ?
I’ve try several things, the best I could achieve is a wheel file which install my package as
“python-install-dir/Lib/site-packages/mypackage/mypackage.pyd”
But with that, my package members are accessible from a Python script using “mypackage.mypackage.mymember” syntax
If I manually install my pyd file as “python-install-dir/Lib/site-packages/mypackage.pyd” file (without the “mypackage” subdirectory), it works as expected : I can access my package members with the “mypackage.mymember” syntax
How to configure my pyproject.toml file to achieve this ?
Or is there anything I’ve missed in my .pyd file ?
Maybe should I switch to another build backend ?
My extension also comes with a binary tool (“mytool.exe” file).
How can I include it in my wheel file so it ends up in the “python-install-dir/Scripts” directory ?