Skip to content

Commit d6a5c88

Browse files
committed
Use pip install instead of git clone to retrieve pyperformance.
1 parent 700819d commit d6a5c88

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pyperf/pyperf_run

Lines changed: 9 additions & 6 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.0.4
78
#
89
# To make sure.
910
#
@@ -16,6 +17,7 @@ exit_out()
1617
usage()
1718
{
1819
echo "$1 Usage:"
20+
echo "--pyperf_version <vers number>: Versionof 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,11 @@ done
245252

246253
if [ $to_pbench -eq 0 ]; then
247254
rm -rf pyperformance
248-
git clone https://github.com/python/pyperformance
255+
python3 -m pip install pyperformance==$PYPERF_VERSION
249256
if [ $? -ne 0 ]; then
250-
exit_out "Cloning of https://github.com/python/pyperformance failed." 1
257+
exit_out "python3 -m pip install pyperformance==$PYPERF_VERSION: failed" 1
251258
fi
252259
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
257260
if [[ ${python_pkgs} != "" ]]; then
258261
pkg_list=`echo $python_pkgs | sed "s/,/ /g"`
259262
test_tools/package_install --packages "$python_pkgs" --no_packages $to_no_pkg_install

0 commit comments

Comments
 (0)