examples/pybind11/README.md
This example demonstrates how to compile pybind11 modules using Pixi and scikit-build-core.
pybind11 is a lightweight header-only library that exposes C++ types in Python and vice versa, mainly to create Python bindings of existing C++ code. This project showcases an efficient way to build pybind11 modules using modern tools.
To build the project, run the following command in your terminal:
pixi run build
This command will:
dist folder containing:
.tar.gz) file.whl) fileThe source distribution includes the wheel file along with other project-related files, making it ready for publication to a Python package repository like PyPI.
After building the project, you can install the generated wheel file for local testing. Follow these steps:
Navigate to the dist folder:
cd dist
Install the wheel file using pip:
pip install your_package_name-version-py3-none-any.whl
Replace your_package_name-version-py3-none-any.whl with the actual name of your wheel file.
You can now import and use your module in Python:
import your_module_name
# Use your module here
dist folder.whl files.For more information on pybind11, visit the official documentation.