14
0
forked from pool/python-pytils

Accepting request 1066953 from devel:languages:python

- Add python-311.patch to support python 3.11
  gh#last-partizan/pytils#50

OBS-URL: https://build.opensuse.org/request/show/1066953
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytils?expand=0&rev=4
This commit is contained in:
2023-02-21 14:36:29 +00:00
committed by Git OBS Bridge
3 changed files with 46 additions and 4 deletions

34
python-311.patch Normal file
View File

@@ -0,0 +1,34 @@
From 527e42f582849b3c1f73d5d525ae11d9ef21e0df Mon Sep 17 00:00:00 2001
From: Dmitry Shachnev <mitya57@gmail.com>
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)

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Feb 21 09:48:12 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
- Add python-311.patch to support python 3.11
gh#last-partizan/pytils#50
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Oct 6 22:59:47 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com> Thu Oct 6 22:59:47 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-pytils # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -16,7 +16,6 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pytils Name: python-pytils
Version: 0.4.1 Version: 0.4.1
Release: 0 Release: 0
@@ -25,6 +24,8 @@ License: MIT
Group: Development/Languages/Python Group: Development/Languages/Python
URL: https://github.com/y10h/pytils URL: https://github.com/y10h/pytils
Source: https://files.pythonhosted.org/packages/source/p/pytils/pytils-%{version}.tar.gz 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: %{python_module setuptools}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
@@ -37,7 +38,7 @@ in-words representation of numerals, dates in Russian without locales,
transliteration, etc.) transliteration, etc.)
%prep %prep
%setup -q -n pytils-%{version} %autosetup -p1 -n pytils-%{version}
%build %build
%python_build %python_build
@@ -53,6 +54,7 @@ rm -r pytils/test/templatetags
%files %{python_files} %files %{python_files}
%license LICENSE %license LICENSE
%{python_sitelib}/* %{python_sitelib}/pytils
%{python_sitelib}/pytils-%{version}*-info
%changelog %changelog