You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in #2806 and in this stack overflow post there is demand for compiling dynamic libraries as part of the setuptools build process and then linking against them in python extensions or using them with ctypes or other tools.
I believe currently people either pre-compile the shared library before or have a hacky extension to setuptools.
Describe the solution you'd like
I would like to propose that setuptools adds native support for compiling shared libraries as part of the build process.
I don't know exactly how this would be implemented but my though process was that another command would be added eg build_shared_clib to complement the existing build_clib and another argument would be added to setup() eg shared_libraries to compliment libraries
Reading around some more, there seem to be issues with import paths.
Python extension modules will look for shared libraries next to them and in some other locations as discussed here
That would raise some issues if the dependent python extensions were not all next to the shared library.
dll directories can be manually extended but I assume setuptools wouldn't want to do that.
I also have the use case where I have one python package that depends on the C API of another package which I was planning on exposing through a shared library. This has the import path issue and also on Windows has the issue that the import library (.lib) is needed to compile against the shared library. To support that the lib file would need to be distributed with the package. If this was supported it would need to be an optional feature.
What's the problem this feature will solve?
As discussed in #2806 and in this stack overflow post there is demand for compiling dynamic libraries as part of the setuptools build process and then linking against them in python extensions or using them with ctypes or other tools.
I believe currently people either pre-compile the shared library before or have a hacky extension to setuptools.
Describe the solution you'd like
I would like to propose that setuptools adds native support for compiling shared libraries as part of the build process.
I don't know exactly how this would be implemented but my though process was that another command would be added eg
build_shared_clib
to complement the existingbuild_clib
and another argument would be added tosetup()
egshared_libraries
to complimentlibraries
Alternative Solutions
Compile the shared library separately.
Manual plugin like in the stack overflow post.
https://github.com/mdavidsaver/setuptools_dso
Additional context
I would be interested in helping getting such a feature implemented.
Is this something that setuptools would be interested in merging?
Code of Conduct
The text was updated successfully, but these errors were encountered: