From b9796619c5425b3a27584613ae9df7b612351a86754aa2476c65de2ae26a1afd Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Tue, 21 Feb 2023 09:49:05 +0000 Subject: [PATCH] - Add python-311.patch to support python 3.11 gh#last-partizan/pytils#50 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pytils?expand=0&rev=10 --- python-311.patch | 34 ++++++++++++++++++++++++++++++++++ python-pytils.changes | 6 ++++++ python-pytils.spec | 10 ++++++---- 3 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 python-311.patch diff --git a/python-311.patch b/python-311.patch new file mode 100644 index 0000000..caacf14 --- /dev/null +++ b/python-311.patch @@ -0,0 +1,34 @@ +From 527e42f582849b3c1f73d5d525ae11d9ef21e0df Mon Sep 17 00:00:00 2001 +From: Dmitry Shachnev +Date: Tue, 13 Dec 2022 15:44:05 +0300 +Subject: [PATCH] Remove redundant (?u) inline flags + +They are not needed because we pass re.UNICODE anyway. +Also, inline flags not at the start of the expression are invalid +starting with Python 3.11. +--- + pytils/typo.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +Index: pytils-0.4.1/pytils/typo.py +=================================================================== +--- pytils-0.4.1.orig/pytils/typo.py ++++ pytils-0.4.1/pytils/typo.py +@@ -149,13 +149,13 @@ def rl_quotes(x): + # открывающие кавычки ставятся обычно вплотную к слову слева + # а закрывающие -- вплотную справа + # открывающие русские кавычки-ёлочки +- (re.compile(r'((?:^|\s))(")((?u))', re.UNICODE), '\\1\xab\\3'), ++ (re.compile(r'((?:^|\s))(")', re.UNICODE), '\\1\xab'), + # закрывающие русские кавычки-ёлочки +- (re.compile(r'(\S)(")((?u))', re.UNICODE), '\\1\xbb\\3'), ++ (re.compile(r'(\S)(")', re.UNICODE), '\\1\xbb'), + # открывающие кавычки-лапки, вместо одинарных кавычек +- (re.compile(r'((?:^|\s))(\')((?u))', re.UNICODE), '\\1\u201c\\3'), ++ (re.compile(r'((?:^|\s))(\')', re.UNICODE), '\\1\u201c'), + # закрывающие кавычки-лапки +- (re.compile(r'(\S)(\')((?u))', re.UNICODE), '\\1\u201d\\3'), ++ (re.compile(r'(\S)(\')', re.UNICODE), '\\1\u201d'), + ) + return _sub_patterns(patterns, x) + diff --git a/python-pytils.changes b/python-pytils.changes index b76d9fd..c54da57 100644 --- a/python-pytils.changes +++ b/python-pytils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Feb 21 09:48:12 UTC 2023 - Daniel Garcia + +- Add python-311.patch to support python 3.11 + gh#last-partizan/pytils#50 + ------------------------------------------------------------------- Thu Oct 6 22:59:47 UTC 2022 - Yogalakshmi Arunachalam diff --git a/python-pytils.spec b/python-pytils.spec index 3816a89..2dbdfe5 100644 --- a/python-pytils.spec +++ b/python-pytils.spec @@ -1,7 +1,7 @@ # # spec file for package python-pytils # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +16,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pytils Version: 0.4.1 Release: 0 @@ -25,6 +24,8 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/y10h/pytils Source: https://files.pythonhosted.org/packages/source/p/pytils/pytils-%{version}.tar.gz +# PATCH-FIX-UPSTREAM python-311.patch, gh#last-partizan/pytils#50 +Patch0: python-311.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -37,7 +38,7 @@ in-words representation of numerals, dates in Russian without locales, transliteration, etc.) %prep -%setup -q -n pytils-%{version} +%autosetup -p1 -n pytils-%{version} %build %python_build @@ -53,6 +54,7 @@ rm -r pytils/test/templatetags %files %{python_files} %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/pytils +%{python_sitelib}/pytils-%{version}*-info %changelog