Skip to content

Commit 228e6f6

Browse files
committed
Merge pull request #6285 from jreback/cython_cache
BLD: re cythonize files only if we have changed then
2 parents 352db84 + c622b6e commit 228e6f6

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

ci/prep_ccache.sh

+12-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if [ "$IRON_TOKEN" ]; then
66
pip install -I --allow-external --allow-insecure git+https://github.com/iron-io/iron_cache_python.git@8a451c7d7e4d16e0c3bedffd0f280d5d9bd4fe59#egg=iron_cache
77

88

9+
curdir=$(pwd)
910
python ci/ironcache/get.py
1011
ccache -C
1112

@@ -22,14 +23,23 @@ if [ "$IRON_TOKEN" ]; then
2223
fi
2324

2425
# did the last commit change cython files?
25-
git diff HEAD~5 | grep diff | grep -P "pyx|pxd"
26+
cd $curdir
2627

27-
if [ "$?" != "0" ]; then
28+
echo "diff from HEAD~5"
29+
git diff HEAD~5 --numstat
30+
31+
retval=$(git diff HEAD~5 --numstat | grep -P "pyx|pxd"|wc -l)
32+
echo "number of cython files changed: $retval"
33+
34+
if [ $retval -eq 0 ]
35+
then
2836
# nope, reuse cython files
2937
echo "Will reuse cached cython file"
3038
touch "$TRAVIS_BUILD_DIR"/pandas/*.c
3139
touch "$TRAVIS_BUILD_DIR"/pandas/src/*.c
3240
touch "$TRAVIS_BUILD_DIR"/pandas/*.cpp
41+
else
42+
echo "Rebuilding cythonized files"
3343
fi
3444
fi
3545

0 commit comments

Comments
 (0)