*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / py-amqp / py-amqp-2.5.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=( python2_7 python3_{6,7} )
6
7 inherit distutils-r1
8
9 MY_PN="amqp"
10 MY_P="${MY_PN}-${PV}"
11
12 DESCRIPTION="Low-level AMQP client for Python (fork of amqplib)"
13 HOMEPAGE="https://github.com/celery/py-amqp https://pypi.org/project/amqp/"
14 SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
15
16 S="${WORKDIR}/${MY_P}"
17
18 LICENSE="BSD"
19 SLOT="0"
20 KEYWORDS="amd64 ~arm64 x86"
21 IUSE="doc extras test"
22 RESTRICT="!test? ( test )"
23
24 RDEPEND=""
25 DEPEND="
26         dev-python/setuptools[${PYTHON_USEDEP}]
27         >=dev-python/vine-1.1.3[${PYTHON_USEDEP}]
28         doc? (
29                 dev-python/sphinx[${PYTHON_USEDEP}]
30                 dev-python/sphinx_celery[${PYTHON_USEDEP}]
31         )
32         test? (
33                 >=dev-python/case-1.3.1[${PYTHON_USEDEP}]
34                 >=dev-python/pytest-3.0[${PYTHON_USEDEP}]
35                 dev-python/pytest-cov[${PYTHON_USEDEP}]
36                 dev-python/pytest-mock[${PYTHON_USEDEP}]
37                 >=dev-python/pytest-rerunfailures-6.0[${PYTHON_USEDEP}]
38         )
39 "
40
41 python_prepare_all() {
42         # pytest-sugar is not packaged
43         sed -e '/pytest-sugar/d' -i requirements/test.txt || die
44
45         # requires a rabbitmq instance
46         rm t/integration/test_rmq.py || die
47
48         distutils-r1_python_prepare_all
49 }
50
51 python_compile_all() {
52         use doc && emake -C docs html
53 }
54
55 python_test() {
56         esetup.py test
57 }
58
59 python_install_all() {
60         use doc && local HTML_DOCS=( docs/_build/html/. )
61         if use extras; then
62                 insinto /usr/share/${PF}/extras
63                 doins -r extra
64         fi
65         distutils-r1_python_install_all
66 }