1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_{6,7} )
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"
16 KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux"
18 RESTRICT="!test? ( test )"
20 # There are optional json backends serializer/deserializers in addition to those selected here
22 RDEPEND="dev-python/simplejson[${PYTHON_USEDEP}]
23 dev-python/feedparser[${PYTHON_USEDEP}]
24 dev-python/ujson[${PYTHON_USEDEP}]
26 DEPEND="test? ( ${RDEPEND} )
27 doc? ( dev-python/sphinx[${PYTHON_USEDEP}]
28 $(python_gen_cond_dep 'dev-python/sphinxtogithub[${PYTHON_USEDEP}]' python2_7) )"
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
36 python_compile_all() {
37 use doc && { python_setup python2_7 && sphinx-build -b html -c docs/source/ docs/source/ docs/source/html || die; }
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
47 python_install_all() {
48 use doc && local HTML_DOCS=( docs/source/html/. )
49 distutils-r1_python_install_all