Skip to content

Commit edbd512

Browse files
committed
Merge pull request #4981 from cpcloud/statsmodels-ci-addition
CI/ENH: test against an older version of statsmodels
2 parents fac7d1d + cd45ff6 commit edbd512

File tree

8 files changed

+48
-20
lines changed

8 files changed

+48
-20
lines changed

ci/install.sh

-13
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,6 @@ if [ x"$FULL_DEPS" == x"true" ]; then
6262
echo "Installing FULL_DEPS"
6363
# for pytables gets the lib as well
6464
time sudo apt-get $APT_ARGS install libhdf5-serial-dev
65-
66-
# fool statsmodels into thinking pandas was already installed
67-
# so it won't refuse to install itself.
68-
69-
SITE_PKG_DIR=$VIRTUAL_ENV/lib/python$TRAVIS_PYTHON_VERSION/site-packages
70-
echo "Using SITE_PKG_DIR: $SITE_PKG_DIR"
71-
72-
mkdir $SITE_PKG_DIR/pandas
73-
touch $SITE_PKG_DIR/pandas/__init__.py
74-
echo "version='0.10.0-phony'" > $SITE_PKG_DIR/pandas/version.py
75-
time pip install $PIP_ARGS git+git://github.com/statsmodels/statsmodels@c9062e43b8a5f7385537ca95#egg=statsmodels
76-
77-
rm -Rf $SITE_PKG_DIR/pandas # scrub phoney pandas
7865
fi
7966

8067
# build pandas

ci/requirements-2.7.txt

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ scikits.timeseries==0.91.3
1717
MySQL-python==1.2.4
1818
scipy==0.10.0
1919
beautifulsoup4==4.2.1
20+
statsmodels==0.5.0

ci/requirements-2.7_LOCALE.txt

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ html5lib==1.0b2
1515
lxml==3.2.1
1616
scipy==0.10.0
1717
beautifulsoup4==4.2.1
18+
statsmodels==0.5.0

ci/requirements-3.2.txt

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ patsy==0.1.0
1212
lxml==3.2.1
1313
scipy==0.12.0
1414
beautifulsoup4==4.2.1
15+
statsmodels==0.4.3

ci/requirements-3.3.txt

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ patsy==0.1.0
1313
lxml==3.2.1
1414
scipy==0.12.0
1515
beautifulsoup4==4.2.1
16+
statsmodels==0.4.3

ci/speedpack/build.sh

+37-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,42 @@ apt-get build-dep python-lxml -y
2626
export PYTHONIOENCODING='utf-8'
2727
export VIRTUALENV_DISTRIBUTE=0
2828

29+
30+
function create_fake_pandas() {
31+
local site_pkg_dir="$1"
32+
rm -rf $site_pkg_dir/pandas
33+
mkdir $site_pkg_dir/pandas
34+
touch $site_pkg_dir/pandas/__init__.py
35+
echo "version = '0.10.0-phony'" > $site_pkg_dir/pandas/version.py
36+
}
37+
38+
39+
function get_site_pkgs_dir() {
40+
python$1 -c 'import distutils; print(distutils.sysconfig.get_python_lib())'
41+
}
42+
43+
44+
function create_wheel() {
45+
local pip_args="$1"
46+
local wheelhouse="$2"
47+
local n="$3"
48+
local pyver="$4"
49+
50+
local site_pkgs_dir="$(get_site_pkgs_dir $pyver)"
51+
52+
53+
if [[ "$n" == *statsmodels* ]]; then
54+
create_fake_pandas $site_pkgs_dir && \
55+
pip wheel $pip_args --wheel-dir=$wheelhouse $n && \
56+
pip install $pip_args --no-index $n && \
57+
rm -Rf $site_pkgs_dir
58+
else
59+
pip wheel $pip_args --wheel-dir=$wheelhouse $n
60+
pip install $pip_args --no-index $n
61+
fi
62+
}
63+
64+
2965
function generate_wheels() {
3066
# get the requirements file
3167
local reqfile="$1"
@@ -62,8 +98,7 @@ function generate_wheels() {
6298

6399
# install and build the wheels
64100
cat $reqfile | while read N; do
65-
pip wheel $PIP_ARGS --wheel-dir=$WHEELHOUSE $N
66-
pip install $PIP_ARGS --no-index $N
101+
create_wheel "$PIP_ARGS" "$WHEELHOUSE" "$N" "$PY_VER"
67102
done
68103
}
69104

doc/source/release.rst

+2
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ Improvements to existing features
128128
- ``read_stata`` now accepts Stata 13 format (:issue:`4291`)
129129
- ``ExcelWriter`` and ``ExcelFile`` can be used as contextmanagers.
130130
(:issue:`3441`, :issue:`4933`)
131+
- ``pandas`` is now tested with two different versions of ``statsmodels``
132+
(0.4.3 and 0.5.0) (:issue:`4981`).
131133

132134
API Changes
133135
~~~~~~~~~~~

pandas/stats/tests/test_ols.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from __future__ import division
88

9+
from distutils.version import LooseVersion
910
from datetime import datetime
1011
from pandas import compat
1112
import unittest
@@ -98,11 +99,10 @@ def testOLSWithDatasets_scotland(self):
9899

99100
def testWLS(self):
100101
# WLS centered SS changed (fixed) in 0.5.0
101-
v = sm.version.version.split('.')
102-
if int(v[0]) >= 0 and int(v[1]) <= 5:
103-
if int(v[2]) < 1:
104-
raise nose.SkipTest
105-
print( "Make sure you're using statsmodels 0.5.0.dev-cec4f26 or later.")
102+
sm_version = sm.version.version
103+
if sm_version < LooseVersion('0.5.0'):
104+
raise nose.SkipTest("WLS centered SS not fixed in statsmodels"
105+
" version {0}".format(sm_version))
106106

107107
X = DataFrame(np.random.randn(30, 4), columns=['A', 'B', 'C', 'D'])
108108
Y = Series(np.random.randn(30))

0 commit comments

Comments
 (0)