*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / jsonpickle / jsonpickle-1.2.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} )
7
8 inherit distutils-r1
9
10 DESCRIPTION="Python library for serializing any arbitrary object graph into JSON"
11 HOMEPAGE="https://github.com/jsonpickle/jsonpickle/ https://pypi.org/project/jsonpickle/"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
13
14 LICENSE="BSD"
15 SLOT="0"
16 KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux"
17 IUSE="doc test"
18 RESTRICT="!test? ( test )"
19
20 # There are optional json backends serializer/deserializers in addition to those selected here
21 # jsonlib, yajl.
22 RDEPEND="dev-python/simplejson[${PYTHON_USEDEP}]
23                 dev-python/feedparser[${PYTHON_USEDEP}]
24                 dev-python/ujson[${PYTHON_USEDEP}]
25                 "
26 DEPEND="test? ( ${RDEPEND} )
27         doc? ( dev-python/sphinx[${PYTHON_USEDEP}]
28                 $(python_gen_cond_dep 'dev-python/sphinxtogithub[${PYTHON_USEDEP}]' python2_7) )"
29
30 python_prepare_all() {
31         # Prevent un-needed d'loading during doc build
32         sed -e "s/, 'sphinx.ext.intersphinx'//" -i docs/source/conf.py || die
33         distutils-r1_python_prepare_all
34 }
35
36 python_compile_all() {
37         use doc && { python_setup python2_7 && sphinx-build -b html -c docs/source/ docs/source/ docs/source/html || die; }
38 }
39
40 python_test() {
41         # An apparent regression in tests
42         # https://github.com/jsonpickle/jsonpickle/issues/124
43         einfo "testsuite has optional tests for package demjson"
44         ${PYTHON} tests/runtests.py || die
45 }
46
47 python_install_all() {
48         use doc && local HTML_DOCS=( docs/source/html/. )
49         distutils-r1_python_install_all
50 }