Replies: 4 comments 1 reply
-
Did you find a solution? I am trying to find out the same thing but also mainly find resources for doing this with .py files... |
Beta Was this translation helpful? Give feedback.
-
I have a similar setup where I build my project with conan and cmake. The project is structured in a way so that I have:
The best process I managed to implement so far is to build everythin from conan and cmake and then use the cmake install routine to create a specific python_package folder containing all my targets, placed in the proper directories. Inside my setup.py file I then have something like:
I am not an expert of python binary packages and I am still playing around a lot. The process I implemented so far allows me to properly package shared libs into my python package but I am not entirely sure this approach is correct when it comes to distributing my package. |
Beta Was this translation helpful? Give feedback.
-
Hello @hbadi, did you find a solution for this? |
Beta Was this translation helpful? Give feedback.
-
I've had success in the past, when working with SWIG, creating a python package from the compiled *.pyd files using a pyproject.toml file. file structure
pyproject.toml [project]
name = "moduleName"
license-files = ["LICENSE"]
version = "@PROJECT_VERSION@"
dependencies = []
[tool.setuptools]
packages = ["moduleName"]
[tool.setuptools.package-data]
moduleName = ["*.pyd"]
[build-system]
requires = ["setuptools >= 77.0"]
build-backend = "setuptools.build_meta However, when I use this same approach with pybind11, I can import the module but none of the functions exist... When I add the build directory to the python system path, When I |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I've been reading some stuffs last days about python module packaging, it's quite a mess to understand something clearly since there's a lot of package management tools like setuptools.
I have my own cmake file to generate my dynamic library file. I can't see how to write a very basic setup.py in which i only specify the dynamic library file to use. I found many examples/tutorials in which Extension/pybind11 python modules are used through the explicit definition of source files, but in my case i want to compile the dynlib by my own. Is there any simple setup.py to do the job ?
For example under windows i tried to write these setup.py but the dll is not copied...i only get the .egg file
python setup.py install
The website https://pybind11.readthedocs.io/en/stable/compiling.html do explain a lot of things but only where there's a list of cpp files, which is not my case that's why i manage the compiling using cmake.
I can use
ext_modules = [Extension('pysparselizard', sources=[''])]
but source files are needed.It's not very clear...
Thansk for your help.
Beta Was this translation helpful? Give feedback.
All reactions