Skip to content

Commit a134759

Browse files
ajamianjreback
authored andcommitted
BUG: Fix for cython version checking #9827; adding appropriate travis
builds to test.
1 parent 1f9b699 commit a134759

6 files changed

+70
-6
lines changed

.travis.yml

+36
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,24 @@ matrix:
3030
- JOB_TAG=_LOCALE
3131
- BUILD_TYPE=conda
3232
- JOB_NAME: "27_slow_nnet_LOCALE"
33+
- python: 2.7
34+
env:
35+
- NOSE_ARGS="not slow and not disabled"
36+
- FULL_DEPS=true
37+
- CLIPBOARD_GUI=gtk2
38+
- BUILD_TYPE=conda
39+
- JOB_NAME: "27_build_test"
40+
- JOB_TAG=_BUILD_TEST
41+
- BUILD_TEST=true
42+
- python: 2.7
43+
env:
44+
- NOSE_ARGS="not slow and not disabled"
45+
- FULL_DEPS=true
46+
- CLIPBOARD_GUI=gtk2
47+
- BUILD_TYPE=pydata
48+
- JOB_NAME: "27_build_test"
49+
- JOB_TAG=_BUILD_TEST
50+
- BUILD_TEST=true
3351
- python: 2.7
3452
env:
3553
- NOSE_ARGS="not slow and not disabled"
@@ -115,6 +133,24 @@ matrix:
115133
- NUMPY_BUILD=master
116134
- BUILD_TYPE=pydata
117135
- PANDAS_TESTING_MODE="deprecate"
136+
- python: 2.7
137+
env:
138+
- NOSE_ARGS="not slow and not disabled"
139+
- FULL_DEPS=true
140+
- CLIPBOARD_GUI=gtk2
141+
- BUILD_TYPE=conda
142+
- JOB_NAME: "27_build_test"
143+
- JOB_TAG=_BUILD_TEST
144+
- BUILD_TEST=true
145+
- python: 2.7
146+
env:
147+
- NOSE_ARGS="not slow and not disabled"
148+
- FULL_DEPS=true
149+
- CLIPBOARD_GUI=gtk2
150+
- BUILD_TYPE=pydata
151+
- JOB_NAME: "27_build_test"
152+
- JOB_TAG=_BUILD_TEST
153+
- BUILD_TEST=true
118154

119155
before_install:
120156
- echo "before_install"

ci/install_conda.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,13 @@ if [ "$IRON_TOKEN" ]; then
9696
export CC='ccache gcc'
9797
fi
9898

99-
python setup.py build_ext --inplace && python setup.py develop
99+
if [ "$BUILD_TEST" ]; then
100+
pip uninstall --yes cython
101+
pip install cython==0.15.1
102+
( python setup.py build_ext --inplace && python setup.py develop ) || true
103+
else
104+
python setup.py build_ext --inplace && python setup.py develop
105+
fi
100106

101107
for package in beautifulsoup4; do
102108
pip uninstall --yes $package

ci/install_pydata.sh

+9-2
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,15 @@ if [ "$IRON_TOKEN" ]; then
137137
fi
138138

139139
# build pandas
140-
python setup.py build_ext --inplace
141-
python setup.py develop
140+
if [ "$BUILD_TEST" ]; then
141+
pip uninstall --yes cython
142+
pip install cython==0.15.1
143+
( python setup.py build_ext --inplace ) || true
144+
( python setup.py develop ) || true
145+
else
146+
python setup.py build_ext --inplace
147+
python setup.py develop
148+
fi
142149

143150
# restore cython (if not numpy building)
144151
if [ -z "$NUMPY_BUILD" ]; then

ci/requirements-2.7_BUILD_TEST.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dateutil
2+
pytz
3+
numpy
4+
cython
5+
nose

ci/script.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ fi
1919
pip install -U blosc # See https://github.com/pydata/pandas/pull/9783
2020
python -c 'import blosc; blosc.print_versions()'
2121

22-
echo nosetests --exe -A "$NOSE_ARGS" pandas --with-xunit --xunit-file=/tmp/nosetests.xml
23-
nosetests --exe -A "$NOSE_ARGS" pandas --with-xunit --xunit-file=/tmp/nosetests.xml
22+
if [ "$BUILD_TEST" ]; then
23+
echo "We are not running nosetests as this is simply a build test."
24+
else
25+
echo nosetests --exe -A "$NOSE_ARGS" pandas --with-xunit --xunit-file=/tmp/nosetests.xml
26+
nosetests --exe -A "$NOSE_ARGS" pandas --with-xunit --xunit-file=/tmp/nosetests.xml
27+
fi
2428

2529
RET="$?"
2630

setup.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@
1111
import shutil
1212
import warnings
1313
import re
14+
from distutils.version import LooseVersion
1415

1516
# may need to work around setuptools bug by providing a fake Pyrex
17+
min_cython_ver = '0.19.1'
1618
try:
1719
import Cython
1820
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "fake_pyrex"))
21+
ver = Cython.__version__
22+
_CYTHON_INSTALLED = ver >= LooseVersion(min_cython_ver)
1923
except ImportError:
20-
pass
24+
_CYTHON_INSTALLED = False
2125

2226
# try bootstrapping setuptools if it doesn't exist
2327
try:
@@ -74,6 +78,8 @@
7478
from distutils.command.build_ext import build_ext as _build_ext
7579

7680
try:
81+
if not _CYTHON_INSTALLED:
82+
raise ImportError('No supported version of Cython installed.')
7783
from Cython.Distutils import build_ext as _build_ext
7884
# from Cython.Distutils import Extension # to get pyrex debugging symbols
7985
cython = True

0 commit comments

Comments
 (0)