Skip to content

Commit 6257993

Browse files
[SofaPython3/splib] Add a gentle deprecation message and info on how to find the SPLIB. (#191)
If someone do an import splib expecting to rely on the one in SofaPython3. This will raise an exception telling how to find it.
1 parent 5001e63 commit 6257993

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

CMakeLists.txt

+10
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,16 @@ SP3_add_python_package(
183183
Sofa/constants
184184
)
185185

186+
## This is only to warn users that splib is now relocated in its own repository
187+
# it just contains a __init__.py rising an exception indicating to where to find the plugin.
188+
# If splib is available, then splib/__init__.py will be overriden by the one from the real splib.
189+
SP3_add_python_package(
190+
SOURCE_DIRECTORY
191+
${CMAKE_CURRENT_SOURCE_DIR}/splib
192+
TARGET_DIRECTORY
193+
splib
194+
)
195+
186196
sofa_create_package(
187197
PACKAGE_NAME ${PROJECT_NAME}
188198
PACKAGE_VERSION ${PROJECT_VERSION}

splib/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""SPLIB is now relocated at: https://github.com/SofaDefrost/STLIB, please clone and install the plugin to use it"""
2+
raise Exception("SPLIB is now relocated at: https://github.com/SofaDefrost/STLIB, please clone and install the plugin to use it")
3+
4+

0 commit comments

Comments
 (0)