Skip to content

Commit 124a1f5

Browse files
author
Kevin Vu te Laar
committed
python binding: install and fix CI
Install: - As of Python 3.3+, `__init__.py` is not required in site-package folders. Those folders are seen as module by default. - Helps with file ownership when installing the binding wrapper via pip as part of the villas-node package and the bindings from the codebase. CI: - Fixed wrong variable name in the CI script. - .so file should be found and symlinked properly into `/python/villas/node` for testing purposes. Signed-off-by: Kevin Vu te Laar <vu.te@rwth-aachen.de>
1 parent f73fc67 commit 124a1f5

2 files changed

Lines changed: 2 additions & 9 deletions

File tree

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ test:python_unit_integration:
181181
- cmake --build build ${CMAKE_BUILD_OPTS} --target python_binding
182182

183183
- binding_path=$(find ${PWD}/build/python/binding/ -name "python_binding*.so" | head -n1)
184-
- link_path=${PWD}/python/villas/node/$(basename $python_binding)
184+
- link_path=${PWD}/python/villas/node/$(basename $binding_path)
185185
- ln -sf $binding_path $link_path
186186

187187
- cmake --build build ${CMAKE_BUILD_OPTS} --target run-python-unit-tests run-python-integration-tests
188-
- rm $node_path
188+
- rm $link_path
189189
needs:
190190
- job: "build:source: [fedora]"
191191
artifacts: true

python/binding/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ if(pybind11_FOUND)
2828
COMPONENT lib
2929
LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES}/villas/node/
3030
)
31-
file(WRITE "${CMAKE_BINARY_DIR}/python/villas/__init__.py" "")
32-
file(WRITE "${CMAKE_BINARY_DIR}/python/villas/node/__init__.py" "")
33-
install(
34-
DIRECTORY "${CMAKE_BINARY_DIR}/python/villas"
35-
DESTINATION "${PYTHON_SITE_PACKAGES}"
36-
FILES_MATCHING PATTERN "__init__.py"
37-
)
3831
else()
3932
message(STATUS "pybind11 not found. Skipping Python wrapper build.")
4033
endif()

0 commit comments

Comments
 (0)