Skip to content

Commit 9f4a600

Browse files
committed
BLD: add optional numpy_dev build
1 parent 6bc7925 commit 9f4a600

File tree

3 files changed

+49
-13
lines changed

3 files changed

+49
-13
lines changed

.travis.yml

+19-6
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,53 @@ env:
1111
- secure: "PCzUFR8CHmw9lH84p4ygnojdF7Z8U5h7YfY0RyT+5K/aiQ1ZTU3ZkDTPI0/rR5FVMxsEEKEQKMcc5fvqW0PeD7Q2wRmluloKgT9w4EVEJ1ppKf7lITPcvZR2QgVOvjv4AfDtibLHFNiaSjzoqyJVjM4igjOu8WTlF3JfZcmOQjQ="
1212

1313
matrix:
14+
fast_finish: true
1415
include:
1516
- python: 2.6
1617
env:
1718
- NOSE_ARGS="not slow and not network and not disabled"
1819
- CLIPBOARD=xclip
1920
- LOCALE_OVERRIDE="it_IT.UTF-8"
20-
- JOB_NAME: "26_nslow_nnet" # ScatterCI Build name, 20 chars max
21+
- JOB_NAME: "26_nslow_nnet"
2122
- python: 2.7
2223
env:
2324
- NOSE_ARGS="slow and not network and not disabled"
2425
- LOCALE_OVERRIDE="zh_CN.GB18030"
2526
- FULL_DEPS=true
2627
- JOB_TAG=_LOCALE
27-
- JOB_NAME: "27_slow_nnet_LOCALE" # ScatterCI Build name, 20 chars max
28+
- JOB_NAME: "27_slow_nnet_LOCALE"
2829
- python: 2.7
2930
env:
3031
- NOSE_ARGS="not slow and not disabled"
3132
- FULL_DEPS=true
3233
- CLIPBOARD_GUI=gtk2
33-
- JOB_NAME: "27_nslow" # ScatterCI Build name, 20 chars max
34+
- JOB_NAME: "27_nslow"
3435
- DOC_BUILD=true # if rst files were changed, build docs in parallel with tests
3536
- python: 3.2
3637
env:
3738
- NOSE_ARGS="not slow and not disabled"
3839
- FULL_DEPS=true
3940
- CLIPBOARD_GUI=qt4
40-
- JOB_NAME: "32_nslow" # ScatterCI Build name, 20 chars max
41+
- JOB_NAME: "32_nslow"
4142
- python: 3.3
4243
env:
4344
- NOSE_ARGS="not slow and not disabled"
4445
- FULL_DEPS=true
4546
- CLIPBOARD=xsel
46-
- JOB_NAME: "33_nslow" # ScatterCI Build name, 20 chars max
47-
47+
- JOB_NAME: "33_nslow"
48+
- python: 2.7
49+
env:
50+
- NOSE_ARGS="not slow and not disabled"
51+
- JOB_NAME: "27_numpy_dev"
52+
- JOB_TAG=_NUMPY_DEV
53+
- NUMPY_BUILD=true # build numpy master from source
54+
allow_failures:
55+
- python: 2.7
56+
env:
57+
- NOSE_ARGS="not slow and not disabled"
58+
- JOB_NAME: "27_numpy_dev"
59+
- JOB_TAG=_NUMPY_DEV
60+
- NUMPY_BUILD=true # build numpy master from source
4861

4962
# allow importing from site-packages,
5063
# so apt-get python-x works for system pythons

ci/install.sh

+27-7
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,36 @@ base_url=http://cache27diy-cpycloud.rhcloud.com
3939
wheel_box=${TRAVIS_PYTHON_VERSION}${JOB_TAG}
4040
PIP_ARGS+=" -I --use-wheel --find-links=$base_url/$wheel_box/ --allow-external --allow-insecure"
4141

42-
# Force virtualenv to accept system_site_packages
43-
rm -f $VIRTUAL_ENV/lib/python$TRAVIS_PYTHON_VERSION/no-global-site-packages.txt
44-
45-
4642
if [ -n "$LOCALE_OVERRIDE" ]; then
4743
# make sure the locale is available
4844
# probably useless, since you would need to relogin
4945
time sudo locale-gen "$LOCALE_OVERRIDE"
5046
fi
5147

52-
5348
# we need these for numpy
5449
time sudo apt-get $APT_ARGS install libatlas-base-dev gfortran
5550

51+
if [ -n "$NUMPY_BUILD" ]; then
52+
# building numpy
53+
curdir=$(pwd)
54+
echo "building numpy: $curdir"
55+
56+
# remove the system installed numpy
57+
pip uninstall numpy -y
58+
59+
# clone & install
60+
git clone --branch master https://github.com/numpy/numpy.git numpy
61+
cd numpy
62+
time sudo python setup.py install
63+
64+
cd $curdir
65+
numpy_version=$(python -c 'import numpy; print(numpy.__version__)')
66+
echo "numpy: $numpy_version"
67+
else
68+
# Force virtualenv to accept system_site_packages
69+
rm -f $VIRTUAL_ENV/lib/python$TRAVIS_PYTHON_VERSION/no-global-site-packages.txt
70+
fi
71+
5672
time pip install $PIP_ARGS -r ci/requirements-${wheel_box}.txt
5773

5874

@@ -98,6 +114,10 @@ export PATH=/usr/lib/ccache:/usr/lib64/ccache:$PATH
98114
which gcc
99115
ccache -z
100116
time pip install $(find dist | grep gz | head -n 1)
101-
# restore cython
102-
time pip install $PIP_ARGS $(cat ci/requirements-${wheel_box}.txt | grep -i cython)
117+
118+
# restore cython (if not numpy building)
119+
if [ -z "$NUMPY_BUILD" ]; then
120+
time pip install $PIP_ARGS $(cat ci/requirements-${wheel_box}.txt | grep -i cython)
121+
fi
122+
103123
true

ci/requirements-2.7_NUMPY_DEV.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
python-dateutil
2+
pytz==2013b
3+
cython==0.19.1

0 commit comments

Comments
 (0)