dev-python/backrefs: Remove old

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2022-06-22 09:38:51 +02:00
parent 2c27f383b7
commit 1aee2c9d2c
3 changed files with 0 additions and 213 deletions

View File

@@ -1,2 +1 @@
DIST backrefs-5.2.tar.gz 5220528 BLAKE2B b786df162f37406c36b99d9d4d36ed439837dae2f1d138238d5afc6e9ab108f1c4be1802606e14892ae08d7e3878f5c5068a6923de14d13ab89ef6749fd69b6e SHA512 fd68cd90deaf299a3bb21f70126db51f537e6dc1126fa38beda63901dccfe4db81842aea23eb20ac9311bfef74ff2339ebffdb8cdbcfed197c3ef0fd5b3e793b
DIST backrefs-5.3.gh.tar.gz 4291850 BLAKE2B d2d21dcb2d6a540ff6d06fbadb08c9a9ae6251c9bf78601b59611e80215f659cb46e8d535563c397ea28d014a67ffbc4d29a8f8632023ab9904b9630ac96602a SHA512 c42985a26605e3ab1f8b30943efdc554829d2a5951f32cff486959be1c7c1c61613adc947379aaebec74d8f574ae2c39e46e4682e2f78bb059beee2d9572f352

View File

@@ -1,55 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..11} )
DISTUTILS_USE_PEP517=setuptools
DOCS_BUILDER="mkdocs"
DOCS_DEPEND="
dev-python/mkdocs-git-revision-date-localized-plugin
~dev-python/mkdocs_pymdownx_material_extras-1.0.7
dev-python/mkdocs-minify-plugin
dev-python/mkdocs-material
dev-python/pyspelling
"
inherit distutils-r1 docs
DESCRIPTION="Wrapper around re or regex that adds additional back references"
HOMEPAGE="
https://github.com/facelessuser/backrefs/
https://pypi.org/project/backrefs/
"
SRC_URI="https://github.com/facelessuser/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 ~riscv x86"
BDEPEND="
test? (
dev-python/mock[${PYTHON_USEDEP}]
dev-python/regex[${PYTHON_USEDEP}]
dev-vcs/git
)"
PATCHES=(
"${FILESDIR}/${P}-fix-regex-unrecognized-escape.patch"
)
distutils_enable_tests pytest
python_prepare_all() {
# mkdocs-git-revision-date-localized-plugin needs git repo
if use doc; then
git init || die
git config --global user.email "you@example.com" || die
git config --global user.name "Your Name" || die
git add . || die
git commit -m 'init' || die
fi
distutils-r1_python_prepare_all
}

View File

@@ -1,157 +0,0 @@
From 78577debb9127ace54101f77e669d7c674476803 Mon Sep 17 00:00:00 2001
From: facelessuser <faceless.shop@gmail.com>
Date: Fri, 8 Apr 2022 18:35:00 -0600
Subject: [PATCH] Fixes for recent regex library handling of unrecognized
escapes
---
tests/test_bre.py | 4 +--
tests/test_bregex.py | 60 +++++++++++++++++++++-----------------------
2 files changed, 30 insertions(+), 34 deletions(-)
diff --git a/tests/test_bre.py b/tests/test_bre.py
index d88fe86..64b9a57 100644
--- a/tests/test_bre.py
+++ b/tests/test_bre.py
@@ -1464,7 +1464,7 @@ def test_escaped_slash_before_backref(self):
self.assertEqual(r'\\test: \This is a test of escaped slash backrefs!', results)
- def test_normal_escaping(self):
+ def test_normal_escaping_replace(self):
"""Test normal escaped slash."""
text = "This is a test of normal escaping!"
@@ -1478,7 +1478,7 @@ def test_normal_escaping(self):
self.assertEqual(results2, results)
self.assertEqual('\t \\t \\\t \\\\t \\\\\t', results)
- def test_bytes_normal_escaping(self):
+ def test_bytes_normal_escaping_replace(self):
"""Test bytes normal escaped slash."""
text = b"This is a test of normal escaping!"
diff --git a/tests/test_bregex.py b/tests/test_bregex.py
index 929227a..5a3d0af 100644
--- a/tests/test_bregex.py
+++ b/tests/test_bregex.py
@@ -801,12 +801,10 @@ def test_bytes_line_break(self):
)
def test_line_break_in_group(self):
- """Test that line break in group matches a normal R."""
+ """Test that line break in group fails."""
- self.assertEqual(
- bregex.sub(r"[\R]", 'l', 'Rine\r\nRine\nRine\r'),
- 'line\r\nline\nline\r'
- )
+ with self.assertRaises(_regex_core.error):
+ bregex.sub(r"[\R]", 'l', 'Rine\r\nRine\nRine\r')
def test_replace_unicode_name_ascii_range(self):
"""Test replacing Unicode names in the ASCII range."""
@@ -1176,33 +1174,33 @@ def test_escaped_slash_before_backref(self):
self.assertEqual(r'\\test: \This is a test of escaped slash backrefs!', results)
- def test_normal_escaping(self):
+ def test_normal_escaping_replace(self):
"""Test normal escaped slash."""
text = "This is a test of normal escaping!"
pattern = regex.compile(r"(.+)")
- repl_pattern = r'\e \\e \\\e \\\\e \\\\\e'
+ repl_pattern = r'\t \\t \\\t \\\\t \\\\\t'
expand = bregex.compile_replace(pattern, repl_pattern)
m = pattern.match(text)
results = expand(m)
results2 = pattern.sub(repl_pattern, text)
self.assertEqual(results2, results)
- self.assertEqual('\\e \\e \\\\e \\\\e \\\\\\e', results)
+ self.assertEqual('\t \\t \\\t \\\\t \\\\\t', results)
- def test_bytes_normal_escaping(self):
+ def test_bytes_normal_escaping_replace(self):
"""Test bytes normal escaped slash."""
text = b"This is a test of normal escaping!"
pattern = regex.compile(br"(.+)")
- repl_pattern = br'\e \\e \\\e \\\\e \\\\\e'
+ repl_pattern = br'\t \\t \\\t \\\\t \\\\\t'
expand = bregex.compile_replace(pattern, repl_pattern)
m = pattern.match(text)
results = expand(m)
results2 = pattern.sub(repl_pattern, text)
self.assertEqual(results2, results)
- self.assertEqual(b'\\e \\e \\\\e \\\\e \\\\\\e', results)
+ self.assertEqual(b'\t \\t \\\t \\\\t \\\\\t', results)
def test_escaped_slash_at_eol(self):
"""Test escaped slash at end of line."""
@@ -1214,15 +1212,12 @@ def test_escaped_slash_at_eol(self):
self.assertEqual('\\\\', results)
- def test_unrecognized_backrefs(self):
+ def test_unrecognized_backrefs2(self):
"""Test unrecognized backrefs, or literal backslash before a char."""
- text = "This is a test of unrecognized backrefs!"
pattern = regex.compile(r"(.+)")
- expand = bregex.compile_replace(pattern, r'\k\1')
- results = expand(pattern.match(text))
-
- self.assertEqual(r'\kThis is a test of unrecognized backrefs!', results)
+ with self.assertRaises(_regex_core.error):
+ bregex.compile_replace(pattern, r'\k\1')
def test_ignore_group(self):
"""Test that backrefs inserted by matching groups are passed over."""
@@ -1628,23 +1623,23 @@ def test_dont_case_special_refs(self):
self.assertEqual('\u0108\nWw\u0108', results)
# Bytes doesn't care about Unicode, but should evaluate bytes
- pattern = regex.compile(b'Test')
- expand = bregex.compile_replace(pattern, br'\C\u0109\n\x77\E\l\x57\c\u0109')
- results = expand(pattern.match(b'Test'))
- self.assertEqual(b'\\U0109\nWw\\u0109', results)
+ # pattern = regex.compile(b'Test')
+ # expand = bregex.compile_replace(pattern, br'\C\u0109\n\x77\E\l\x57\c\u0109')
+ # results = expand(pattern.match(b'Test'))
+ # self.assertEqual(b'\\U0109\nWw\\u0109', results)
- expandf = bregex.compile_replace(pattern, br'\C\u0109\n\x77\E\l\x57\c\u0109', bregex.FORMAT)
- results = expandf(pattern.match(b'Test'))
- self.assertEqual(b'\\U0109\nWw\\u0109', results)
+ # expandf = bregex.compile_replace(pattern, br'\C\u0109\n\x77\E\l\x57\c\u0109', bregex.FORMAT)
+ # results = expandf(pattern.match(b'Test'))
+ # self.assertEqual(b'\\U0109\nWw\\u0109', results)
- pattern = regex.compile(b'Test')
- expand = bregex.compile_replace(pattern, br'\C\U00000109\n\x77\E\l\x57\c\U00000109')
- results = expand(pattern.match(b'Test'))
- self.assertEqual(b'\U00000109\nWw\U00000109', results)
+ # pattern = regex.compile(b'Test')
+ # expand = bregex.compile_replace(pattern, br'\C\U00000109\n\x77\E\l\x57\c\U00000109')
+ # results = expand(pattern.match(b'Test'))
+ # self.assertEqual(b'\U00000109\nWw\U00000109', results)
- expandf = bregex.compile_replace(pattern, br'\C\U00000109\n\x77\E\l\x57\c\U00000109', bregex.FORMAT)
- results = expandf(pattern.match(b'Test'))
- self.assertEqual(b'\U00000109\nWw\U00000109', results)
+ # expandf = bregex.compile_replace(pattern, br'\C\U00000109\n\x77\E\l\x57\c\U00000109', bregex.FORMAT)
+ # results = expandf(pattern.match(b'Test'))
+ # self.assertEqual(b'\U00000109\nWw\U00000109', results)
# Format doesn't care about groups
pattern = regex.compile('Test')
@@ -2184,4 +2179,5 @@ def test_auto_compile_off(self):
replace = p.compile(r'{1}', bregex.FORMAT)
self.assertEqual(p.subf(replace, 'tests'), 'test')
- self.assertEqual(p.sub(r'\ltest', 'tests'), r'\ltest')
+ with self.assertRaises(_regex_core.error):
+ self.assertEqual(p.sub(r'\ltest', 'tests'), r'\ltest')