Skip to content

Commit

Permalink
Merge pull request #29 from redhat-performance/use_pip_install
Browse files Browse the repository at this point in the history
Use pip install instead of git clone to retrieve pyperformance.
  • Loading branch information
kdvalin authored Sep 3, 2024
2 parents 700819d + d164cb7 commit 7599ed2
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions pyperf/pyperf_run
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PATH="${PATH}:/usr/local/bin"
export PATH
python_pkgs=""
python_exec=""
PYPERF_VERSION="1.11.0"
#
# To make sure.
#
Expand All @@ -16,6 +17,7 @@ exit_out()
usage()
{
echo "$1 Usage:"
echo "--pyperf_version <version number>: Version of pyperf to run, default is $PYPERF_VERSION."
echo "--python_exec_path: Python to set via alternatives"
echo "--python_pkgs: comma seprated list of python packages to install"
source test_tools/general_setup --usage
Expand Down Expand Up @@ -198,6 +200,7 @@ fi
source test_tools/general_setup "$@"

ARGUMENT_LIST=(
"pyperf_version"
"python_exec"
"python_pkgs"
)
Expand All @@ -219,6 +222,10 @@ eval set --$opts

while [[ $# -gt 0 ]]; do
case "$1" in
--pyperf_version)
PYPERF_VERSION=$2
shift 2
;;
--python_exec)
python_exec=$2
shift 2
Expand All @@ -245,15 +252,12 @@ done

if [ $to_pbench -eq 0 ]; then
rm -rf pyperformance
git clone https://github.com/python/pyperformance

python3 -m pip install pyperformance==$PYPERF_VERSION
if [ $? -ne 0 ]; then
exit_out "Cloning of https://github.com/python/pyperformance failed." 1
exit_out "python3 -m pip install pyperformance==$PYPERF_VERSION: failed" 1
fi
cd pyperformance
git checkout tags/1.0.4
if [ $? -ne 0 ]; then
exit_out "Checkout of 1.0.4 failed." 1
fi
if [[ ${python_pkgs} != "" ]]; then
pkg_list=`echo $python_pkgs | sed "s/,/ /g"`
test_tools/package_install --packages "$python_pkgs" --no_packages $to_no_pkg_install
Expand All @@ -268,14 +272,6 @@ if [ $to_pbench -eq 0 ]; then
alternatives --remove-all python
alternatives --install /usr/bin/python python $python_exec 1
fi
#
# Install pip/pip3
#
wget https://bootstrap.pypa.io/get-pip.py
if [[ $? -ne 0 ]]; then
exit_out "Failed: wget https://bootstrap.pypa.io/get-pip.py" 1
fi
python3 ./get-pip.py
pip3_install psutil
pip3_install packaging
pip3_install pyparsing
Expand Down

0 comments on commit 7599ed2

Please sign in to comment.