f36bfdca3b9fb923633ef64e1c292913d4461b24
[gentoo.git] / dev-python / google-auth / google-auth-1.1.0.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="Google Authentication Library"
11 HOMEPAGE="https://pypi.org/project/google-auth/"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
13
14 LICENSE="Apache-2.0"
15 SLOT="0"
16 KEYWORDS="~amd64 ~arm ~arm64 ~x86"
17 IUSE="test"
18 RESTRICT="!test? ( test )"
19
20 RDEPEND="
21         dev-python/namespace-google[${PYTHON_USEDEP}]
22         >=dev-python/pyasn1-0.1.7[${PYTHON_USEDEP}]
23         >=dev-python/pyasn1-modules-0.0.5[${PYTHON_USEDEP}]
24         >=dev-python/rsa-3.1.4[${PYTHON_USEDEP}]
25         >=dev-python/six-1.6.1[${PYTHON_USEDEP}]
26         >=dev-python/cachetools-2.0.0[${PYTHON_USEDEP}]
27         "
28 DEPEND="${RDEPEND}
29         test? (
30                 dev-python/flask[${PYTHON_USEDEP}]
31                 dev-python/mock[${PYTHON_USEDEP}]
32                 dev-python/pytest[${PYTHON_USEDEP}]
33                 dev-python/pytest-localserver[${PYTHON_USEDEP}]
34         )"
35
36 python_prepare_all() {
37         # urllib3-1.16 raised MaxRetryError, not TransportError
38         sed -e 's:test_connection_error:_\0:' \
39                 -e 's:test_request_with_timeout_failure:_\0:' \
40                 -i tests/transport/compliance.py || die
41         distutils-r1_python_prepare_all
42 }
43
44 python_test() {
45         # delete stray files included in the tarball
46         find "${S}"/tests -name '*.pyc' -delete || die
47         py.test || die "Tests failed under ${EPYTHON}"
48 }
49
50 python_install_all() {
51         distutils-r1_python_install_all
52         find "${ED}" -name '*.pth' -delete || die
53 }