2025-12-17 12:55:49 +01:00
2025-12-17 12:55:49 +01:00
2025-11-26 18:55:17 +01:00
2025-12-17 02:27:13 +01:00
2025-12-04 14:09:20 +01:00
2025-12-15 15:15:05 +01:00
2025-12-17 02:27:13 +01:00
2025-12-17 12:55:49 +01:00
2025-12-17 02:24:46 +01:00
2025-12-17 12:55:49 +01:00
2025-12-17 12:55:49 +01:00
2025-12-17 12:55:49 +01:00
2025-12-17 02:24:46 +01:00
2025-12-17 12:55:49 +01:00
2025-12-15 18:36:21 +01:00
2025-12-17 12:55:49 +01:00

llvm-nanobind

LLVM-C Python bindings with nanobind.

⚠️ This project is still in a very early design phase and not remotely usable.

Local development

Set the CMake prefix path environment variable to point to the LLVM prefix:

export CMAKE_PREFIX_PATH=$(brew --prefix llvm)

Configure the bindings:

cmake -B build -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

Build the bindings:

cmake --build build

Run the example:

uv run playground.py

Testing

Run the golden master tests (C++ and Python bindings):

uv run python run_tests.py

Run the vendored llvm-c-test integration tests:

uv run python run_llvm_c_tests.py        # Run all tests
uv run python run_llvm_c_tests.py -v     # Verbose output

Type Checking

Check type correctness of Python code:

uvx ty check                              # Check all Python files
uvx ty check llvm_c_test/                 # Check specific directory

Code Coverage

Generate code coverage reports:

uv run coverage run test_factorial.py     # Run test with coverage
uv run coverage report                    # Show coverage summary
uv run coverage html                      # Generate HTML report (htmlcov/)

To combine coverage from multiple test runs:

uv run coverage run --data-file=.coverage.test1 test_factorial.py
uv run coverage run --data-file=.coverage.test2 test_module.py
uv run coverage combine                   # Combine all .coverage.* files
uv run coverage report                    # Show combined report

For comprehensive coverage including test runners and all subprocess tests:

uv run coverage run --data-file=.coverage.run_tests run_tests.py
uv run coverage run --data-file=.coverage.run_llvm_c_tests run_llvm_c_tests.py
uv run coverage combine                   # Combine all coverage files
uv run coverage report                    # Show comprehensive report
uv run coverage html                      # Generate HTML report
S
Description
Automated archival mirror of github.com/LLVMParty/llvm-nanobind
Readme MIT 1.5 MiB
Languages
C++ 45.1%
Python 32.8%
C 16.3%
HTML 2.6%
LLVM 2.3%
Other 0.9%