diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
commit | 8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch) | |
tree | 7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-python/parse | |
parent | 30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff) |
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-python/parse')
-rw-r--r-- | dev-python/parse/Manifest | 4 | ||||
-rw-r--r-- | dev-python/parse/files/parse-1.6.6-python-3.5-tests-compat.patch | 50 | ||||
-rw-r--r-- | dev-python/parse/metadata.xml | 8 | ||||
-rw-r--r-- | dev-python/parse/parse-1.6.6.ebuild | 25 |
4 files changed, 87 insertions, 0 deletions
diff --git a/dev-python/parse/Manifest b/dev-python/parse/Manifest new file mode 100644 index 000000000000..f4a21dc087b8 --- /dev/null +++ b/dev-python/parse/Manifest @@ -0,0 +1,4 @@ +AUX parse-1.6.6-python-3.5-tests-compat.patch 1694 BLAKE2B 661b7bf97d4bbb392ad5b83aea092075765d133a655e1927ba5094ec3004d6120bbacea20160241d8d20f3210388a58fe54784662ca28c6838a61370a751ff44 SHA512 ed4fa6d689304798f289c11d441bb9c66c21dbde115da4f8bd87f538c5a1ccd7c1ea277ccca6d4c2b2e3560335130213b3d24bfbd6896033c55bd75f01424857 +DIST parse-1.6.6.tar.gz 24638 BLAKE2B dbf1844b09bfdd0fb8ebaecba14f4a6289de315f4d658eac4853696e11b32dc9cda5837ed654072941846f112b480315961d9660c7d111127f57aac8f2c30250 SHA512 fae467b6f6e35f04d9e501162117423506701d101b2265e941b5b34420e833a0f4dbc44f62c33d51836a62ef51da9b5b8a3a1d39b3ec490f9eb77c5b6f302cdf +EBUILD parse-1.6.6.ebuild 552 BLAKE2B 05773d0881c9e7f0a967521b3a3f3620c9a48b5672fded00db15bcbc6a6315fc0e29498ba117bacf0cb7e5688af474ac8f08a895bd8c157a2d256d532b53c5ed SHA512 d0d07d99114c2d39b7a21728456e3cf2fcaf3fef0078c791b41e2c31c9dafb8092a50701fd2a8c05ad7dddcaf1fe9103e331cb627f1bc680a3902178d6c50250 +MISC metadata.xml 265 BLAKE2B 15707d5b008687ee20cd174ab1dea69d3082fec1097e71079be4455b9d4590e9b5a3f793ce1a77b5a5d9ed269c35c2385e130018373a988bc0fd54edb43af21f SHA512 d1fa77115df5e5c3ab3fbf26f7ef5255165c179812e574f483ef52099e993812ca679530c00de8047c458c6f49dde4a70e335870eb77e3b313355a44192bb514 diff --git a/dev-python/parse/files/parse-1.6.6-python-3.5-tests-compat.patch b/dev-python/parse/files/parse-1.6.6-python-3.5-tests-compat.patch new file mode 100644 index 000000000000..5183cf5ef32e --- /dev/null +++ b/dev-python/parse/files/parse-1.6.6-python-3.5-tests-compat.patch @@ -0,0 +1,50 @@ +From 32f15cfefb7c7b6476360ac65cba807aa3dfccfa Mon Sep 17 00:00:00 2001 +From: David King <dking@redhat.com> +Date: Mon, 14 Dec 2015 09:58:19 +0000 +Subject: [PATCH] Fix test_too_many_fields with Python 3.5 + +Python versions before 3.5 had a limit of 100 groups in regular +expressions. This limit was removed during 3.5 development: + +http://bugs.python.org/issue22437 +https://hg.python.org/cpython/rev/0b85ea4bd1af + +The test_too_many_fields test asserts that the limit exists by +attempting to parse a string with 15 fields, which triggers the 100 +named groups limit. + +Adjust the test so that if first checks to see whether the limit of 100 +named groups exists, and only assert that parsing 15 fields fails if +that is the case. +--- + test_parse.py | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/test_parse.py b/test_parse.py +index c524349..1d50568 100755 +--- a/test_parse.py ++++ b/test_parse.py +@@ -6,6 +6,7 @@ + + import unittest + from datetime import datetime, time ++import re + + import parse + +@@ -624,8 +625,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/metadata.xml b/dev-python/parse/metadata.xml new file mode 100644 index 000000000000..c8488c4b44e0 --- /dev/null +++ b/dev-python/parse/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <upstream> + <remote-id type="pypi">parse</remote-id> + <remote-id type="github">r1chardj0n3s/parse</remote-id> + </upstream> +</pkgmetadata> diff --git a/dev-python/parse/parse-1.6.6.ebuild b/dev-python/parse/parse-1.6.6.ebuild new file mode 100644 index 000000000000..e4f2c1b20f20 --- /dev/null +++ b/dev-python/parse/parse-1.6.6.ebuild @@ -0,0 +1,25 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) + +inherit distutils-r1 + +DESCRIPTION="parse() is the opposite of format()" +HOMEPAGE="https://github.com/r1chardj0n3s/parse" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64" +IUSE="" + +DEPEND="" +RDEPEND="" + +PATCHES=( "${FILESDIR}/${P}-python-3.5-tests-compat.patch" ) + +python_test() { + "${PYTHON}" test_parse.py || die "Tests failed under ${EPYTHON}" +} |