pyxcp 0.22.1__tar.gz → 0.22.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyxcp might be problematic. Click here for more details.
- pyxcp-0.22.3/CMakeLists.txt +123 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/PKG-INFO +1 -1
- pyxcp-0.22.3/build_ext.py +140 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyproject.toml +33 -12
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/__init__.py +1 -1
- pyxcp-0.22.1/build_ext.py +0 -72
- {pyxcp-0.22.1 → pyxcp-0.22.3}/LICENSE +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/README.md +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/aml/EtasCANMonitoring.a2l +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/aml/EtasCANMonitoring.aml +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/aml/XCP_Common.aml +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/aml/XCPonCAN.aml +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/aml/XCPonEth.aml +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/aml/XCPonFlx.aml +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/aml/XCPonSxI.aml +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/aml/XCPonUSB.aml +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/aml/ifdata_CAN.a2l +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/aml/ifdata_Eth.a2l +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/aml/ifdata_Flx.a2l +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/aml/ifdata_SxI.a2l +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/aml/ifdata_USB.a2l +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/asam/__init__.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/asam/types.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/asamkeydll.c +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/asamkeydll.sh +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/checksum.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/cmdline.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/config/__init__.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/config/legacy.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/constants.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/cpp_ext/__init__.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/cpp_ext/bin.hpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/cpp_ext/blockmem.hpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/cpp_ext/daqlist.hpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/cpp_ext/event.hpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/cpp_ext/extension_wrapper.cpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/cpp_ext/helper.hpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/cpp_ext/mcobject.hpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/cpp_ext/tsqueue.hpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/daq_stim/__init__.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/daq_stim/optimize/__init__.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/daq_stim/optimize/binpacking.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/daq_stim/scheduler.cpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/daq_stim/scheduler.hpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/daq_stim/stim.cpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/daq_stim/stim.hpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/daq_stim/stim_wrapper.cpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/dllif.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/errormatrix.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/conf_can.toml +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/conf_can_user.toml +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/conf_can_vector.json +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/conf_can_vector.toml +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/conf_eth.toml +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/conf_nixnet.json +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/conf_socket_can.toml +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/conf_sxi.json +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/conf_sxi.toml +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/ex_arrow.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/ex_mdf.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/ex_sqlite.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/run_daq.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/xcp_policy.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/xcp_read_benchmark.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/xcp_skel.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/xcp_unlock.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/xcp_user_supplied_driver.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/xcphello.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/examples/xcphello_recorder.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/master/__init__.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/master/errorhandler.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/master/master.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/py.typed +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/__init__.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/build_clang.cmd +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/build_clang.sh +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/build_gcc.cmd +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/build_gcc.sh +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/build_gcc_arm.sh +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/converter/__init__.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/lz4.c +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/lz4.h +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/lz4hc.c +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/lz4hc.h +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/mio.hpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/reader.hpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/reco.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/recorder.rst +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/rekorder.cpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/rekorder.hpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/setup.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/test_reko.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/unfolder.hpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/wrap.cpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/recorder/writer.hpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/scripts/__init__.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/scripts/pyxcp_probe_can_drivers.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/scripts/xcp_fetch_a2l.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/scripts/xcp_id_scanner.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/scripts/xcp_info.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/scripts/xcp_profile.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/stim/__init__.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/tests/test_asam_types.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/tests/test_binpacking.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/tests/test_can.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/tests/test_checksum.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/tests/test_daq.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/tests/test_frame_padding.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/tests/test_master.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/tests/test_transport.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/tests/test_utils.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/timing.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/transport/__init__.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/transport/base.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/transport/base_transport.hpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/transport/can.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/transport/eth.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/transport/sxi.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/transport/transport_wrapper.cpp +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/transport/usb_transport.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/types.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/utils.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/vector/__init__.py +0 -0
- {pyxcp-0.22.1 → pyxcp-0.22.3}/pyxcp/vector/map.py +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
|
|
2
|
+
cmake_minimum_required(VERSION 3.20...3.30)
|
|
3
|
+
project(pyxcp_extensions LANGUAGES C CXX)
|
|
4
|
+
|
|
5
|
+
cmake_policy(SET CMP0135 NEW)
|
|
6
|
+
cmake_policy(SET CMP0094 NEW)
|
|
7
|
+
|
|
8
|
+
find_package(Python3 COMPONENTS Interpreter Development)
|
|
9
|
+
find_package(pybind11 CONFIG)
|
|
10
|
+
|
|
11
|
+
SET(CMAKE_C_STANDARD 17)
|
|
12
|
+
set(CMAKE_CXX_STANDARD 23)
|
|
13
|
+
|
|
14
|
+
message( STATUS "Found pybind11 v${pybind11_VERSION} ${pybind11_VERSION_TYPE}: ${pybind11_INCLUDE_DIRS}")
|
|
15
|
+
|
|
16
|
+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/dist")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
SET(GCC_N_CLANG_BASE_OPTIONS "-std=c++23 -Wall -Wextra -Wpedantic -Warray-bounds -mtune=native -fexceptions")
|
|
20
|
+
|
|
21
|
+
SET(MSVC_BASE_OPTIONS "/W3 /permissive- /EHsc /bigobj /Zc:__cplusplus /std:c++latest")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
26
|
+
if (MSVC)
|
|
27
|
+
SET(MSVC_BASE_OPTIONS "${MSVC_BASE_OPTIONS} /Od /fsanitize=address /Zi")
|
|
28
|
+
else()
|
|
29
|
+
SET(MSVC_BASE_OPTIONS "${MSVC_BASE_OPTIONS} -Og -g3 -ggdb --fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -fsanitize=bounds") # -fsanitize=hwaddress
|
|
30
|
+
endif()
|
|
31
|
+
else ()
|
|
32
|
+
if (MSVC)
|
|
33
|
+
SET(MSVC_BASE_OPTIONS "${MSVC_BASE_OPTIONS} /Ox")
|
|
34
|
+
else()
|
|
35
|
+
SET(MSVC_BASE_OPTIONS "${MSVC_BASE_OPTIONS} -O3 --fomit-frame-pointer")
|
|
36
|
+
endif()
|
|
37
|
+
endif ()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
41
|
+
set(ENV{MACOSX_DEPLOYMENT_TARGET} "11.0")
|
|
42
|
+
SET(GCC_N_CLANG_EXTRA_OPTIONS "-stdlib=libc++")
|
|
43
|
+
message("Platform is Darwin")
|
|
44
|
+
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
45
|
+
message("Platform is WINDOWS")
|
|
46
|
+
SET(MSVC_EXTRA_OPTIONS "")
|
|
47
|
+
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
48
|
+
SET(GCC_N_CLANG_EXTRA_OPTIONS "-fvisibility=hidden -g0") # -fcoroutines
|
|
49
|
+
message("Platform is LINUX")
|
|
50
|
+
endif()
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
IF (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
|
54
|
+
|
|
55
|
+
ELSEIF (CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|
56
|
+
|
|
57
|
+
ELSEIF (CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
|
58
|
+
|
|
59
|
+
ELSE ()
|
|
60
|
+
|
|
61
|
+
ENDIF ()
|
|
62
|
+
|
|
63
|
+
IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
64
|
+
|
|
65
|
+
ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
66
|
+
|
|
67
|
+
ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
|
68
|
+
|
|
69
|
+
ELSE ()
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
ENDIF ()
|
|
73
|
+
|
|
74
|
+
message("Compiling C with: " ${CMAKE_C_COMPILER_ID})
|
|
75
|
+
message("Compiling Cpp with: " ${CMAKE_CXX_COMPILER_ID})
|
|
76
|
+
|
|
77
|
+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
78
|
+
|
|
79
|
+
set(EXTENSION_INCS ${CMAKE_CURRENT_SOURCE_DIR}/pyxcp/cpp_ext)
|
|
80
|
+
|
|
81
|
+
pybind11_add_module(rekorder pyxcp/recorder/wrap.cpp pyxcp/recorder/lz4.c pyxcp/recorder/lz4hc.c)
|
|
82
|
+
pybind11_add_module(cpp_ext pyxcp/cpp_ext/extension_wrapper.cpp)
|
|
83
|
+
pybind11_add_module(stim pyxcp/daq_stim/stim_wrapper.cpp pyxcp/daq_stim/stim.cpp pyxcp/daq_stim/scheduler.cpp)
|
|
84
|
+
|
|
85
|
+
target_include_directories(rekorder PRIVATE ${EXTENSION_INCS} ${CMAKE_CURRENT_SOURCE_DIR}/pyxcp/recorder)
|
|
86
|
+
target_include_directories(cpp_ext PRIVATE ${EXTENSION_INCS})
|
|
87
|
+
target_include_directories(stim PRIVATE ${EXTENSION_INCS} ${CMAKE_CURRENT_SOURCE_DIR}/pyxcp/daq_stim)
|
|
88
|
+
|
|
89
|
+
target_compile_options(rekorder PUBLIC "-DEXTENSION_NAME=pyxcp.recorder.rekorder")
|
|
90
|
+
target_compile_options(cpp_ext PUBLIC "-DEXTENSION_NAME=pyxcp.cpp_ext.cpp_ext")
|
|
91
|
+
target_compile_options(stim PUBLIC "-DEXTENSION_NAME=pyxcp.daq_stim.stim")
|
|
92
|
+
|
|
93
|
+
add_executable(asamkeydll ${CMAKE_CURRENT_SOURCE_DIR}/pyxcp/asamkeydll.c)
|
|
94
|
+
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
95
|
+
target_link_libraries(asamkeydll PRIVATE dl)
|
|
96
|
+
endif()
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
100
|
+
# CMAKE_SYSTEM_NAME STREQUAL "Windows"
|
|
101
|
+
endif()
|
|
102
|
+
|
|
103
|
+
IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
104
|
+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_N_CLANG_BASE_OPTIONS} ${GCC_N_CLANG_EXTRA_OPTIONS}")
|
|
105
|
+
target_link_options(cpp_ext PUBLIC -flto=auto)
|
|
106
|
+
target_link_options(stim PUBLIC -flto=auto)
|
|
107
|
+
target_link_options(rekorder PUBLIC -flto=auto)
|
|
108
|
+
ELSEIF (CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
|
109
|
+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MSVC_BASE_OPTIONS} ${MSVC_EXTRA_OPTIONS}")
|
|
110
|
+
ENDIF()
|
|
111
|
+
|
|
112
|
+
IF (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
113
|
+
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" -fuse-ld=lld)
|
|
114
|
+
ENDIF()
|
|
115
|
+
|
|
116
|
+
# target_include_directories(preprocessor PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/pya2l/extensions>)
|
|
117
|
+
# target_link_libraries(preprocessor pybind11::headers)
|
|
118
|
+
# set_target_properties(preprocessor PROPERTIES INTERPROCEDURAL_OPTIMIZATION ON CXX_VISIBILITY_PRESET ON VISIBILITY_INLINES_HIDDEN ON)
|
|
119
|
+
|
|
120
|
+
install(TARGETS rekorder LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/pyxcp/recorder)
|
|
121
|
+
install(TARGETS cpp_ext LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/pyxcp/cpp_ext)
|
|
122
|
+
install(TARGETS stim LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/pyxcp/daq_stim)
|
|
123
|
+
# install(TARGETS asamkeydll LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/pyxcp/)
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
import multiprocessing as mp
|
|
4
|
+
import os
|
|
5
|
+
import platform
|
|
6
|
+
import re
|
|
7
|
+
import subprocess # nosec
|
|
8
|
+
import sys
|
|
9
|
+
import sysconfig
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from tempfile import TemporaryDirectory
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
TOP_DIR = Path(__file__).parent
|
|
15
|
+
|
|
16
|
+
print("Platform", platform.system())
|
|
17
|
+
uname = platform.uname()
|
|
18
|
+
if uname.system == "Darwin":
|
|
19
|
+
os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.13"
|
|
20
|
+
|
|
21
|
+
VARS = sysconfig.get_config_vars()
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def get_python_base() -> str:
|
|
25
|
+
# Applies in this form only to Windows.
|
|
26
|
+
if "base" in VARS and VARS["base"]:
|
|
27
|
+
return VARS["base"]
|
|
28
|
+
if "installed_base" in VARS and VARS["installed_base"]:
|
|
29
|
+
return VARS["installed_base"]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def alternate_libdir(pth: str):
|
|
33
|
+
base = Path(pth).parent
|
|
34
|
+
libdir = Path(base) / "libs"
|
|
35
|
+
if libdir.exists():
|
|
36
|
+
# available_libs = os.listdir(libdir)
|
|
37
|
+
return str(libdir)
|
|
38
|
+
else:
|
|
39
|
+
return ""
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def get_py_config() -> dict:
|
|
43
|
+
pynd = VARS["py_version_nodot"] # Should always be present.
|
|
44
|
+
include = sysconfig.get_path("include") # Seems to be cross-platform.
|
|
45
|
+
if uname.system == "Windows":
|
|
46
|
+
base = get_python_base()
|
|
47
|
+
library = f"python{pynd}.lib"
|
|
48
|
+
libdir = Path(base) / "libs"
|
|
49
|
+
if libdir.exists():
|
|
50
|
+
available_libs = os.listdir(libdir)
|
|
51
|
+
if library in available_libs:
|
|
52
|
+
libdir = str(libdir)
|
|
53
|
+
else:
|
|
54
|
+
libdir = ""
|
|
55
|
+
else:
|
|
56
|
+
libdir = alternate_libdir(include)
|
|
57
|
+
else:
|
|
58
|
+
library = VARS["LIBRARY"]
|
|
59
|
+
DIR_VARS = ("LIBDIR", "BINLIBDEST", "DESTLIB", "LIBDEST", "MACHDESTLIB", "DESTSHARED", "LIBPL")
|
|
60
|
+
arch = None
|
|
61
|
+
if uname.system == "Linux":
|
|
62
|
+
arch = VARS.get("MULTIARCH", "")
|
|
63
|
+
for dir_var in DIR_VARS:
|
|
64
|
+
dir_name = VARS.get(dir_var)
|
|
65
|
+
if not dir_name:
|
|
66
|
+
continue
|
|
67
|
+
if uname.system == "Darwin":
|
|
68
|
+
full_path = [Path(dir_name) / library]
|
|
69
|
+
elif uname.system == "Linux":
|
|
70
|
+
full_path = [Path(dir_name) / arch / library, Path(dir_name) / library]
|
|
71
|
+
else:
|
|
72
|
+
print("PF?", uname.system)
|
|
73
|
+
for fp in full_path:
|
|
74
|
+
if fp.exists():
|
|
75
|
+
print(f"found Python library: '{full_path}'")
|
|
76
|
+
libdir = dir_name
|
|
77
|
+
break
|
|
78
|
+
# else:
|
|
79
|
+
# print(f"NOT found: '{full_path}'")
|
|
80
|
+
return dict(exe=sys.executable, include=include, libdir=libdir, library=library)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def banner(msg: str) -> None:
|
|
84
|
+
print("=" * 80)
|
|
85
|
+
print(str.center(msg, 80))
|
|
86
|
+
print("=" * 80)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def build_extension(debug: bool = False, use_temp_dir: bool = False) -> None:
|
|
90
|
+
print("build_ext::build_extension()")
|
|
91
|
+
|
|
92
|
+
debug = bool(os.environ.get("DEBUG", 0)) or debug
|
|
93
|
+
cfg = "Debug" if debug else "Release"
|
|
94
|
+
print(f" BUILD-TYPE: {cfg!r}")
|
|
95
|
+
|
|
96
|
+
py_cfg = get_py_config()
|
|
97
|
+
|
|
98
|
+
cmake_args = [
|
|
99
|
+
f"-DPython3_EXECUTABLE={py_cfg['exe']}",
|
|
100
|
+
f"-DPython3_INCLUDE_DIR={py_cfg['include']}",
|
|
101
|
+
f"-DPython3_LIBRARY={str(Path(py_cfg['libdir']) / Path(py_cfg['library']))}",
|
|
102
|
+
f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm
|
|
103
|
+
]
|
|
104
|
+
|
|
105
|
+
build_args = ["--config Release", "--verbose"]
|
|
106
|
+
# cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 /path/to/src
|
|
107
|
+
|
|
108
|
+
if sys.platform.startswith("darwin"):
|
|
109
|
+
# Cross-compile support for macOS - respect ARCHFLAGS if set
|
|
110
|
+
archs = re.findall(r"-arch (\S+)", os.environ.get("ARCHFLAGS", ""))
|
|
111
|
+
if archs:
|
|
112
|
+
cmake_args += ["-DCMAKE_OSX_ARCHITECTURES={}".format(";".join(archs))]
|
|
113
|
+
|
|
114
|
+
if use_temp_dir:
|
|
115
|
+
build_temp = Path(TemporaryDirectory(suffix=".build-temp").name) / "extension_it_in"
|
|
116
|
+
else:
|
|
117
|
+
build_temp = Path(".")
|
|
118
|
+
# print("cwd:", os.getcwd(), "build-dir:", build_temp, "top:", str(TOP_DIR))
|
|
119
|
+
if not build_temp.exists():
|
|
120
|
+
build_temp.mkdir(parents=True)
|
|
121
|
+
|
|
122
|
+
banner("Step #1: Configure")
|
|
123
|
+
# cmake_args += ["--debug-output"]
|
|
124
|
+
subprocess.run(["cmake", "-S", str(TOP_DIR), *cmake_args], cwd=build_temp, check=True) # nosec
|
|
125
|
+
|
|
126
|
+
cmake_args += [f"--parallel {mp.cpu_count()}"]
|
|
127
|
+
|
|
128
|
+
banner("Step #2: Build")
|
|
129
|
+
# build_args += ["-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"]
|
|
130
|
+
subprocess.run(["cmake", "--build", str(build_temp), *build_args], cwd=TOP_DIR, check=True) # nosec
|
|
131
|
+
|
|
132
|
+
banner("Step #3: Install")
|
|
133
|
+
subprocess.run(["cmake", "--install", "."], cwd=build_temp, check=True) # nosec
|
|
134
|
+
subprocess.run(["cmake", "--install", build_temp], cwd=TOP_DIR, check=True) # nosec
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
if __name__ == "__main__":
|
|
138
|
+
includes = subprocess.getoutput("pybind11-config --cmakedir") # nosec
|
|
139
|
+
os.environ["pybind11_DIR"] = includes
|
|
140
|
+
build_extension(False)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
[build-system]
|
|
3
|
-
requires = ["poetry-core>=1.0.0", "
|
|
3
|
+
requires = ["poetry-core>=1.0.0", "pybind11>=2.12.0", "pybind11[global]>=2.12.0"] # "setuptools>=68.0.0",
|
|
4
4
|
build-backend = "poetry.core.masonry.api"
|
|
5
5
|
|
|
6
6
|
|
|
@@ -36,7 +36,7 @@ dynamic = ["license", "readme", "authors", "requires-python", "description", "cl
|
|
|
36
36
|
[tool.poetry]
|
|
37
37
|
authors = ["Christoph Schueler <cpu.gems@googlemail.com>"]
|
|
38
38
|
name = "pyxcp"
|
|
39
|
-
version = "0.22.
|
|
39
|
+
version = "0.22.3"
|
|
40
40
|
readme = "README.md"
|
|
41
41
|
description = "Universal Calibration Protocol for Python"
|
|
42
42
|
keywords = ["automotive", "ecu", "xcp", "asam", "autosar"]
|
|
@@ -63,7 +63,14 @@ include = [
|
|
|
63
63
|
{ path = "pyxcp/recorder/*.so", format = "wheel" },
|
|
64
64
|
{ path = "pyxcp/recorder/*.pyd", format = "wheel" },
|
|
65
65
|
{ path = "pyxcp/*.exe", format = "wheel" },
|
|
66
|
-
{ path = "CMakeLists.txt", format = "
|
|
66
|
+
{ path = "CMakeLists.txt", format = "sdist" },
|
|
67
|
+
|
|
68
|
+
{ path = "pyxcp/cpp_ext/*hpp", format = "sdist" },
|
|
69
|
+
{ path = "pyxcp/cpp_ext/*cpp", format = "sdist" },
|
|
70
|
+
{ path = "pyxcp/daq_stim/*hpp", format = "sdist" },
|
|
71
|
+
{ path = "pyxcp/daq_stim/*cpp", format = "sdist" },
|
|
72
|
+
{ path = "pyxcp/recorder/*hpp", format = "sdist" },
|
|
73
|
+
{ path = "pyxcp/recorder/*cpp", format = "sdist" },
|
|
67
74
|
]
|
|
68
75
|
|
|
69
76
|
[tool.poetry.dependencies]
|
|
@@ -112,7 +119,7 @@ show_column_numbers = true
|
|
|
112
119
|
show_error_context = true
|
|
113
120
|
|
|
114
121
|
[tool.flake8]
|
|
115
|
-
ignore = ["
|
|
122
|
+
ignore = ["D203", "E203", "E266", "E501", "W503", "F403", "F401", "BLK100"]
|
|
116
123
|
exclude = '''
|
|
117
124
|
/(
|
|
118
125
|
\.git
|
|
@@ -135,8 +142,8 @@ statistics = true
|
|
|
135
142
|
show-source = true
|
|
136
143
|
max-line-length = 132
|
|
137
144
|
select = ["B","C","E","F","W","T4","B9"]
|
|
138
|
-
extend-select = "B950"
|
|
139
|
-
extend-ignore = ["E203", "E501", "E701"]
|
|
145
|
+
# extend-select = "B950"
|
|
146
|
+
# extend-ignore = ["E203", "E501", "E701"]
|
|
140
147
|
|
|
141
148
|
[tool.ruff]
|
|
142
149
|
line-length = 132
|
|
@@ -163,16 +170,30 @@ exclude = '''
|
|
|
163
170
|
[tool.cibuildwheel]
|
|
164
171
|
build-verbosity = 3
|
|
165
172
|
#test-command = "pytest {package}/tests"
|
|
166
|
-
|
|
173
|
+
|
|
167
174
|
build = "cp3{8,9,10,11,12,13}-*"
|
|
168
|
-
skip = ["*-manylinux_i686", "*-musllinux_x86_64", "*-musllinux_i686"
|
|
169
|
-
build-frontend = "
|
|
175
|
+
skip = ["*-manylinux_i686", "*-musllinux_x86_64", "*-musllinux_i686", "cp38-manylinux*", "cp39-manylinux*"]
|
|
176
|
+
build-frontend = "build"
|
|
177
|
+
|
|
178
|
+
[tool.cibuildwheel.macos]
|
|
179
|
+
archs = ["x86_64", "universal2", "arm64"]
|
|
180
|
+
|
|
181
|
+
[tool.cibuildwheel.windows]
|
|
182
|
+
archs = ["AMD64"] # , "ARM64"
|
|
183
|
+
|
|
184
|
+
[[tool.cibuildwheel.overrides]]
|
|
185
|
+
select = "cp3?-*"
|
|
186
|
+
manylinux-x86_64-image = "manylinux_2_35"
|
|
187
|
+
manylinux-aarch64-image = "manylinux_2_35"
|
|
188
|
+
|
|
189
|
+
[tool.cibuildwheel.linux]
|
|
190
|
+
# archs = ["auto", "aarch64"]
|
|
191
|
+
archs = ["x86_64", "aarch64"]
|
|
192
|
+
before-all = "yum install -y libffi openssl openssl-devel gcc"
|
|
170
193
|
|
|
171
194
|
[tool.pyright]
|
|
172
195
|
include = ["pyxcp", "build_ext.py"]
|
|
173
|
-
ignore = ["pyxcp/
|
|
174
|
-
"pyxcp/examples/ts_tester.py", "pyxcp/recorder/converter/**", "pyxcp/transport/candriver/**", "pyxcp/recorder/simdjson/**",
|
|
175
|
-
"pyxcp/recorder/mio/**", "pyxcp/recorder/lz4/**"]
|
|
196
|
+
ignore = ["pyxcp/recorder/converter/**", "pyxcp/recorder/simdjson/**","pyxcp/recorder/mio/**", "pyxcp/recorder/lz4/**"]
|
|
176
197
|
#defineConstant = { DEBUG = true }
|
|
177
198
|
#stubPath = "src/stubs"
|
|
178
199
|
|
pyxcp-0.22.1/build_ext.py
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
|
|
3
|
-
import multiprocessing as mp
|
|
4
|
-
import os
|
|
5
|
-
import platform
|
|
6
|
-
import re
|
|
7
|
-
import subprocess # nosec
|
|
8
|
-
import sys
|
|
9
|
-
from pathlib import Path
|
|
10
|
-
from tempfile import TemporaryDirectory
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
TOP_DIR = Path(__file__).parent
|
|
14
|
-
|
|
15
|
-
print("Platform", platform.system())
|
|
16
|
-
uname = platform.uname()
|
|
17
|
-
if uname.system == "Darwin":
|
|
18
|
-
os.environ["MACOSX_DEPLOYMENT_TARGET"] = "11.0"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def banner(msg: str) -> None:
|
|
22
|
-
print("=" * 80)
|
|
23
|
-
print(str.center(msg, 80))
|
|
24
|
-
print("=" * 80)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def build_extension(debug: bool = False, use_temp_dir: bool = False) -> None:
|
|
28
|
-
print("CMakeBuild::build_extension()")
|
|
29
|
-
|
|
30
|
-
debug = bool(os.environ.get("DEBUG", 0)) or debug
|
|
31
|
-
cfg = "Debug" if debug else "Release"
|
|
32
|
-
print(f" BUILD-TYPE: {cfg!r}")
|
|
33
|
-
cmake_args = [
|
|
34
|
-
f"-DPYTHON_EXECUTABLE={sys.executable}",
|
|
35
|
-
f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm
|
|
36
|
-
]
|
|
37
|
-
build_args = ["--config Release", "--verbose"]
|
|
38
|
-
# cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 /path/to/src
|
|
39
|
-
|
|
40
|
-
if sys.platform.startswith("darwin"):
|
|
41
|
-
# Cross-compile support for macOS - respect ARCHFLAGS if set
|
|
42
|
-
archs = re.findall(r"-arch (\S+)", os.environ.get("ARCHFLAGS", ""))
|
|
43
|
-
if archs:
|
|
44
|
-
cmake_args += ["-DCMAKE_OSX_ARCHITECTURES={}".format(";".join(archs))]
|
|
45
|
-
|
|
46
|
-
if use_temp_dir:
|
|
47
|
-
build_temp = Path(TemporaryDirectory(suffix=".build-temp").name) / "extension_it_in"
|
|
48
|
-
else:
|
|
49
|
-
build_temp = Path(".")
|
|
50
|
-
# print("cwd:", os.getcwd(), "build-dir:", build_temp, "top:", str(TOP_DIR))
|
|
51
|
-
if not build_temp.exists():
|
|
52
|
-
build_temp.mkdir(parents=True)
|
|
53
|
-
|
|
54
|
-
banner("Step #1: Configure")
|
|
55
|
-
# cmake_args += ["--debug-output"]
|
|
56
|
-
subprocess.run(["cmake", str(TOP_DIR), *cmake_args], cwd=build_temp, check=True) # nosec
|
|
57
|
-
|
|
58
|
-
cmake_args += [f"--parallel {mp.cpu_count()}"]
|
|
59
|
-
|
|
60
|
-
banner("Step #2: Build")
|
|
61
|
-
# build_args += ["-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"]
|
|
62
|
-
subprocess.run(["cmake", "--build", build_temp, *build_args], cwd=TOP_DIR, check=True) # nosec
|
|
63
|
-
|
|
64
|
-
banner("Step #3: Install")
|
|
65
|
-
# subprocess.run(["cmake", "--install", "."], cwd=build_temp, check=True) # nosec
|
|
66
|
-
subprocess.run(["cmake", "--install", build_temp], cwd=TOP_DIR, check=True) # nosec
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if __name__ == "__main__":
|
|
70
|
-
includes = subprocess.getoutput("pybind11-config --cmakedir") # nosec
|
|
71
|
-
os.environ["pybind11_DIR"] = includes
|
|
72
|
-
build_extension(False)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|