summaryrefslogtreecommitdiff
path: root/dev-python
diff options
context:
space:
mode:
authorTiziano Müller <dev-zero@gentoo.org>2016-09-09 14:46:55 +0200
committerTiziano Müller <dev-zero@gentoo.org>2016-09-09 14:46:55 +0200
commitf6c6f131e29c2b5bc10d6e9fca0bea1200260f78 (patch)
tree6790fac5ea8bd62de813b461d340e2b184205013 /dev-python
parentd72614043d6f5e2764db783191c4ab4ab91d0888 (diff)
downloadgentoo-f6c6f131e29c2b5bc10d6e9fca0bea1200260f78.tar.gz
gentoo-f6c6f131e29c2b5bc10d6e9fca0bea1200260f78.tar.xz
dev-python/parse-type: rev-bump for EAPI 6 bump and py-3.5 support
Package-Manager: portage-2.3.0
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/parse-type/files/parse-type-0.3.4-python-3.5-tests-compat.patch40
-rw-r--r--dev-python/parse-type/parse-type-0.3.4-r1.ebuild38
2 files changed, 78 insertions, 0 deletions
diff --git a/dev-python/parse-type/files/parse-type-0.3.4-python-3.5-tests-compat.patch b/dev-python/parse-type/files/parse-type-0.3.4-python-3.5-tests-compat.patch
new file mode 100644
index 00000000000..54cfa59cb80
--- /dev/null
+++ b/dev-python/parse-type/files/parse-type-0.3.4-python-3.5-tests-compat.patch
@@ -0,0 +1,40 @@
+From 8f7ce32dc6bd466f1ea6ccc9260917016061bb4e Mon Sep 17 00:00:00 2001
+From: David King <dking@redhat.com>
+Date: Tue, 15 Dec 2015 08:52:26 +0000
+Subject: [PATCH] Adapt bundled parse for Python 3.5
+
+As the upstream pull request:
+
+https://github.com/r1chardj0n3s/parse/pull/34
+---
+ tests/test_parse_type_parse.py | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tests/test_parse_type_parse.py b/tests/test_parse_type_parse.py
+index 4151d37..cab6143 100644
+--- a/tests/test_parse_type_parse.py
++++ b/tests/test_parse_type_parse.py
+@@ -11,6 +11,7 @@
+
+ import unittest
+ from datetime import datetime, time
++import re
+ # XXX-ADAPT:
+ # ORIG: import parse
+ from parse_type import parse
+@@ -611,8 +612,13 @@ def test_mixed_type_variant(self):
+ self.assertEqual(r.fixed[21], 'spam')
+
+ def test_too_many_fields(self):
+- p = parse.compile('{:ti}' * 15)
+- self.assertRaises(parse.TooManyFields, p.parse, '')
++ # Python 3.5 removed the limit of 100 named groups in a regular expression,
++ # so only test for the exception if the limit exists.
++ try:
++ re.compile("".join("(?P<n{n}>{n}-)".format(n=i) for i in range(101)))
++ except AssertionError:
++ p = parse.compile('{:ti}' * 15)
++ self.assertRaises(parse.TooManyFields, p.parse, '')
+
+
+ class TestSearch(unittest.TestCase):
diff --git a/dev-python/parse-type/parse-type-0.3.4-r1.ebuild b/dev-python/parse-type/parse-type-0.3.4-r1.ebuild
new file mode 100644
index 00000000000..228e991cb9e
--- /dev/null
+++ b/dev-python/parse-type/parse-type-0.3.4-r1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 python3_{4,5} )
+
+inherit distutils-r1
+
+MY_PN="${PN/-/_}"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Simplifies to build parse types based on the parse module"
+HOMEPAGE="https://github.com/jenisys/parse_type"
+SRC_URI="mirror://pypi/${PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="test"
+
+RDEPEND=">=dev-python/parse-1.6[${PYTHON_USEDEP}]
+ dev-python/six[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep 'dev-python/enum34[${PYTHON_USEDEP}]' 'python2*' 'python3_3')"
+DEPEND="${RDEPEND}
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ test? (
+ dev-python/pytest[${PYTHON_USEDEP}]
+ dev-python/pytest-runner[${PYTHON_USEDEP}]
+ )"
+
+PATCHES=( "${FILESDIR}/${P}-python-3.5-tests-compat.patch" )
+
+S="${WORKDIR}/${MY_P}"
+
+python_test() {
+ py.test tests || die "Tests failed under ${EPYTHON}"
+}