Created
February 18, 2015 20:37
-
-
Save xolox/3ac505dab5f410e8739c to your computer and use it in GitHub Desktop.
pip-accel issue #49 (scipy / numpy / setuptools / setup_requires interaction)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2015-02-17 23:53:02 - Running first 'pip-accel install scipy' command .. | |
2015-02-18 00:06:59 - Running second 'pip-accel install scipy' command .. | |
2015-02-18 00:09:02 - Built 2 packages on first run. | |
2015-02-18 00:09:02 - Built 0 packages on second run. | |
2015-02-18 00:09:03 - Done! | |
Time of first run: +/- 14 minutes | |
Time of second run: +/- 2 minutes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
main () { | |
# Simulate pip-accel issue #49 on GitHub: | |
# https://github.com/paylogic/pip-accel/issues/49 | |
ROOT=$(mktemp -d) | |
ENV1=$ROOT/env1 | |
LOG1=$ROOT/env1.log | |
ENV2=$ROOT/env2 | |
LOG2=$ROOT/env2.log | |
satisfy_scipy_build_deps | |
reset_binary_cache | |
install_scipy $ENV1 $LOG1 first | |
install_scipy $ENV2 $LOG2 second | |
dump_stats $LOG1 first | |
dump_stats $LOG2 second | |
rm -R $ROOT | |
msg "Done!" | |
} | |
satisfy_scipy_build_deps () { | |
# Make sure the build dependencies of SciPy are satisfied | |
# (this is based on Ubuntu Linux 12.04 - Precise Pangolin). | |
sudo apt-get install --yes gfortran libatlas-base-dev | |
} | |
reset_binary_cache () { | |
# Start the test from a clean slate. | |
rm -f ~/.pip-accel/binaries/v7/scipy:*.tar.gz | |
rm -f ~/.pip-accel/binaries/v7/numpy:*.tar.gz | |
} | |
install_scipy () { | |
# Simulate a user encountering issue #49. | |
local env=$1 | |
local log=$2 | |
local label=$3 | |
msg "Running $label 'pip-accel install scipy' command .." | |
virtualenv $env &>/dev/null | |
$env/bin/pip install pip-accel &>/dev/null | |
script -qc "$env/bin/pip-accel install scipy" $log | |
} | |
dump_stats () { | |
# Extract some statistics from pip-accel's logging output. | |
local log=$1 | |
local label=$2 | |
local num_built=$(grep -c 'pip_accel.bdist.*Building .* binary distribution' $log) | |
msg "Built $num_built packages on $label run." | |
} | |
msg () { | |
# Print a timestamped message to the terminal. | |
echo "$(date '+%Y-%m-%d %H:%M:%S') - $*" >&2 | |
} | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment