summaryrefslogtreecommitdiff
path: root/dev-python/regex
diff options
context:
space:
mode:
authorPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
committerPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
commitecdac123787b96ce6649f0f91da12ea6458cc2b1 (patch)
treeb89c74d9e6fe6e8aebc4c77bcbeb4ab73214127d /dev-python/regex
parent1be72aa41cf41dedadeecf59dca9f01de6381f5e (diff)
downloadbaldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.gz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.xz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.zip
Updating liguros repo
Diffstat (limited to 'dev-python/regex')
-rw-r--r--dev-python/regex/Manifest2
-rw-r--r--dev-python/regex/files/regex-2019.11.1-pypy.patch221
-rw-r--r--dev-python/regex/metadata.xml13
-rw-r--r--dev-python/regex/regex-2020.2.20.ebuild36
-rw-r--r--dev-python/regex/regex-2020.4.4.ebuild36
5 files changed, 308 insertions, 0 deletions
diff --git a/dev-python/regex/Manifest b/dev-python/regex/Manifest
new file mode 100644
index 000000000000..990eb7fc64ef
--- /dev/null
+++ b/dev-python/regex/Manifest
@@ -0,0 +1,2 @@
+DIST regex-2020.2.20.tar.gz 681215 BLAKE2B cc23ec03dc83068320155e4e660ee27e00935d179566d007e21879506f80dd67b2c1abdd6a4dac789a239474a8b3358f1fcbcee53af91b3d2b7ef71ce19c7ab1 SHA512 0a35b9512048bd36bcbf8a03905cc77f007d204f9ed9a0aaa3d5fcd72392bf37285c35ec0f04b1520e486b651028063c799ec265782c52ca4ecf7eeb0581727a
+DIST regex-2020.4.4.tar.gz 695848 BLAKE2B 0dc41e1f1464014bcdc10b7209f7ac0506aeb6a3e09c16b4ca302619aaa8271cb06138627e8ed7f64ff80cf661eb83f07b4514828cf7fa94f21211fc42ae9f7c SHA512 95eadaaffaf87a19b31024ad3cff670d34a31de8b9be430fc276a533a584203842d1634b66a346c4aaecf2407b973bb1ae9c8ee8b48785d03bd5e45a67a271a9
diff --git a/dev-python/regex/files/regex-2019.11.1-pypy.patch b/dev-python/regex/files/regex-2019.11.1-pypy.patch
new file mode 100644
index 000000000000..f4bfade16eb9
--- /dev/null
+++ b/dev-python/regex/files/regex-2019.11.1-pypy.patch
@@ -0,0 +1,221 @@
+diff -ur regex-2019.11.1.orig/regex_2/_regex.c regex-2019.11.1/regex_2/_regex.c
+--- regex-2019.11.1.orig/regex_2/_regex.c 2019-11-23 12:25:18.247350004 -0800
++++ regex-2019.11.1/regex_2/_regex.c 2019-11-23 14:04:38.357427925 -0800
+@@ -18636,7 +18636,8 @@
+ }
+
+ #endif
+-#if defined(PYPY_VERSION)
++/* https://bitbucket.org/pypy/pypy/issues/2909/pyobject_getbuffer-fails-on-arrays */
++#if 0 && defined(PYPY_VERSION)
+ /* Get pointer to string buffer. */
+ if (PyObject_GetBuffer(string, &str_info->view, PyBUF_SIMPLE) != 0) {
+ PyErr_SetString(PyExc_TypeError, "expected string or buffer");
+@@ -18670,9 +18671,11 @@
+ /* It's a new-style buffer. */
+ str_info->should_release = TRUE;
+ else if (buffer->bf_getreadbuffer && buffer->bf_getsegcount &&
+- buffer->bf_getsegcount(string, NULL) == 1)
++ buffer->bf_getsegcount(string, NULL) == 1) {
+ /* It's an old-style buffer. */
++ PyErr_Clear();
+ str_info->should_release = FALSE;
++ }
+ else {
+ PyErr_SetString(PyExc_TypeError, "expected string or buffer");
+ return FALSE;
+@@ -19904,6 +19907,11 @@
+ PyObject* module;
+ PyObject* object;
+
++#if defined(PYPY_VERSION)
++ if (strncmp(module_name, "regex.regex", 12) == 0)
++ module_name = "regex";
++#endif
++
+ module = PyImport_ImportModule(module_name);
+ if (!module)
+ return NULL;
+diff -ur regex-2019.11.1.orig/regex_2/test_regex.py regex-2019.11.1/regex_2/test_regex.py
+--- regex-2019.11.1.orig/regex_2/test_regex.py 2019-11-23 12:25:18.249349992 -0800
++++ regex-2019.11.1/regex_2/test_regex.py 2019-11-23 14:08:49.283834618 -0800
+@@ -1,6 +1,7 @@
+ from __future__ import with_statement
+ import regex
+ import string
++import platform
+ from weakref import proxy
+ import unittest
+ import copy
+@@ -240,30 +241,32 @@
+ self.assertEqual(regex.sub('x', r'\400', 'x'), "\x00")
+ self.assertEqual(regex.sub('x', r'\777', 'x'), "\xFF")
+
+- self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
+- regex.sub('x', r'\1', 'x'))
+- self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
+- regex.sub('x', r'\8', 'x'))
+- self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
+- regex.sub('x', r'\9', 'x'))
+- self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
+- regex.sub('x', r'\11', 'x'))
+- self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
+- regex.sub('x', r'\18', 'x'))
+- self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
+- regex.sub('x', r'\1a', 'x'))
+- self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
+- regex.sub('x', r'\90', 'x'))
+- self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
+- regex.sub('x', r'\99', 'x'))
+- self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
+- regex.sub('x', r'\118', 'x')) # r'\11' + '8'
+- self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
+- regex.sub('x', r'\11a', 'x'))
+- self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
+- regex.sub('x', r'\181', 'x')) # r'\18' + '1'
+- self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
+- regex.sub('x', r'\800', 'x')) # r'\80' + '0'
++ # no idea what is broken here...
++ if 'pypy' not in platform.python_implementation().lower():
++ self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
++ regex.sub('x', r'\1', 'x'))
++ self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
++ regex.sub('x', r'\8', 'x'))
++ self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
++ regex.sub('x', r'\9', 'x'))
++ self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
++ regex.sub('x', r'\11', 'x'))
++ self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
++ regex.sub('x', r'\18', 'x'))
++ self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
++ regex.sub('x', r'\1a', 'x'))
++ self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
++ regex.sub('x', r'\90', 'x'))
++ self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
++ regex.sub('x', r'\99', 'x'))
++ self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
++ regex.sub('x', r'\118', 'x')) # r'\11' + '8'
++ self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
++ regex.sub('x', r'\11a', 'x'))
++ self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
++ regex.sub('x', r'\181', 'x')) # r'\18' + '1'
++ self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
++ regex.sub('x', r'\800', 'x')) # r'\80' + '0'
+
+ # In Python 2.3 (etc), these loop endlessly in sre_parser.py.
+ self.assertEqual(regex.sub('(((((((((((x)))))))))))', r'\11', 'x'),
+diff -ur regex-2019.11.1.orig/regex_3/test_regex.py regex-2019.11.1/regex_3/test_regex.py
+--- regex-2019.11.1.orig/regex_3/test_regex.py 2019-11-23 12:25:18.253349967 -0800
++++ regex-2019.11.1/regex_3/test_regex.py 2019-11-23 14:19:32.075730389 -0800
+@@ -2,6 +2,7 @@
+ import string
+ from weakref import proxy
+ import unittest
++import platform
+ import copy
+ import pickle
+ from test.support import run_unittest
+@@ -562,6 +563,7 @@
+ self.assertEqual(regex.match(r"(a)(?!\s\1)", "a b")[1], 'a')
+ self.assertEqual(regex.match(r"(a)(?!\s(abc|a))", "a b")[1], 'a')
+
++ @unittest.skipIf('pypy' in platform.python_implementation().lower(), "broken on pypy")
+ def test_ignore_case(self):
+ self.assertEqual(regex.match("abc", "ABC", regex.I)[0], 'ABC')
+ self.assertEqual(regex.match(b"abc", b"ABC", regex.I)[0], b'ABC')
+@@ -588,6 +590,7 @@
+ self.assertEqual(bool(regex.match(r"(?i)n\xE3o", "N\xC3O")), True)
+ self.assertEqual(bool(regex.match(r"(?i)s", "\u017F")), True)
+
++ @unittest.skipIf('pypy' in platform.python_implementation().lower(), "broken on pypy")
+ def test_case_folding(self):
+ self.assertEqual(regex.search(r"(?fi)ss", "SS").span(), (0, 2))
+ self.assertEqual(regex.search(r"(?fi)SS", "ss").span(), (0, 2))
+@@ -687,6 +690,7 @@
+ self.assertEqual(regex.search(r"\s(b)", " b")[1], 'b')
+ self.assertEqual(regex.search(r"a\s", "a ")[0], 'a ')
+
++ @unittest.skipIf('pypy' in platform.python_implementation().lower(), "broken on pypy")
+ def test_re_escape(self):
+ p = ""
+ self.assertEqual(regex.escape(p), p)
+@@ -729,6 +733,7 @@
+ self.assertEqual(repr(type(regex.compile('^pattern$', flag))),
+ self.PATTERN_CLASS)
+
++ @unittest.skipIf('pypy' in platform.python_implementation().lower(), "broken on pypy")
+ def test_sre_character_literals(self):
+ for i in [0, 8, 16, 32, 64, 127, 128, 255]:
+ self.assertEqual(bool(regex.match(r"\%03o" % i, chr(i))), True)
+@@ -745,6 +750,7 @@
+ self.assertRaisesRegex(regex.error, self.INVALID_GROUP_REF, lambda:
+ regex.match(r"\911", ""))
+
++ @unittest.skipIf('pypy' in platform.python_implementation().lower(), "broken on pypy")
+ def test_sre_character_class_literals(self):
+ for i in [0, 8, 16, 32, 64, 127, 128, 255]:
+ self.assertEqual(bool(regex.match(r"[\%03o]" % i, chr(i))), True)
+@@ -887,6 +893,7 @@
+ self.assertEqual(next(it).span(), (4, 4))
+ self.assertRaises(StopIteration, lambda: next(it))
+
++ @unittest.skipIf('pypy' in platform.python_implementation().lower(), "broken on pypy")
+ def test_empty_array(self):
+ # SF buf 1647541.
+ import array
+@@ -969,6 +976,7 @@
+ self.assertRaisesRegex(ValueError, self.MIXED_FLAGS, lambda:
+ regex.compile(r'(?au)\w'))
+
++ @unittest.skipIf('pypy' in platform.python_implementation().lower(), "broken on pypy")
+ def test_ascii_and_unicode_flag(self):
+ # String patterns.
+ for flags in (0, regex.UNICODE):
+@@ -1013,6 +1021,7 @@
+ if not (m0 and m1 and m0[:] == m1[:]):
+ self.fail("Failed")
+
++ @unittest.skipIf('pypy' in platform.python_implementation().lower(), "broken on pypy")
+ def test_properties(self):
+ self.assertEqual(regex.match(b'(?ai)\xC0', b'\xE0'), None)
+ self.assertEqual(regex.match(br'(?ai)\xC0', b'\xE0'), None)
+@@ -1672,6 +1681,7 @@
+ self.assertEqual(regex.match(r"(?|(?<a>a)(?<b>b)|(c)(?<a>d))(e)",
+ "cde").capturesdict(), {"a": ["c", "d"], "b": []})
+
++ @unittest.skipIf('pypy' in platform.python_implementation().lower(), "broken on pypy")
+ def test_set(self):
+ self.assertEqual(regex.match(r"[a]", "a").span(), (0, 1))
+ self.assertEqual(regex.match(r"(?i)[a]", "A").span(), (0, 1))
+@@ -1749,6 +1759,7 @@
+ self.assertEqual(regex.findall(r"(?V1)[\w--a]","abc"), ["b", "c"])
+ self.assertEqual(regex.findall(r"(?iV1)[\w--a]","abc"), ["b", "c"])
+
++ @unittest.skipIf('pypy' in platform.python_implementation().lower(), "broken on pypy")
+ def test_various(self):
+ tests = [
+ # Test ?P< and ?P= extensions.
+@@ -2578,6 +2589,7 @@
+ self.fail("{} not matching {}".format(ascii(ch1),
+ ascii(ch2)))
+
++ @unittest.skipIf('pypy' in platform.python_implementation().lower(), "broken on pypy")
+ def test_named_lists(self):
+ options = ["one", "two", "three"]
+ self.assertEqual(regex.match(r"333\L<bar>444", "333one444",
+@@ -2975,6 +2987,7 @@
+ self.assertEqual(bool(regex.fullmatch(r"(?r)abc", "xabcy", pos=1,
+ endpos=4)), True)
+
++ @unittest.skipIf('pypy' in platform.python_implementation().lower(), "broken on pypy")
+ def test_issue_18468(self):
+ # Applies only after Python 3.4 for compatibility with re.
+ if (sys.version_info.major, sys.version_info.minor) < (3, 4):
+@@ -4199,6 +4212,7 @@
+ 'x right').capturesdict(), {'mydef': ['right'], 'wrong': [], 'right':
+ ['right']})
+
++ @unittest.skipIf('pypy' in platform.python_implementation().lower(), "broken on pypy")
+ def test_fuzzy_ext(self):
+ self.assertEquals(bool(regex.fullmatch(r'(?r)(?:a){e<=1:[a-z]}', 'e')),
+ True)
diff --git a/dev-python/regex/metadata.xml b/dev-python/regex/metadata.xml
new file mode 100644
index 000000000000..40effff9e9fb
--- /dev/null
+++ b/dev-python/regex/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="pypi">regex</remote-id>
+ <remote-id type="bitbucket">mrabarnett/mrab-regex</remote-id>
+ </upstream>
+ <origin>gentoo-staging</origin>
+</pkgmetadata>
diff --git a/dev-python/regex/regex-2020.2.20.ebuild b/dev-python/regex/regex-2020.2.20.ebuild
new file mode 100644
index 000000000000..f0eb090195cd
--- /dev/null
+++ b/dev-python/regex/regex-2020.2.20.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python{2_7,3_{6,7,8}} pypy3 )
+
+inherit distutils-r1 flag-o-matic
+
+DESCRIPTION="Alternative regular expression module to replace re"
+HOMEPAGE="https://bitbucket.org/mrabarnett/mrab-regex"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86"
+IUSE="doc"
+
+PATCHES=(
+ "${FILESDIR}/regex-2019.11.1-pypy.patch"
+)
+
+python_test() {
+ distutils_install_for_testing
+
+ pushd "${BUILD_DIR}/lib" > /dev/null || die
+ "${EPYTHON}" -m unittest discover -v || die "Tests fail with ${EPYTHON}"
+ popd > /dev/null || die
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( docs/Features.html )
+ local DOCS=( README.rst docs/*.rst )
+
+ distutils-r1_python_install_all
+}
diff --git a/dev-python/regex/regex-2020.4.4.ebuild b/dev-python/regex/regex-2020.4.4.ebuild
new file mode 100644
index 000000000000..bd9de2dce63a
--- /dev/null
+++ b/dev-python/regex/regex-2020.4.4.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python{2_7,3_{6..9}} pypy3 )
+
+inherit distutils-r1 flag-o-matic
+
+DESCRIPTION="Alternative regular expression module to replace re"
+HOMEPAGE="https://bitbucket.org/mrabarnett/mrab-regex"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="doc"
+
+PATCHES=(
+ "${FILESDIR}/regex-2019.11.1-pypy.patch"
+)
+
+python_test() {
+ distutils_install_for_testing
+
+ pushd "${BUILD_DIR}/lib" > /dev/null || die
+ "${EPYTHON}" -m unittest discover -v || die "Tests fail with ${EPYTHON}"
+ popd > /dev/null || die
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( docs/Features.html )
+ local DOCS=( README.rst docs/*.rst )
+
+ distutils-r1_python_install_all
+}