*/*: [QA] Fix trivial cases of MissingTestRestrict
[gentoo.git] / dev-python / billiard / billiard-3.5.0.0.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python2_7 python3_{5,6} pypy pypy3 )
7
8 inherit distutils-r1 flag-o-matic
9
10 DESCRIPTION="Python multiprocessing fork"
11 HOMEPAGE="https://pypi.org/project/billiard/ https://github.com/celery/billiard"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
13
14 LICENSE="BSD"
15 SLOT="0"
16 KEYWORDS="amd64 x86"
17 IUSE="doc test"
18 RESTRICT="!test? ( test )"
19
20 RDEPEND=""
21 DEPEND="
22         dev-python/setuptools[${PYTHON_USEDEP}]
23         test? (
24                 dev-python/case[${PYTHON_USEDEP}]
25                 >=dev-python/unittest2-0.4.0[${PYTHON_USEDEP}]
26                 >=dev-python/nose-1.3.4[${PYTHON_USEDEP}]
27                 dev-python/nose-cover3[${PYTHON_USEDEP}]
28                 $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7 pypy pypy3 )
29         )"
30 # The usual req'd for tests
31 DISTUTILS_IN_SOURCE_BUILD=1
32
33 python_compile() {
34         if !  python_is_python3; then
35                 local CFLAGS=${CFLAGS}
36                 append-cflags -fno-strict-aliasing
37         fi
38         distutils-r1_python_compile
39 }
40
41 python_compile_all() {
42         use doc && esetup.py build_sphinx --builder="html" --source-dir=Doc/
43 }
44
45 python_test() {
46         cd "${BUILD_DIR}" || die
47         # The teardown in __init__.py breaks pypy's installed nose
48         if [[ "${EPYTHON}" == pypy ]]; then
49                 rm lib/billiard/tests/__init__.py || die
50                 echo "from __future__ import absolute_import" >> ./lib/billiard/tests/__init__.py || die
51         fi
52         nosetests billiard.tests || die "Tests fail with ${EPYTHON}"
53 }
54
55 python_install_all() {
56         use doc && local HTML_DOCS=( build/sphinx/html/. )
57         distutils-r1_python_install_all
58 }