*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / oauth2client / oauth2client-4.1.2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python2_7 python3_6 )
6
7 inherit distutils-r1
8
9 DESCRIPTION="Library for accessing resources protected by OAuth 2.0"
10 HOMEPAGE="https://github.com/google/oauth2client"
11 SRC_URI="https://github.com/google/oauth2client/archive/v${PV/_p/-post}.tar.gz -> ${P}.tar.gz"
12
13 LICENSE="Apache-2.0"
14 SLOT="0"
15 KEYWORDS="amd64 ~arm ~arm64 x86 ~amd64-linux ~x86-linux"
16 IUSE="test"
17 RESTRICT="!test? ( test )"
18 REQUIRED_USE="|| ( $(python_gen_useflags 'python*') )"
19
20 RDEPEND="
21         >=dev-python/httplib2-0.9.1[${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         $(python_gen_cond_dep 'dev-python/keyring[${PYTHON_USEDEP}]' 'python*')
27         !<=dev-python/google-api-python-client-1.1[${PYTHON_USEDEP}]
28 "
29 DEPEND="${RDEPEND}
30         dev-python/setuptools[${PYTHON_USEDEP}]
31         test? ( dev-python/nose[${PYTHON_USEDEP}] )
32 "
33
34 S="${WORKDIR}"/${P/_p/-post}
35
36 python_prepare() {
37         # keyring is not fuly supported by pypy yet, because dbus-python can't support pypy
38         # oauth2client -> keyring -> secretstorage -> dbus-python
39         # https://github.com/mitya57/secretstorage/issues/10
40         case $PYTHON in
41                 pypy|*pypy|*pypy3|pypy3) \
42                         find "${BUILD_DIR}/.." -name '*keyring*py' -delete ;;
43         esac
44 }
45
46 python_test() {
47         nosetests -e appengine -e django_util -e test_multiprocess_file_storage -e test_bad_positional || die
48         # appengine - requires appengine
49         # django_util - requires django
50         # test_multiprocess_file_storage - requires fasteners
51         # test_bad_positional - expects TypeError, gets ValueError
52 }