summaryrefslogtreecommitdiff
blob: 688af2d10b4fb50b2ec183d714829b3ffecec6cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/ujson/ujson-1.33.ebuild,v 1.2 2013/09/15 17:23:15 maekke Exp $

EAPI="5"

# One test; FAIL: test_encodeToUTF8 (__main__.UltraJSONTests) under py2.5.
# Fix and repair and re-insert if it's REALLY needed
PYTHON_COMPAT=( python{2_6,2_7,3_2} )

inherit distutils-r1

DESCRIPTION="Ultra fast JSON encoder and decoder for Python"
HOMEPAGE="http://pypi.python.org/pypi/ujson/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.zip"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""

DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
	app-arch/unzip"
RDEPEND="${DEPEND}"

python_test() {
	# See setup.py; line 72. Again "${S}" is used for reading tests
	# Since py3_2 is first in the queue it needs its own copy 
	# or else all py2s to follow will be reading read py3 tests
	if [[ "${EPYTHON}" == 'python3.2' ]]; then
		cd "${BUILD_DIR}"/lib || die
		cp -a "${S}"/tests/ .  || die
		2to3 -w tests/tests.py
		"${PYTHON}" tests/tests.py || die
		rm -rf tests/ || die
	else
		"${PYTHON}" tests/tests.py || die
	fi
}