diff --git a/.github/workflows/install_dependencies.sh b/.github/workflows/install_dependencies.sh index ec2b5715e7..49a4302c0e 100644 --- a/.github/workflows/install_dependencies.sh +++ b/.github/workflows/install_dependencies.sh @@ -45,10 +45,9 @@ fi sudo apt-get install -y --no-install-recommends python${PYTHON_BINDING_VERSION}-dev libpython${PYTHON_BINDING_VERSION}-dev curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python${PYTHON_BINDING_VERSION} -# to handle some error on missing pip dependencies -sudo pip${PYTHON_BINDING_VERSION} install testresources -sudo pip${PYTHON_BINDING_VERSION} install --upgrade setuptools==59.6.0 -sudo pip${PYTHON_BINDING_VERSION} install colcon-common-extensions xmlrunner pygccxml pyplusplus +if [[ "${BUILD_DOCU}x" != "x" ]]; then + sudo apt-get install doxygen graphviz lcov +fi if (( IS_UBUNTU_20_04 && IS_PYTHON_3_10 )); then echo "!!!!!!! Ubunut 20.04 and python 3.10: compile boost 1.80 !!!!!!!" @@ -85,13 +84,4 @@ if (( IS_UBUNTU_20_04 && IS_PYTHON_3_10 )); then fi - -if [[ "${BUILD_DOCU}x" != "x" ]]; then - sudo apt-get install doxygen graphviz lcov - sudo pip3 install --upgrade six>=1.11.0 - sudo pip3 install Markdown==3.2.1 - sudo pip3 install mkdocs - sudo pip3 install markdown-include - sudo pip3 install pymdown-extensions==8.0.1 - sudo pip3 install pygments mdx_truly_sane_lists -fi +sudo pip${PYTHON_BINDING_VERSION} install -r .github/workflows/requirements.txt diff --git a/.github/workflows/requirements.txt b/.github/workflows/requirements.txt new file mode 100644 index 0000000000..306a6373d4 --- /dev/null +++ b/.github/workflows/requirements.txt @@ -0,0 +1,14 @@ +colcon-common-extensions==0.3.0 +Markdown==3.5.2 +markdown-include==0.8.1 +mdx_truly_sane_lists==1.3 +mkdocs==1.5.3 +pygccxml==2.4.0 +Pygments==2.17.2 +pymdown-extensions==10.7 +pyplusplus==1.8.5 +setuptools==69.1.0 +six==1.16.0 +testresources==2.0.1 +xmlrunner==1.7.7 + diff --git a/README.md b/README.md index b56c4dd95e..60a1699798 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,10 @@ [![License](https://img.shields.io/badge/License-LGPL%202.1--Clause-blue.svg)](https://opensource.org/licenses/LGPL-2.1) [![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/intel/ad-rss-lib.svg)](https://github.com/intel/ad-rss-lib/releases/latest) -[![Build Status](https://github.com/intel/ad-rss-lib/workflows/Test/badge.svg?branch=main)](https://github.com/intel/ad-rss-lib/actions?query=workflow%3A%22Test%22) +[![Build Status](https://github.com/intel/ad-rss-lib/actions/workflows/build_test.yml/badge.svg?branch=main)](https://github.com/intel/ad-rss-lib/actions/workflows/build_test.yml/badge.svg?branch=main) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8374/badge)](https://www.bestpractices.dev/projects/8374) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/intel/ad-rss-lib/badge)](https://securityscorecards.dev/viewer/?uri=github.com/intel/ad-rss-lib) + # Table of contents 1. [Introduction](#introduction) diff --git a/cmake/python-binding.cmake b/cmake/python-binding.cmake index 5a59ccb39a..c9b57d6417 100644 --- a/cmake/python-binding.cmake +++ b/cmake/python-binding.cmake @@ -69,8 +69,14 @@ function(find_python_binding_packages) endfunction() function(get_python_test_environment) + set(LIBDIR_PREFIX "local/") + set(PACKAGE_FOLDER_NAME "dist-packages") + if ("${PYTHON_BINDING_FOLDER_NAME}" STREQUAL "python3.8") + set(LIBDIR_PREFIX "") + set(PACKAGE_FOLDER_NAME "site-packages") + endif() set(TEST_LD_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") - set(TEST_PYTHONPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${PYTHON_BINDING_FOLDER_NAME}/site-packages") + set(TEST_PYTHONPATH "${CMAKE_INSTALL_PREFIX}/${LIBDIR_PREFIX}${CMAKE_INSTALL_LIBDIR}/${PYTHON_BINDING_FOLDER_NAME}/${PACKAGE_FOLDER_NAME}") foreach(dep ${ARGN}) get_target_property(dep_configurations ${dep} IMPORTED_CONFIGURATIONS) set(TEST_${dep}_LOCATION False) @@ -83,7 +89,8 @@ function(get_python_test_environment) endforeach() if(TEST_${dep}_LOCATION) set(TEST_LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:${TEST_${dep}_LOCATION}") - set(TEST_PYTHONPATH "${TEST_PYTHONPATH}:${TEST_${dep}_LOCATION}/${PYTHON_BINDING_FOLDER_NAME}/site-packages") + string(REGEX REPLACE "/${CMAKE_INSTALL_LIBDIR}$" "" TEST_${dep}_INSTALL_PREFIX ${TEST_${dep}_LOCATION}) + set(TEST_PYTHONPATH "${TEST_PYTHONPATH}:${TEST_${dep}_INSTALL_PREFIX}/${LIBDIR_PREFIX}${CMAKE_INSTALL_LIBDIR}/${PYTHON_BINDING_FOLDER_NAME}/${PACKAGE_FOLDER_NAME}") else() message(WARNING "Failed to query mandatory location of dependency ${dep}") endif()