1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 python3_{6,7} )
7 inherit distutils-r1 eutils
9 DESCRIPTION="Statistical computations and models for use with SciPy"
10 HOMEPAGE="https://www.statsmodels.org/stable/index.html"
11 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
15 KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
16 IUSE="doc examples test"
17 RESTRICT="!test? ( test )"
20 dev-python/numpy[${PYTHON_USEDEP}]
21 >=dev-python/pandas-0.23.0[${PYTHON_USEDEP}]
22 dev-python/patsy[${PYTHON_USEDEP}]
23 sci-libs/scipy[${PYTHON_USEDEP}]
25 RDEPEND="${COMMON_DEPEND}"
26 DEPEND="${COMMON_DEPEND}
27 dev-python/cython[${PYTHON_USEDEP}]
28 dev-python/setuptools[${PYTHON_USEDEP}]
30 dev-python/ipykernel[${PYTHON_USEDEP}]
31 dev-python/jupyter_client[${PYTHON_USEDEP}]
32 dev-python/matplotlib[${PYTHON_USEDEP}]
33 dev-python/nbconvert[${PYTHON_USEDEP}]
34 dev-python/nbformat[${PYTHON_USEDEP}]
35 dev-python/numpydoc[${PYTHON_USEDEP}]
36 dev-python/sphinx[${PYTHON_USEDEP}]
39 dev-python/pytest[${PYTHON_USEDEP}]
40 dev-python/nose[${PYTHON_USEDEP}]
44 python_prepare_all() {
45 # Prevent un-needed d'loading
46 sed -e "/sphinx.ext.intersphinx/d" -i docs/source/conf.py || die
47 export VARTEXFONTS="${T}"/fonts
48 export MPLCONFIGDIR="${T}"
49 echo "backend : Agg" > "${MPLCONFIGDIR}"/matplotlibrc || die
51 # Errors reported upstream: https://github.com/statsmodels/statsmodels/issues/4850
52 rm statsmodels/tsa/tests/test_tsa_indexes.py || die
54 "/def test_start_params_bug():/i@pytest.mark.xfail(reason='Known to fail on Gentoo')" \
55 statsmodels/tsa/tests/test_arima.py || die
57 "s/def test_pandas_endog():/def _test_pandas_endog():/g" \
58 statsmodels/tsa/statespace/tests/test_mlemodel.py || die
60 "/def test_all_datasets():/i@pytest.mark.xfail(reason='Known to fail on Gentoo')" \
61 statsmodels/datasets/tests/test_data.py || die
63 "/def test_issue_339():/i@pytest.mark.xfail(reason='Known to fail on Gentoo')" \
64 statsmodels/discrete/tests/test_discrete.py || die
66 -e "s/def test_hdr_multiple_alpha():/def _test_hdr_multiple_alpha():/g" \
67 statsmodels/graphics/tests/test_functional.py || die
69 -e '1s/^/import pytest \n/' \
70 -e "/def test_single_factor_repeated_measures_anova():/i@pytest.mark.xfail(reason='Known to fail on Gentoo with Python 3')" \
71 -e "/def test_two_factors_repeated_measures_anova():/i@pytest.mark.xfail(reason='Known to fail on Gentoo with Python 3')" \
72 -e "/def test_three_factors_repeated_measures_anova():/i@pytest.mark.xfail(reason='Known to fail on Gentoo with Python 3')" \
73 -e "/def test_repeated_measures_aggregate_compare_with_ezANOVA():/i@pytest.mark.xfail(reason='Known to fail on Gentoo with Python 3')" \
74 statsmodels/stats/tests/test_anova_rm.py || die
76 distutils-r1_python_prepare_all
79 python_compile_all() {
80 use doc && esetup.py build_sphinx -b html --build-dir=docs/build
84 cd "${BUILD_DIR}" || die
88 python_install_all() {
89 find . -name \*LICENSE.txt -delete || die
90 use doc && HTML_DOCS=( docs/build/html/. )
92 docompress -x /usr/share/doc/${PF}/examples
95 distutils-r1_python_install_all
99 optfeature "Plotting functionality" "dev-python/matplotlib"