78b48b218d8dc00f1f1a699ee51a875af27c5ac9
[gentoo.git] / dev-python / cytoolz / cytoolz-0.8.2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python{2_7,3_6} )
6
7 inherit distutils-r1
8
9 DESCRIPTION="Cython implementation of Toolz: High performance functional utilities"
10 HOMEPAGE="https://pypi.org/project/cytoolz/"
11 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
12
13 LICENSE="BSD"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
16 IUSE="test"
17 RESTRICT="!test? ( test )"
18
19 # Informed by author the dep in toolz is not only required but the
20 # tests are version sensitive.
21 # https://github.com/pytoolz/cytoolz/issues/57
22 RDEPEND="
23         dev-python/cython[${PYTHON_USEDEP}]"
24 DEPEND="${RDEPEND}
25         test? ( dev-python/nose[${PYTHON_USEDEP}]
26                 >=dev-python/toolz-0.8[${PYTHON_USEDEP}] )"
27
28 python_compile() {
29         python_is_python3 || local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
30
31         distutils-r1_python_compile
32 }
33
34 python_test() {
35         pushd "${BUILD_DIR}"/lib/ > /dev/null || die
36         PYTHONPATH=.:${PN} nosetests --with-doctest ${PN} || die "tests failed under ${EPYTHON}"
37         popd > /dev/null || die
38 }