96ae22608826e570f22e6d4fff384a2f8adeedd3
[gentoo.git] / dev-python / async_timeout / async_timeout-2.0.1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=( python3_{5,6} )
6
7 inherit distutils-r1
8
9 MY_P=${PN/_/-}-${PV}
10 DESCRIPTION="Timeout context manager for asyncio programs"
11 HOMEPAGE="https://github.com/aio-libs/async-timeout"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz"
13
14 LICENSE="Apache-2.0"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="test"
18 RESTRICT="!test? ( test )"
19 S=${WORKDIR}/${MY_P}
20
21 DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
22         dev-python/setuptools_scm[${PYTHON_USEDEP}]
23         test? (
24                 <dev-python/aiohttp-3.3[${PYTHON_USEDEP}]
25                 dev-python/pytest[${PYTHON_USEDEP}]
26                 <dev-python/pytest-aiohttp-0.3[${PYTHON_USEDEP}]
27         )"
28
29 python_prepare_all() {
30         # remove pointless dep on pytest-cov
31         sed -i -e '/addopts/d' setup.cfg || die
32         # tests fail due to missing fixture when trying to load this file
33         rm tests/conftest.py || die
34         distutils-r1_python_prepare_all
35 }
36
37 python_test() {
38         pytest -vv || die "Tests fail with ${EPYTHON}"
39 }