*/*: [QA] Fix trivial cases of MissingTestRestrict
[gentoo.git] / dev-python / cairocffi / cairocffi-1.0.2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="7"
5
6 PYTHON_COMPAT=( python3_{5,6,7} )
7
8 inherit distutils-r1 virtualx
9
10 MY_PN="${PN}"
11 MY_P="${MY_PN}-${PV}"
12
13 DESCRIPTION="CFFI-based drop-in replacement for Pycairo"
14 HOMEPAGE="https://github.com/Kozea/cairocffi"
15 SRC_URI="mirror://pypi/${MY_P:0:1}/${MY_PN}/${MY_P}.tar.gz"
16
17 LICENSE="BSD"
18 SLOT="0"
19 KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
20 IUSE="doc test"
21 RESTRICT="!test? ( test )"
22
23 RDEPEND="
24         $(python_gen_cond_dep '>=dev-python/cffi-1.1.0:=[${PYTHON_USEDEP}]' 'python*')
25         >=dev-python/xcffib-0.3.2[${PYTHON_USEDEP}]
26         x11-libs/cairo:0=[xcb]
27         x11-libs/gdk-pixbuf[jpeg]
28         $(python_gen_cond_dep '>=virtual/pypy-2.6.0' pypy )"
29
30 DEPEND="
31         dev-python/setuptools[${PYTHON_USEDEP}]
32         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
33         test? (
34                 ${RDEPEND}
35                 dev-python/pytest[${PYTHON_USEDEP}]
36         )
37         $(python_gen_cond_dep '>=virtual/pypy-2.6.0' pypy )"
38
39 PATCHES=(
40         "${FILESDIR}"/${PN}-0.8.0-tests.patch
41         "${FILESDIR}"/${P}-test-deps.patch
42 )
43
44 S="${WORKDIR}/${MY_P}"
45
46 python_compile_all() {
47         use doc && esetup.py build_sphinx
48 }
49
50 python_test() {
51         virtx py.test -v --pyargs cairocffi || die "testsuite failed under ${EPYTHON}"
52 }
53
54 python_install_all() {
55         use doc && HTML_DOCS=( docs/_build/html/. )
56         distutils-r1_python_install_all
57 }