*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / geventhttpclient / geventhttpclient-1.3.1-r1.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=( python{2_7,3_{6,7}} )
6
7 inherit distutils-r1
8
9 DESCRIPTION="A high performance, concurrent HTTP client library for Python using gevent"
10 HOMEPAGE="https://github.com/gwik/geventhttpclient"
11 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
12
13 LICENSE="MIT"
14 SLOT="0"
15 KEYWORDS="amd64 arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
16 IUSE="test"
17 RESTRICT="!test? ( test )"
18
19 RDEPEND="
20         dev-python/certifi[${PYTHON_USEDEP}]
21         dev-python/gevent[${PYTHON_USEDEP}]
22         dev-python/six[${PYTHON_USEDEP}]
23 "
24 DEPEND="
25         dev-python/setuptools[${PYTHON_USEDEP}]
26         test? (
27                 ${RDEPEND}
28                 dev-python/pytest[${PYTHON_USEDEP}]
29         )
30 "
31
32 python_prepare_all() {
33         # https://github.com/gwik/geventhttpclient/pull/82
34         rm -r src/geventhttpclient/tests/__pycache__ || die
35         distutils-r1_python_prepare_all
36 }
37
38 python_test() {
39         # Ignore tests which require network access
40         # Append to sys.path to avoid ImportError
41         # https://bugs.gentoo.org/667758
42         # Skip a test that fails with Python > 3.7
43         # https://github.com/gwik/geventhttpclient/issues/119
44         pytest --import-mode=append -vv src/geventhttpclient/tests --ignore \
45                 src/geventhttpclient/tests/test_client.py --deselect \
46                 src/geventhttpclient/tests/test_headers.py::test_cookielib_compatibility \
47                 || die "Tests failed with ${EPYTHON}"
48 }