summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2014-02-24 08:43:55 +0000
committerJustin Lecher <jlec@gentoo.org>2014-02-24 08:43:55 +0000
commit73a9713dde2ba43911a0224821f790523308724c (patch)
tree4bf312dfe3792a45d1761a5eaec3c7cd6332075f /dev-python/ujson
parentFetch and preserve git notes as well. (diff)
downloadgentoo-2-73a9713dde2ba43911a0224821f790523308724c.tar.gz
gentoo-2-73a9713dde2ba43911a0224821f790523308724c.tar.bz2
gentoo-2-73a9713dde2ba43911a0224821f790523308724c.zip
dev-python/ujson: Add py3.3 support
(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)
Diffstat (limited to 'dev-python/ujson')
-rw-r--r--dev-python/ujson/ChangeLog8
-rw-r--r--dev-python/ujson/files/ujson-1.33-test-py3.patch38
-rw-r--r--dev-python/ujson/metadata.xml10
-rw-r--r--dev-python/ujson/ujson-1.33.ebuild15
4 files changed, 59 insertions, 12 deletions
diff --git a/dev-python/ujson/ChangeLog b/dev-python/ujson/ChangeLog
index 205354a1bcb5..1475e4ddd641 100644
--- a/dev-python/ujson/ChangeLog
+++ b/dev-python/ujson/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for dev-python/ujson
-# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/ujson/ChangeLog,v 1.4 2013/09/15 17:23:15 maekke Exp $
+# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/ujson/ChangeLog,v 1.5 2014/02/24 08:43:55 jlec Exp $
+
+ 24 Feb 2014; Justin Lecher <jlec@gentoo.org> ujson-1.33.ebuild,
+ +files/ujson-1.33-test-py3.patch, metadata.xml:
+ Add py3.3 support
15 Sep 2013; Markus Meier <maekke@gentoo.org> ujson-1.33.ebuild:
add ~arm, bug #483324
diff --git a/dev-python/ujson/files/ujson-1.33-test-py3.patch b/dev-python/ujson/files/ujson-1.33-test-py3.patch
new file mode 100644
index 000000000000..e497f396792c
--- /dev/null
+++ b/dev-python/ujson/files/ujson-1.33-test-py3.patch
@@ -0,0 +1,38 @@
+ tests/tests.py | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/tests/tests.py b/tests/tests.py
+index d210bc6..71f8074 100644
+--- a/tests/tests.py
++++ b/tests/tests.py
+@@ -11,6 +11,7 @@ try:
+ except ImportError:
+ import simplejson as json
+ import math
++import nose
+ import platform
+ import sys
+ import time
+@@ -24,9 +25,10 @@ from functools import partial
+
+ PY3 = (sys.version_info[0] >= 3)
+
+-def _python_ver(skip_major, skip_minor=None):
++def _skip_if_python_ver(skip_major, skip_minor=None):
+ major, minor = sys.version_info[:2]
+- return major == skip_major and (skip_minor is None or minor == skip_minor)
++ if major == skip_major and (skip_minor is None or minor == skip_minor):
++ raise nose.SkipTest
+
+ json_unicode = (json.dumps if sys.version_info[0] >= 3
+ else partial(json.dumps, encoding="utf-8"))
+@@ -579,8 +581,8 @@ class UltraJSONTests(TestCase):
+ input = "-31337"
+ self.assertEquals (-31337, ujson.decode(input))
+
+- #@unittest.skipIf(_python_ver(3), "No exception in Python 3")
+ def test_encodeUnicode4BytesUTF8Fail(self):
++ _skip_if_python_ver(3)
+ input = "\xfd\xbf\xbf\xbf\xbf\xbf"
+ try:
+ enc = ujson.encode(input)
diff --git a/dev-python/ujson/metadata.xml b/dev-python/ujson/metadata.xml
index d81065b0cd40..98b79a75c7c3 100644
--- a/dev-python/ujson/metadata.xml
+++ b/dev-python/ujson/metadata.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <herd>python</herd>
- <maintainer>
- <email>swegener@gentoo.org</email>
- <name>Sven Wegener</name>
- </maintainer>
+ <herd>python</herd>
+ <maintainer>
+ <email>swegener@gentoo.org</email>
+ <name>Sven Wegener</name>
+ </maintainer>
</pkgmetadata>
diff --git a/dev-python/ujson/ujson-1.33.ebuild b/dev-python/ujson/ujson-1.33.ebuild
index 688af2d10b4f..b72449f34311 100644
--- a/dev-python/ujson/ujson-1.33.ebuild
+++ b/dev-python/ujson/ujson-1.33.ebuild
@@ -1,12 +1,12 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 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 $
+# $Header: /var/cvsroot/gentoo-x86/dev-python/ujson/ujson-1.33.ebuild,v 1.3 2014/02/24 08:43:55 jlec 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} )
+PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3} )
inherit distutils-r1
@@ -19,15 +19,20 @@ SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""
-DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
+DEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
app-arch/unzip"
RDEPEND="${DEPEND}"
+PATCHES=(
+ "${FILESDIR}"/${P}-test-py3.patch
+)
+
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
+ if [[ "${EPYTHON}" =~ 'python3' ]]; then
cd "${BUILD_DIR}"/lib || die
cp -a "${S}"/tests/ . || die
2to3 -w tests/tests.py