From 329d8dc891fafddf2148bc87f5752a850a5de971 Mon Sep 17 00:00:00 2001 From: parker-research <166864283+parker-research@users.noreply.github.com> Date: Sat, 30 Nov 2024 18:40:19 -0700 Subject: [PATCH] Add Python binding build instructions --- docs/building.dox | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/building.dox b/docs/building.dox index b767ea945..e5ad3a7d0 100644 --- a/docs/building.dox +++ b/docs/building.dox @@ -124,6 +124,38 @@ cmake --build build --target docs The output website is located at `build/docs/html/` +@section python-binding-builds Building Python Bindings + +This section contains instructions for building and installing the Python bindings, which are created with [pybind11](https://github.com/pybind/pybind11). + +## Steps + +1. Clone the `pyslang` repository (https://github.com/MikePopoloski/slang) +2. Clone the `slang` submodule: + +@code{.ansi} +git submodule update --init --recursive +@endcode + +3. Create a virtual environment, activate it, and install `pyslang` as a Python package (including building the C++ `slang` library, with bindings): + +@code{.ansi} +python3 -m venv venv +source venv/bin/activate +pip install . +@endcode + +## Steps: Run the Python tests + +The Python tests are built and executed using the `pytest` framework. + +Install test/development dependencies, and run the Python tests: + +@code{.ansi} +pip install '.[test]' +pytest +@endcode + @section installation Installation CMake can be used to install slang.