From 1e85fc3497f391bbb10ef0cca2bc9cf18bd0f46e110c99c6c85fe1d740d62c3a Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Sun, 12 Mar 2023 08:38:07 +0000 Subject: [PATCH] - Update to version 0.11.0: - Add support for \w and \W - fix utf-8 - Fix: Import error sre_parse: sre_parse module was moved in py3.11 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-exrex?expand=0&rev=17 --- exrex-0.10.5+git119.tar.gz | 3 --- exrex-0.11.0.tar.gz | 3 +++ fix-python-3.11.patch | 46 -------------------------------------- fix-setup-encoding.patch | 23 ------------------- python-exrex.changes | 8 +++++++ python-exrex.spec | 17 +++++--------- 6 files changed, 16 insertions(+), 84 deletions(-) delete mode 100644 exrex-0.10.5+git119.tar.gz create mode 100644 exrex-0.11.0.tar.gz delete mode 100644 fix-python-3.11.patch delete mode 100644 fix-setup-encoding.patch diff --git a/exrex-0.10.5+git119.tar.gz b/exrex-0.10.5+git119.tar.gz deleted file mode 100644 index 7b1677a..0000000 --- a/exrex-0.10.5+git119.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d1609b4ec492b916838bdd107bb3ca0d69460c87d622a17e59121a0440bcf975 -size 25571 diff --git a/exrex-0.11.0.tar.gz b/exrex-0.11.0.tar.gz new file mode 100644 index 0000000..e455668 --- /dev/null +++ b/exrex-0.11.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2df167ef3beed2f41d9e539de763332e6d357fd214a06294ac5f4302cc6609f4 +size 25577 diff --git a/fix-python-3.11.patch b/fix-python-3.11.patch deleted file mode 100644 index 4303d50..0000000 --- a/fix-python-3.11.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 44712bfb1350a509581a5834d9fa8aebcd9434db Mon Sep 17 00:00:00 2001 -From: Michael Souza <119819695+sumslogs@users.noreply.github.com> -Date: Sat, 10 Dec 2022 21:52:13 -0800 -Subject: [PATCH] Fix: Import error sre_parse - -sre_parse module was moved in py3.11 ---- - exrex.py | 6 +++++- - tests.py | 6 +++++- - 2 files changed, 10 insertions(+), 2 deletions(-) - -diff --git a/exrex.py b/exrex.py -index 24c0de9..be74f92 100644 ---- a/exrex.py -+++ b/exrex.py -@@ -22,7 +22,11 @@ - from future_builtins import map, range - except: - pass --from re import match, sre_parse, U -+from re import match, U -+try: -+ import re._parser as sre_parse -+except ImportError: # Python < 3.11 -+ from re import sre_parse - from itertools import tee - from random import choice, randint - from types import GeneratorType -diff --git a/tests.py b/tests.py -index 8a8a63e..ef0d42c 100644 ---- a/tests.py -+++ b/tests.py -@@ -20,8 +20,12 @@ - - from exrex import generate, count, getone, CATEGORIES, simplify - import re --import sre_parse -+try: -+ import re._parser as sre_parse -+except ImportError: # Python < 3.11 -+ from re import sre_parse - from sys import exit, version_info -+ - IS_PY3 = version_info[0] == 3 - - RS = { diff --git a/fix-setup-encoding.patch b/fix-setup-encoding.patch deleted file mode 100644 index dee8eb8..0000000 --- a/fix-setup-encoding.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 09a1ef0962268460f66084a992fee1aff77dc141 Mon Sep 17 00:00:00 2001 -From: Sebastian Wagner -Date: Thu, 25 Feb 2021 21:03:56 +0100 -Subject: [PATCH] setup.py: declare encoding as utf-8 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -the ellipsis (…) causes troubles otherwise on "old" python versions as -3.6 ---- - setup.py | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/setup.py b/setup.py -index 29c5a87..475a86f 100644 ---- a/setup.py -+++ b/setup.py -@@ -1,3 +1,4 @@ -+# -*- coding: utf-8 -*- - import io - import os - import sys diff --git a/python-exrex.changes b/python-exrex.changes index a470f7c..852cb1f 100644 --- a/python-exrex.changes +++ b/python-exrex.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sun Mar 12 08:36:45 UTC 2023 - Sebastian Wagner + +- Update to version 0.11.0: + - Add support for \w and \W + - fix utf-8 + - Fix: Import error sre_parse: sre_parse module was moved in py3.11 + ------------------------------------------------------------------- Mon Feb 27 19:06:55 UTC 2023 - Sebastian Wagner diff --git a/python-exrex.spec b/python-exrex.spec index d4ceaf5..a51ccdf 100644 --- a/python-exrex.spec +++ b/python-exrex.spec @@ -16,21 +16,16 @@ # -%define revision fd1e21ffc7c16fd5637a5c440224766417e840f9 -%define skip_python2 1 Name: python-exrex -Version: 0.10.5+git119 +Version: 0.11.0 Release: 0 Summary: Irregular methods for regular expressions License: AGPL-3.0-or-later Group: Development/Languages/Python URL: https://github.com/asciimoo/exrex #Source: https://files.pythonhosted.org/packages/source/e/exrex/exrex-%%{version}.tar.gz -Source: https://github.com/asciimoo/exrex/archive/%{revision}.tar.gz#/exrex-%{version}.tar.gz -# PATCH-FIX-UPSTREAM fix-setup-encoding.patch -Patch0: https://github.com/asciimoo/exrex/pull/53.patch#/fix-setup-encoding.patch -# PATCH-FIX-UPSTREAM fix-python-3.11.patch -Patch1: https://github.com/asciimoo/exrex/pull/65.patch#/fix-python-3.11.patch +# pypi has no tests +Source: https://github.com/asciimoo/exrex/archive/v%{version}.tar.gz#/exrex-%{version}.tar.gz BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -44,10 +39,8 @@ BuildArch: noarch A command line tool and python module that generates all or random matching strings to a given regular expression and more. %prep -%setup -q -n exrex-%{revision} +%setup -q -n exrex-%{version} sed -i '1s/^#!.*//' exrex.py -%patch0 -p1 -%patch1 -p1 %build %python_build @@ -71,7 +64,7 @@ LANG=C.UTF-8 PYTHONPATH=%{buildroot}%{$python_sitelib} $python ./tests.py} %files %{python_files} %{python_sitelib}/exrex* %{python_sitelib}/__pycache__/exrex.* -%{python_sitelib}/exrex-0.10.6*-info +%{python_sitelib}/exrex-%{version}*-info %license COPYING %doc README.md doc/ %python_alternative %{_bindir}/exrex