Skip to content

Commit f3f673d

Browse files
committed
Add stubs (i.e type hints)
1 parent 564cfcc commit f3f673d

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

CMakeLists.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,19 @@ find_package(nanobind CONFIG REQUIRED)
1616

1717
nanobind_add_module(pgeof_ext NOMINSIZE STABLE_ABI LTO src/pgeof_ext.cpp)
1818

19-
# for nanobind 2
20-
# nanobind_add_stub(
21-
# pgeof_ext_stub
22-
# MODULE pgeof_ext
23-
# OUTPUT pgeof_ext.pyi
24-
# PYTHON_PATH $<TARGET_FILE_DIR:pgeof_ext>
25-
# DEPENDS pgeof_ext
26-
# )
19+
nanobind_add_stub(
20+
pgeof_ext_stub
21+
MODULE pgeof_ext
22+
OUTPUT pgeof_ext.pyi
23+
MARKER_FILE py.typed
24+
PYTHON_PATH $<TARGET_FILE_DIR:pgeof_ext>
25+
DEPENDS pgeof_ext
26+
)
2727

2828
# All lib are headeer only.
2929
# it's faster to include like this than using exported targets
3030
# (i.e add_subdirectories(...))
3131
target_include_directories(pgeof_ext PRIVATE "include" "third_party/eigen" "third_party/nanoflann/include" "third_party/taskflow")
3232

33-
install(TARGETS pgeof_ext LIBRARY DESTINATION pgeof)
33+
install(TARGETS pgeof_ext LIBRARY DESTINATION pgeof)
34+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pgeof_ext.pyi ${CMAKE_CURRENT_BINARY_DIR}/py.typed DESTINATION pgeof)

0 commit comments

Comments
 (0)