Skip to content

Commit

Permalink
Merge pull request #1113 from zariiii9003/cmake
Browse files Browse the repository at this point in the history
Move project configuration from setup.py to pyproject.toml / Build ABI3 wheels
  • Loading branch information
danielhrisca authored Dec 10, 2024
2 parents 22ed44e + 388d72c commit 78b5714
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 148 deletions.
24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.15...3.26)

project(
${SKBUILD_PROJECT_NAME}
LANGUAGES C
VERSION ${SKBUILD_PROJECT_VERSION})

find_package(
Python
COMPONENTS
Interpreter
Development.Module
${SKBUILD_SABI_COMPONENT}
NumPy
REQUIRED)

python_add_library(cutils
MODULE
src/asammdf/blocks/cutils.c
WITH_SOABI USE_SABI 3.9)

target_link_libraries(cutils PRIVATE Python::NumPy)

install(TARGETS cutils DESTINATION "asammdf/blocks")
82 changes: 80 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,84 @@
[build-system]
requires = ["numpy", "setuptools"]
build-backend = "setuptools.build_meta"
requires = ["scikit-build-core", "numpy"]
build-backend = "scikit_build_core.build"

[project]
name = "asammdf"
description="ASAM MDF measurement data file parser"
readme = "README.md"
requires-python = ">=3.9"
license = { text = "LGPLv3+" }
authors = [{ name = "Daniel Hrisca", email = "[email protected]" }]
dynamic = ["version"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development",
"Topic :: Scientific/Engineering",
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
keywords = [
"read",
"reader",
"edit",
"editor",
"parse",
"parser",
"asam",
"mdf",
"measurement",
]
dependencies = [
"canmatrix[arxml,dbc]>=1.0",
"isal; platform_machine == 'x86_64' or platform_machine == 'AMD64'",
"lxml>=4.9.3",
"lz4",
"numexpr",
"numpy>=1.23.0",
"pandas",
"python-dateutil",
"typing-extensions",
]

[project.optional-dependencies]
decode = ["faust-cchardet==2.1.19", "chardet"]
export = [
"pyarrow",
"h5py",
"hdf5storage>=0.1.19",
"python-snappy",
]
export_matlab_v5 = ["scipy"]
gui = [
"natsort",
"PySide6",
"pyqtgraph",
"pyqtlet2",
"packaging",
"QtPy",
]
encryption = ["cryptography", "keyring"]
symbolic_math = ["sympy"]
filesystem = ["fsspec"]

[project.scripts]
asammdf = "asammdf.app.asammdfgui:main [gui]"

[project.urls]
Documentation = "https://asammdf.readthedocs.io/en/master"
Issues = "https://github.com/danielhrisca/asammdf/issues"
Source = "https://github.com/danielhrisca/asammdf"

[tool.scikit-build]
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
Expand Down
145 changes: 0 additions & 145 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/asammdf/blocks/cutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 78b5714

Please sign in to comment.