Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,15 @@ jobs:
run: cmake --build . --target test

- name: Build Python interface
run: |
pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Developer" 'python/[test]'
python -c "from mpi4py import MPI; import dolfinx; assert not dolfinx.has_petsc; assert not dolfinx.has_petsc4py; assert dolfinx.has_superlu_dist"
run: >
pip install 'python/[test]'
--check-build-dependencies
--no-build-isolation
--config-settings=cmake.build-type="Developer"
--verbose

- name: Check Python install
run: python -c "from mpi4py import MPI; import dolfinx; assert not dolfinx.has_petsc; assert not dolfinx.has_petsc4py; assert dolfinx.has_superlu_dist"

- name: Run mypy
working-directory: python
Expand Down
39 changes: 39 additions & 0 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,42 @@ endif()
set_target_properties(cpp PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE)

install(TARGETS cpp DESTINATION dolfinx)


if (WIN32)
message("Windows..." STATUS FATAL_ERROR)
else()
nanobind_add_stub(
cpp_stub
MODULE cpp
PYTHON_PATH $<TARGET_FILE_DIR:cpp>
DEPENDS cpp
MARKER_FILE cpp/py.typed
VERBOSE
RECURSIVE
# INSTALL_TIME
# OUTPUT_PATH dolfinx
OUTPUT
cpp/fem/__init__.pyi
cpp/fem/petsc.pyi
cpp/la/__init__.pyi
cpp/la/petsc.pyi
cpp/nls/__init__.pyi
cpp/nls/petsc.pyi
cpp/__init__.pyi
cpp/common.pyi
cpp/geometry.pyi
cpp/graph.pyi
cpp/io.pyi
cpp/log.pyi
cpp/mesh.pyi
cpp/refinement.pyi
)

install(TARGETS cpp LIBRARY DESTINATION dolfinx)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cpp
DESTINATION dolfinx
FILES_MATCHING
PATTERN "*.pyi"
PATTERN "*.typed")
endif()
Loading
Loading