*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / kombu / kombu-4.2.1.ebuild
1 # Copyright 1999-2020 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_6 )
7
8 inherit distutils-r1
9
10 DESCRIPTION="AMQP Messaging Framework for Python"
11 HOMEPAGE="https://pypi.org/project/kombu/ https://github.com/celery/kombu"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
13
14 LICENSE="BSD"
15 SLOT="0"
16 KEYWORDS="amd64 ~arm64 x86"
17 IUSE="doc examples mongodb msgpack redis sqs test yaml"
18 RESTRICT="!test? ( test )"
19
20 # couchdb backend support possible via dev-python/couchdb-python
21 # ditto dev-python/kazoo(>=1.3.1)
22 RDEPEND="
23         >=dev-python/py-amqp-2.1.4[${PYTHON_USEDEP}]
24         <dev-python/py-amqp-3.0[${PYTHON_USEDEP}]
25         dev-python/pyro:4[${PYTHON_USEDEP}]
26         sqs? ( >=dev-python/boto3-1.4.4[${PYTHON_USEDEP}] )
27         msgpack? ( >=dev-python/msgpack-0.3.0[${PYTHON_USEDEP}] )
28         mongodb? ( >=dev-python/pymongo-3.0.2[${PYTHON_USEDEP}] )
29         redis? ( >=dev-python/redis-py-2.10.5[${PYTHON_USEDEP}] )
30         yaml? ( >=dev-python/pyyaml-3.10[${PYTHON_USEDEP}] )"
31 # Fix to https://github.com/celery/kombu/issues/474 obliges dev-python/pymongo to >=-3.0.2
32 DEPEND="${RDEPEND}
33         >=dev-python/setuptools-20.6.7[${PYTHON_USEDEP}]
34         test? (
35                 >=dev-python/case-1.5.2[${PYTHON_USEDEP}]
36                 dev-python/pytest[${PYTHON_USEDEP}]
37                 dev-python/pytz[${PYTHON_USEDEP}]
38                 dev-python/unittest2[${PYTHON_USEDEP}] )
39         doc? (
40                 dev-python/sphinx[${PYTHON_USEDEP}]
41                 dev-python/couchdb-python[${PYTHON_USEDEP}]
42                 >=dev-python/sphinx_celery-1.1[${PYTHON_USEDEP}] )"
43
44 # kazoo is optional for tests.
45 # Refrain for now, no established demand for it from users
46
47 # Req'd for test phase
48 DISTUTILS_IN_SOURCE_BUILD=1
49
50 PATCHES=(
51 )
52
53 python_prepare_all() {
54         # AttributeError: test_Etcd instance has no attribute 'patch'
55         rm t/unit/transport/test_etcd.py || die
56         # allow use of new (renamed) msgpack
57         sed -i '/msgpack/d' requirements/extras/msgpack.txt || die
58         distutils-r1_python_prepare_all
59 }
60
61 python_compile_all() {
62         # Doc build misses and skips only content re librabbitmq which is not in portage
63         if use doc; then
64                 emake -C docs html
65         fi
66 }
67
68 python_test() {
69         esetup.py test
70 }
71
72 python_install_all() {
73         if use examples; then
74                 docompress -x "/usr/share/doc/${PF}/examples"
75                 docinto examples
76                 dodoc -r examples/.
77         fi
78         use doc && local HTML_DOCS=( docs/_build/html/. )
79         distutils-r1_python_install_all
80 }