summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2021-08-14 09:27:04 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2021-08-20 15:45:43 +0300
commit326202b90b8e90f0d1a962ddfa7c2ca888ebadc2 (patch)
treefd88d7c59e1f55878026c307b660fa4587f91418 /dev-python/jsonpickle
parentapp-backup/bareos: cleanup 17.2 (EOL) (diff)
downloadgentoo-326202b90b8e90f0d1a962ddfa7c2ca888ebadc2.tar.gz
gentoo-326202b90b8e90f0d1a962ddfa7c2ca888ebadc2.tar.bz2
gentoo-326202b90b8e90f0d1a962ddfa7c2ca888ebadc2.zip
dev-python/jsonpickle: enable py3.10, cleanup dependencies
- make most dependencies as optional or test dependencies - enable more tests - for py3.10, disable feedparser tests as this package has problem with py 3.10 Closes: https://bugs.gentoo.org/732132 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'dev-python/jsonpickle')
-rw-r--r--dev-python/jsonpickle/jsonpickle-2.0.0.ebuild54
1 files changed, 33 insertions, 21 deletions
diff --git a/dev-python/jsonpickle/jsonpickle-2.0.0.ebuild b/dev-python/jsonpickle/jsonpickle-2.0.0.ebuild
index 629cee7b6893..332a82e8d961 100644
--- a/dev-python/jsonpickle/jsonpickle-2.0.0.ebuild
+++ b/dev-python/jsonpickle/jsonpickle-2.0.0.ebuild
@@ -3,9 +3,8 @@
EAPI=7
-PYTHON_COMPAT=( python3_{7..9} )
-DISTUTILS_USE_SETUPTOOLS=bdepend
-inherit distutils-r1
+PYTHON_COMPAT=( python3_{8..10} )
+inherit distutils-r1 optfeature
DESCRIPTION="Python library for serializing any arbitrary object graph into JSON"
HOMEPAGE="https://github.com/jsonpickle/jsonpickle/ https://pypi.org/project/jsonpickle/"
@@ -15,35 +14,48 @@ LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 x86 ~amd64-linux ~x86-linux"
-# There are optional json backends serializer/deserializers in addition to those selected here
-# jsonlib, yajl.
-RDEPEND="
- dev-python/feedparser[${PYTHON_USEDEP}]
- dev-python/simplejson[${PYTHON_USEDEP}]
- dev-python/ujson[${PYTHON_USEDEP}]
- $(python_gen_cond_dep '
- dev-python/importlib_metadata[${PYTHON_USEDEP}]
- ' python3_7)
-"
# toml via setuptools_scm[toml]
BDEPEND="
dev-python/setuptools_scm[${PYTHON_USEDEP}]
- dev-python/toml[${PYTHON_USEDEP}]"
+ dev-python/toml[${PYTHON_USEDEP}]
+ test? (
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/pandas[${PYTHON_USEDEP}]
+ dev-python/simplejson[${PYTHON_USEDEP}]
+ dev-python/sqlalchemy[${PYTHON_USEDEP}]
+ dev-python/ujson[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep '
+ dev-python/feedparser[${PYTHON_USEDEP}]
+ ' python3_{8,9})
+ )"
distutils_enable_sphinx "docs/source"
distutils_enable_tests pytest
python_prepare_all() {
- # too many dependencies
- rm tests/pandas_test.py || die
- # broken with gmpy
- rm tests/ecdsa_test.py || die
-
sed -i -e 's:--flake8 --black --cov::' pytest.ini || die
-
distutils-r1_python_prepare_all
}
python_test() {
- pytest -vv tests || die "Tests failed with ${EPYTHON}"
+ local EPYTEST_IGNORE=(
+ # unpackaged bson dependency
+ tests/bson_test.py
+ # broken when gmpy is installed
+ # https://github.com/jsonpickle/jsonpickle/issues/328
+ # https://github.com/jsonpickle/jsonpickle/issues/316
+ tests/ecdsa_test.py
+ )
+ # There is a problem with packaging feedparser with python 3.10, so skip
+ [[ ${EPYTHON} == python3_10 ]] && EPYTEST_IGNORE+=(
+ tests/feedparser_test.py
+ )
+ epytest
+}
+
+pkg_postinst() {
+ # Unpackaged optional backends: yajl, demjson
+ optfeature "encoding numpy-based data" dev-python/numpy
+ optfeature "encoding pandas objects" dev-python/pandas
+ optfeature "fast JSON backend" dev-python/simplejson
}