Skip to content

Commit

Permalink
Create requirements file for workflow
Browse files Browse the repository at this point in the history
* Create requirements file for workflow
* resolve vulnerabilities of pip dependencies
* Adapt to newer setuptools
* Update README.md
  • Loading branch information
berndgassmann committed Feb 13, 2024
1 parent 66ca584 commit 526dba9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 17 deletions.
18 changes: 4 additions & 14 deletions .github/workflows/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 !!!!!!!"
Expand Down Expand Up @@ -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
14 changes: 14 additions & 0 deletions .github/workflows/requirements.txt
Original file line number Diff line number Diff line change
@@ -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

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 9 additions & 2 deletions cmake/python-binding.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down

0 comments on commit 526dba9

Please sign in to comment.