1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 python3_{5,6,7} pypy )
9 DESCRIPTION="MessagePack (de)serializer for Python"
10 HOMEPAGE="https://msgpack.org
11 https://github.com/msgpack/msgpack-python/
12 https://pypi.org/project/msgpack/"
13 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
17 KEYWORDS="amd64 arm ~arm64 ppc x86"
18 IUSE="+native-extensions test"
21 dev-python/setuptools[${PYTHON_USEDEP}]
23 $(python_gen_cond_dep '>=dev-python/cython-0.16[${PYTHON_USEDEP}]' 'python*')
26 dev-python/six[${PYTHON_USEDEP}]
27 dev-python/pytest[${PYTHON_USEDEP}]
31 python_prepare_all() {
32 # Remove pre-generated cython files
33 rm msgpack/{_packer,_unpacker,_cmsgpack}.pyx || die
35 if ! use native-extensions ; then
36 sed -i -e "/have_cython/s:True:False:" ./setup.py || die
38 distutils-r1_python_prepare_all
42 py.test -v test || die "Tests fail with ${EPYTHON}"