diff --git a/CMakeLists.txt b/CMakeLists.txt index 717849017..d6fa4bd85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,9 @@ find_package( python_add_library(cutils MODULE - src/asammdf/blocks/cutils.c) + src/asammdf/blocks/cutils.c + WITH_SOABI USE_SABI 3.9) + target_link_libraries(cutils PRIVATE Python::NumPy) install(TARGETS cutils DESTINATION "asammdf/blocks") diff --git a/pyproject.toml b/pyproject.toml index a5c5fa990..c6b9c0a14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,6 +78,7 @@ Source = "https://github.com/danielhrisca/asammdf" metadata.version.provider = "scikit_build_core.metadata.regex" metadata.version.input = "src/asammdf/version.py" wheel.packages = ["src/asammdf"] +wheel.py-api = "cp39" [tool.black] line-length = 120 diff --git a/src/asammdf/blocks/cutils.c b/src/asammdf/blocks/cutils.c index 5f2e6ac25..13f1e03e1 100644 --- a/src/asammdf/blocks/cutils.c +++ b/src/asammdf/blocks/cutils.c @@ -1529,7 +1529,7 @@ static PyObject *bytes_dtype_size(PyObject *self, PyObject *args) break; } - current_size = PyBytes_GET_SIZE(*pointer); + current_size = PyBytes_Size(*pointer); if (current_size > size) size = current_size; }