Skip to content

Commit 7599ed2

Browse files
authored
Merge pull request #29 from redhat-performance/use_pip_install
Use pip install instead of git clone to retrieve pyperformance.
2 parents 700819d + d164cb7 commit 7599ed2

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

pyperf/pyperf_run

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ PATH="${PATH}:/usr/local/bin"
44
export PATH
55
python_pkgs=""
66
python_exec=""
7+
PYPERF_VERSION="1.11.0"
78
#
89
# To make sure.
910
#
@@ -16,6 +17,7 @@ exit_out()
1617
usage()
1718
{
1819
echo "$1 Usage:"
20+
echo "--pyperf_version <version number>: Version of pyperf to run, default is $PYPERF_VERSION."
1921
echo "--python_exec_path: Python to set via alternatives"
2022
echo "--python_pkgs: comma seprated list of python packages to install"
2123
source test_tools/general_setup --usage
@@ -198,6 +200,7 @@ fi
198200
source test_tools/general_setup "$@"
199201

200202
ARGUMENT_LIST=(
203+
"pyperf_version"
201204
"python_exec"
202205
"python_pkgs"
203206
)
@@ -219,6 +222,10 @@ eval set --$opts
219222

220223
while [[ $# -gt 0 ]]; do
221224
case "$1" in
225+
--pyperf_version)
226+
PYPERF_VERSION=$2
227+
shift 2
228+
;;
222229
--python_exec)
223230
python_exec=$2
224231
shift 2
@@ -245,15 +252,12 @@ done
245252

246253
if [ $to_pbench -eq 0 ]; then
247254
rm -rf pyperformance
248-
git clone https://github.com/python/pyperformance
255+
256+
python3 -m pip install pyperformance==$PYPERF_VERSION
249257
if [ $? -ne 0 ]; then
250-
exit_out "Cloning of https://github.com/python/pyperformance failed." 1
258+
exit_out "python3 -m pip install pyperformance==$PYPERF_VERSION: failed" 1
251259
fi
252260
cd pyperformance
253-
git checkout tags/1.0.4
254-
if [ $? -ne 0 ]; then
255-
exit_out "Checkout of 1.0.4 failed." 1
256-
fi
257261
if [[ ${python_pkgs} != "" ]]; then
258262
pkg_list=`echo $python_pkgs | sed "s/,/ /g"`
259263
test_tools/package_install --packages "$python_pkgs" --no_packages $to_no_pkg_install
@@ -268,14 +272,6 @@ if [ $to_pbench -eq 0 ]; then
268272
alternatives --remove-all python
269273
alternatives --install /usr/bin/python python $python_exec 1
270274
fi
271-
#
272-
# Install pip/pip3
273-
#
274-
wget https://bootstrap.pypa.io/get-pip.py
275-
if [[ $? -ne 0 ]]; then
276-
exit_out "Failed: wget https://bootstrap.pypa.io/get-pip.py" 1
277-
fi
278-
python3 ./get-pip.py
279275
pip3_install psutil
280276
pip3_install packaging
281277
pip3_install pyparsing

0 commit comments

Comments
 (0)