From 2acf248583a1a1c6f8818603329fee0285b3689b Mon Sep 17 00:00:00 2001 From: Kyle Schwarz Date: Thu, 9 Jan 2025 00:14:46 -0500 Subject: [PATCH] Bindings: Python: Add stubs --- bindings/python/CMakeLists.txt | 6 +++++- bindings/python/__init__.py | 1 + bindings/python/py.typed | 0 pyproject.toml | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 bindings/python/__init__.py create mode 100644 bindings/python/py.typed diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt index 47813a0..aed911a 100644 --- a/bindings/python/CMakeLists.txt +++ b/bindings/python/CMakeLists.txt @@ -26,4 +26,8 @@ pybind11_add_module(icsneopy ) target_link_libraries(icsneopy PRIVATE icsneocpp) -install(TARGETS icsneopy LIBRARY DESTINATION .) +install(TARGETS icsneopy LIBRARY DESTINATION icsneopy) + +add_custom_command(TARGET icsneopy POST_BUILD COMMAND stubgen -m icsneopy -o .) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/icsneopy.pyi __init__.py py.typed DESTINATION icsneopy) diff --git a/bindings/python/__init__.py b/bindings/python/__init__.py new file mode 100644 index 0000000..f6be1c9 --- /dev/null +++ b/bindings/python/__init__.py @@ -0,0 +1 @@ +from .icsneopy import * diff --git a/bindings/python/py.typed b/bindings/python/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml index 8f33408..6d462c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["scikit-build-core", "pybind11", "setuptools>=64", "setuptools-scm>=8"] +requires = ["scikit-build-core", "pybind11", "setuptools>=64", "setuptools-scm>=8", "mypy"] build-backend = "scikit_build_core.build" [project]