Skip to content

Commit

Permalink
talipot-python: Ensure to use latest sip abi version for talipot module
Browse files Browse the repository at this point in the history
  • Loading branch information
anlambert committed Dec 29, 2024
1 parent a7947b7 commit 86384f5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ library/talipot-python/bindings/talipot-core/IntegerProperty.sip
library/talipot-python/bindings/talipot-core/LayoutProperty.sip
library/talipot-python/bindings/talipot-core/SizeProperty.sip
library/talipot-python/bindings/talipot-core/StringProperty.sip
library/talipot-python/bindings/talipot-core/pyproject.toml
3 changes: 3 additions & 0 deletions cmake/FindSIP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ FIND_FILE(

EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${find_sip_py}
OUTPUT_VARIABLE sip_config)

IF(sip_config)
STRING(REGEX REPLACE "^sip_version:([^\n]+).*$" "\\1" SIP_VERSION
${sip_config})
STRING(REGEX REPLACE ".*\nsip_version_num:([^\n]+).*$" "\\1" SIP_VERSION_NUM
${sip_config})
STRING(REGEX REPLACE ".*\nsip_version_str:([^\n]+).*$" "\\1" SIP_VERSION_STR
${sip_config})
STRING(REGEX REPLACE ".*\nsip_abi_version:([^\n]+).*$" "\\1" SIP_ABI_VERSION
${sip_config})
STRING(REGEX REPLACE ".*\nsip_module_version:([^\n]+).*$" "\\1"
SIP_MODULE_VERSION ${sip_config})
STRING(REGEX REPLACE ".*\ndefault_sip_dir:([^\n]+).*$" "\\1"
Expand Down
9 changes: 4 additions & 5 deletions cmake/FindSIP.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import sipbuild
from sipbuild.module.abi_version import (
resolve_abi_version,
get_sip_module_version
)
from sipbuild.module.abi_version import get_sip_module_version, resolve_abi_version

print("sip_version:%06.0x" % sipbuild.version.SIP_VERSION)
print("sip_version_num:%d" % sipbuild.version.SIP_VERSION)
print("sip_version_str:%s" % sipbuild.version.SIP_VERSION_STR)
abi_major_version = resolve_abi_version(abi_version=None).split('.')[0]
abi_version = resolve_abi_version(abi_version=None)
abi_major_version = abi_version.split(".")[0]
print("sip_abi_version:%s" % abi_version)
print("sip_module_version:%s" % get_sip_module_version(abi_major_version))
3 changes: 3 additions & 0 deletions library/talipot-python/bindings/talipot-core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ SET(TALIPOT_PYTHON_BINDINGS_SRC
${CMAKE_CURRENT_SOURCE_DIR}/build/talipot/siptalipotpart10.cpp
${CMAKE_CURRENT_SOURCE_DIR}/build/talipot/siptalipotpart11.cpp)

CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/pyproject.toml.in
${CMAKE_CURRENT_SOURCE_DIR}/pyproject.toml)

ADD_CUSTOM_COMMAND(
OUTPUT ${SIP_MODULE_SRC}
COMMAND ${SIP_MODULE_EXECUTABLE} --sdist talipot.native.sip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ build-backend = "sipbuild.api"
name = "talipot"

[tool.sip.project]
abi-version="@SIP_ABI_VERSION@"
sip-include-dirs = ["../stl"]
sip-module = "talipot.native.sip"

Expand Down

0 comments on commit 86384f5

Please sign in to comment.