Skip to content
This repository was archived by the owner on Feb 19, 2024. It is now read-only.

Commit 33b0881

Browse files
authored
Feature/migrate jenkins to self hosted hicrosoft servers (#199)
Make the tests comply with azure pipelines - chang cmake to give more output in verbose mode - new requirements in requirements.txt - reformated the tests - new order on the imports - The python library that is being used can now be given by a flag to cmake
1 parent 617123d commit 33b0881

21 files changed

Lines changed: 422 additions & 550 deletions

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,22 @@ dist
1919
.tox
2020
_skbuild
2121
_cmake_test_compile
22+
**/test-results/
23+
24+
25+
# Hidden utility-folders and files
26+
**/delete_me*
27+
**/.hidden/
28+
.vscode
29+
node_modules/
30+
31+
32+
33+
# Directories for debugging
34+
test-reports
35+
repeatable_dist
36+
testinfo
37+
test_results
38+
.util
39+
buildinfo
40+
repeatable_skbuild/

CMakeLists.txt

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,28 @@ if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
44
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
55
CACHE STRING "")
66
endif()
7-
87
# Name of the project
98
project (pc-ble-driver-py)
10-
9+
# PYTHON_LIBRARY is changed by the PythonExtensions package, so a different variable is required to keep the original user flag
10+
set(PYTHON_LIBRARY_FROM_USER_FLAGS "${PYTHON_LIBRARY}")
11+
# Use non-debug version of python, even when building a debug version
12+
add_definitions(-DSWIG_PYTHON_INTERPRETER_NO_DEBUG)
13+
message(VERBOSE "CMAKE executable path ${CMAKE_COMMAND}")
14+
message(VERBOSE "CMAKE generator name: ${CMAKE_GENERATOR}")
15+
message(VERBOSE "CMAKE generator path ${CMAKE_MAKE_PROGRAM}")
16+
message(VERBOSE "CMAKE_MODULE_PATH before most other commands : ${CMAKE_MODULE_PATH}")
17+
message(VERBOSE "The include directories are (before PythonExtensions): ${PYTHON_INCLUDE_DIR}")
1118
find_package(PythonExtensions REQUIRED)
19+
message(VERBOSE "The include directories are (after PythonExtensions): ${PYTHON_INCLUDE_DIR}")
20+
message(VERBOSE "PythonExtension parameters")
21+
message(VERBOSE "PYTHON_PREFIX : ${PYTHON_PREFIX} ")
22+
message(VERBOSE "PYTHON_SITE_PACKAGES_DIR : ${PYTHON_SITE_PACKAGES_DIR} ")
23+
message(VERBOSE "PYTHON_RELATIVE_SITE_PACKAGES_DIR: ${PYTHON_RELATIVE_SITE_PACKAGES_DIR} ")
24+
message(VERBOSE "PYTHON_SEPARATOR : ${PYTHON_SEPARATOR} ")
25+
message(VERBOSE "PYTHON_PATH_SEPARATOR : ${PYTHON_PATH_SEPARATOR} ")
26+
message(VERBOSE "PYTHON_EXTENSION_MODULE_SUFFIX : ${PYTHON_EXTENSION_MODULE_SUFFIX} ")
27+
message(VERBOSE "PYTHON_EXTENSION_MODULE_SUFFIX : ${PYTHON_EXTENSION_MODULE_SUFFIX} ")
28+
message(VERBOSE "CMAKE_MODULE_PATH after most other commands : ${CMAKE_MODULE_PATH}")
1229

1330
if(WIN32)
1431
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_hypot=hypot")
@@ -31,12 +48,10 @@ find_package(nrf-ble-driver ${NRF_BLE_DRIVER_VERSION} EXACT CONFIG REQUIRED)
3148

3249
# PYTHON_INCLUDE_DIR provided by scikit-build
3350
include_directories(${PYTHON_INCLUDE_DIR})
51+
message(VERBOSE "The Python include directories are: ${PYTHON_INCLUDE_DIR}")
3452

3553
set(SWIG_I_FILE ${CMAKE_CURRENT_LIST_DIR}/swig/pc_ble_driver.i.in)
3654

37-
# Use release lib of Python even when building with DEBUG
38-
add_definitions(-DSWIG_PYTHON_INTERPRETER_NO_DEBUG)
39-
4055
# Avoid warning on Windows
4156
if(WIN32)
4257
add_definitions(-DHAVE_ROUND)
@@ -48,6 +63,8 @@ foreach(SD_API_VER ${SD_API_VERS})
4863
# Copy SWIG-generated wrapper
4964
set(SWIG_I_FILE_${SD_API_VER} ${PC_BLE_DRIVER_PY_OUTDIR}/${PYTHON_MODULE_${SD_API_VER}}.i)
5065
set(SWIG_MODULE_NAME ${PYTHON_MODULE_${SD_API_VER}})
66+
# Use release lib of Python even when building with DEBUG
67+
add_definitions(-DSWIG_PYTHON_INTERPRETER_NO_DEBUG)
5168
configure_file(${SWIG_I_FILE} ${SWIG_I_FILE_${SD_API_VER}})
5269
set_property(SOURCE ${SWIG_I_FILE_${SD_API_VER}} APPEND PROPERTY SWIG_FLAGS "-threads")
5370
set_property(SOURCE ${SWIG_I_FILE_${SD_API_VER}} APPEND PROPERTY SWIG_FLAGS "-Wall")
@@ -98,10 +115,11 @@ foreach(SD_API_VER ${SD_API_VERS})
98115

99116
set(LINK_LIBRARIES nrf::nrf_ble_driver_sd_api_v${SD_API_VER}_${NRF_BLE_DRIVER_LINKAGE_TYPE})
100117
if (WIN32 OR APPLE)
101-
set(LINK_LIBRARIES ${LINK_LIBRARIES} ${PYTHON_LIBRARY})
118+
set(LINK_LIBRARIES ${LINK_LIBRARIES} ${PYTHON_LIBRARY_FROM_USER_FLAGS})
119+
message(VERBOSE "Python library from the user flags is : ${PYTHON_LIBRARY_FROM_USER_FLAGS}")
102120
endif()
103121

104-
message(STATUS "LINK_LIBRARIES are not ${LINK_LIBRARIES}")
122+
message(VERBOSE STATUS "LINK_LIBRARIES are ${LINK_LIBRARIES}")
105123

106124
target_link_libraries(${PYTHON_MODULE_${SD_API_VER}} PRIVATE ${LINK_LIBRARIES})
107125
target_compile_definitions(${PYTHON_MODULE_${SD_API_VER}} PRIVATE NRF_SD_BLE_API_VERSION=${SD_API_VER})

azure-pipelines.yml

Lines changed: 0 additions & 270 deletions
This file was deleted.

pc_ble_driver_py/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
4040
"""
4141

42-
__version__ = "0.16.0"
42+
__version__ = "0.16.1"

pc_ble_driver_py/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def conn_ic_hex_get():
8686

8787

8888
def get_connectivity_hex_version():
89-
return "4.1.2"
89+
return "4.1.4"
9090

9191

9292
def get_connectivity_hex_baud_rate():

requirements-dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ scikit-build ~= 0.11.1
44
cmake >= 3.13.3
55
ninja ~= 1.9.0
66
tox ~= 3.9.0
7+
unittest-xml-reporting==3.0.4
8+
xmlrunner~=1.7.7

0 commit comments

Comments
 (0)