*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / pysolr / pysolr-3.8.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python2_7 python3_6 )
7
8 inherit distutils-r1
9
10 SOLR_PV=4.10.4
11 DESCRIPTION="Lightweight python wrapper for Apache Solr"
12 HOMEPAGE="https://pypi.org/project/pysolr/ https://github.com/toastdriven/pysolr/"
13 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
14         test? ( https://archive.apache.org/dist/lucene/solr/${SOLR_PV}/solr-${SOLR_PV}.tgz )"
15
16 SLOT="0"
17 LICENSE="BSD"
18 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
19 IUSE="test"
20 RESTRICT="!test? ( test )"
21
22 RDEPEND="
23         dev-python/requests[${PYTHON_USEDEP}]"
24 DEPEND="
25         dev-python/setuptools[${PYTHON_USEDEP}]
26         dev-python/setuptools_scm[${PYTHON_USEDEP}]
27         test? (
28                 ${RDEPEND}
29                 dev-python/kazoo[${PYTHON_USEDEP}]
30                 dev-python/pytest[${PYTHON_USEDEP}]
31                 net-misc/curl
32                 virtual/jre:*
33                 $(python_gen_cond_dep '
34                                 dev-python/faulthandler[${PYTHON_USEDEP}]
35                                 dev-python/mock[${PYTHON_USEDEP}]
36                         ' -2)
37         )"
38
39 src_unpack() {
40         unpack "${P}.tar.gz"
41 }
42
43 src_prepare() {
44         # utf8 breaks py2.7 for us
45         sed -i -e 's/…/.../' run-tests.py || die
46
47         distutils-r1_src_prepare
48 }
49
50 python_configure_all() {
51         if use test; then
52                 mkdir -p "${HOME}/download-cache" || die
53                 cp "${DISTDIR}/solr-${SOLR_PV}.tgz" "${HOME}/download-cache" || die
54         fi
55 }
56
57 python_test() {
58         "${EPYTHON}" run-tests.py -v || die "Tests fail with ${EPYTHON}"
59 }