Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit bdccf36

Browse files
authored
Revert installing Python module systemwide. (#473)
The lines install( TARGETS _morphio LIBRARY DESTINATION ${Python3_SITEARCH}/morphio/ ) cause CMake to find the directory where Python modules are installed. This would be the systemwide directory if one is simply building with the systemwide Python. If one has a venv active it'll install into that virtual environment. Note that `CMAKE_INSTALL_PREFIX` doesn't affect where the module will be installed. Therefore, this will cause build/installation failure. Installing into a venv is questionable, because that's the responsibility of the Python package manager. Which will do so correctly without the additional CMake `install` statement. Finally, even if the install succeeds, it only installs the `lib*.so` without any `__init__.py` files. Therefore, it leads to a broken installation, e.g. python -c "import morphio; morphio.Soma" will successfully import `morphio` but there won't be any `morphio.Soma`, because that's handled via `__init__.py`
1 parent e75d9f4 commit bdccf36

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

binds/python/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,3 @@ target_link_libraries(_morphio
1717
PRIVATE morphio_static
1818
PRIVATE pybind11::module
1919
)
20-
21-
find_package (Python3)
22-
23-
install(
24-
TARGETS _morphio
25-
LIBRARY DESTINATION ${Python3_SITEARCH}/morphio/
26-
)

0 commit comments

Comments
 (0)