Accepting request 1113554 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1113554 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-smartypants?expand=0&rev=8
This commit is contained in:
commit
7ad3124393
99
fix-312.patch
Normal file
99
fix-312.patch
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
Index: smartypants.py-2.0.1/tests/test_cli.py
|
||||||
|
===================================================================
|
||||||
|
--- smartypants.py-2.0.1.orig/tests/test_cli.py
|
||||||
|
+++ smartypants.py-2.0.1/tests/test_cli.py
|
||||||
|
@@ -35,7 +35,7 @@ class TestCLI(unittest.TestCase):
|
||||||
|
E = '“foobar”'
|
||||||
|
|
||||||
|
output = self._p([sys.executable, CLI_SCRIPT], T)
|
||||||
|
- self.assertEquals(output, E)
|
||||||
|
+ self.assertEqual(output, E)
|
||||||
|
|
||||||
|
def test_pipe_attr(self):
|
||||||
|
|
||||||
|
@@ -43,11 +43,11 @@ class TestCLI(unittest.TestCase):
|
||||||
|
|
||||||
|
E = T
|
||||||
|
output = self._p([sys.executable, CLI_SCRIPT, '--attr', '0'], T)
|
||||||
|
- self.assertEquals(output, E)
|
||||||
|
+ self.assertEqual(output, E)
|
||||||
|
|
||||||
|
E = """"foo" “bar”"""
|
||||||
|
output = self._p([sys.executable, CLI_SCRIPT, '--attr', 'b'], T)
|
||||||
|
- self.assertEquals(output, E)
|
||||||
|
+ self.assertEqual(output, E)
|
||||||
|
|
||||||
|
def test_skipped_elements(self):
|
||||||
|
|
||||||
|
@@ -55,19 +55,19 @@ class TestCLI(unittest.TestCase):
|
||||||
|
|
||||||
|
E = '<a>“foo”</a> <b>“bar”</b>'
|
||||||
|
output = self._p([sys.executable, CLI_SCRIPT], T)
|
||||||
|
- self.assertEquals(output, E)
|
||||||
|
+ self.assertEqual(output, E)
|
||||||
|
|
||||||
|
E = '<a>"foo"</a> <b>“bar”</b>'
|
||||||
|
output = self._p([sys.executable, CLI_SCRIPT, '--skip', 'a'], T)
|
||||||
|
- self.assertEquals(output, E)
|
||||||
|
+ self.assertEqual(output, E)
|
||||||
|
|
||||||
|
E = '<a>“foo”</a> <b>"bar"</b>'
|
||||||
|
output = self._p([sys.executable, CLI_SCRIPT, '--skip', 'b'], T)
|
||||||
|
- self.assertEquals(output, E)
|
||||||
|
+ self.assertEqual(output, E)
|
||||||
|
|
||||||
|
E = T
|
||||||
|
output = self._p([sys.executable, CLI_SCRIPT, '--skip', 'a,b'], T)
|
||||||
|
- self.assertEquals(output, E)
|
||||||
|
+ self.assertEqual(output, E)
|
||||||
|
|
||||||
|
def test_file(self):
|
||||||
|
|
||||||
|
@@ -82,4 +82,4 @@ class TestCLI(unittest.TestCase):
|
||||||
|
output = self._p([sys.executable, CLI_SCRIPT, F])
|
||||||
|
finally:
|
||||||
|
os.remove(F)
|
||||||
|
- self.assertEquals(output, E)
|
||||||
|
+ self.assertEqual(output, E)
|
||||||
|
Index: smartypants.py-2.0.1/smartypants.py
|
||||||
|
===================================================================
|
||||||
|
--- smartypants.py-2.0.1.orig/smartypants.py
|
||||||
|
+++ smartypants.py-2.0.1/smartypants.py
|
||||||
|
@@ -268,13 +268,13 @@ def smartypants(text, attr=None):
|
||||||
|
if do_quotes:
|
||||||
|
if t == "'":
|
||||||
|
# Special case: single-character ' token
|
||||||
|
- if re.match("\S", prev_token_last_char):
|
||||||
|
+ if re.match(r"\S", prev_token_last_char):
|
||||||
|
t = "’"
|
||||||
|
else:
|
||||||
|
t = "‘"
|
||||||
|
elif t == '"':
|
||||||
|
# Special case: single-character " token
|
||||||
|
- if re.match("\S", prev_token_last_char):
|
||||||
|
+ if re.match(r"\S", prev_token_last_char):
|
||||||
|
t = "”"
|
||||||
|
else:
|
||||||
|
t = "“"
|
||||||
|
Index: smartypants.py-2.0.1/tests/test.py
|
||||||
|
===================================================================
|
||||||
|
--- smartypants.py-2.0.1.orig/tests/test.py
|
||||||
|
+++ smartypants.py-2.0.1/tests/test.py
|
||||||
|
@@ -24,7 +24,7 @@ class SmartyPantsTestCase(unittest.TestC
|
||||||
|
|
||||||
|
T = sp(TEXT)
|
||||||
|
E = '“foo” -- bar'
|
||||||
|
- self.assertEquals(T, E)
|
||||||
|
+ self.assertEqual(T, E)
|
||||||
|
|
||||||
|
attr = Attr.q | Attr.d
|
||||||
|
Attr.default = attr
|
||||||
|
@@ -32,7 +32,7 @@ class SmartyPantsTestCase(unittest.TestC
|
||||||
|
|
||||||
|
T = sp(TEXT)
|
||||||
|
E = '“foo” — bar'
|
||||||
|
- self.assertEquals(T, E)
|
||||||
|
+ self.assertEqual(T, E)
|
||||||
|
|
||||||
|
def test_dates(self):
|
||||||
|
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Sep 25 08:24:56 UTC 2023 - Ondřej Súkup <mimi.vx@gmail.com>
|
||||||
|
|
||||||
|
- add fix-312.patch to fix python3.12 build
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Apr 21 12:34:12 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
Fri Apr 21 12:34:12 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-smartypants
|
# spec file for package python-smartypants
|
||||||
#
|
#
|
||||||
# Copyright (c) 2021 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-%{**}}
|
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-smartypants
|
Name: python-smartypants
|
||||||
Version: 2.0.1
|
Version: 2.0.1
|
||||||
@ -26,7 +25,8 @@ License: BSD-3-Clause
|
|||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
URL: https://github.com/leohemsted/smartypants.py
|
URL: https://github.com/leohemsted/smartypants.py
|
||||||
Source: https://github.com/leohemsted/smartypants.py/archive/v%{version}.tar.gz#/smartypants-%{version}.tar.gz
|
Source: https://github.com/leohemsted/smartypants.py/archive/v%{version}.tar.gz#/smartypants-%{version}.tar.gz
|
||||||
Patch1: use-sys-executable.patch
|
Patch0: use-sys-executable.patch
|
||||||
|
Patch1: fix-312.patch
|
||||||
BuildRequires: %{python_module docutils}
|
BuildRequires: %{python_module docutils}
|
||||||
BuildRequires: %{python_module pygments}
|
BuildRequires: %{python_module pygments}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
@ -44,8 +44,7 @@ which translates plain ASCII punctuation characters into smart
|
|||||||
typographic punctuation HTML entities.
|
typographic punctuation HTML entities.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n smartypants.py-%{version}
|
%autosetup -p1 -n smartypants.py-%{version}
|
||||||
%patch1 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%python_build
|
||||||
@ -70,6 +69,8 @@ typographic punctuation HTML entities.
|
|||||||
%license COPYING
|
%license COPYING
|
||||||
%doc README.rst docs/*.rst
|
%doc README.rst docs/*.rst
|
||||||
%python_alternative %{_bindir}/smartypants
|
%python_alternative %{_bindir}/smartypants
|
||||||
%{python_sitelib}/*
|
%{python_sitelib}/smartypants.py
|
||||||
|
%{python_sitelib}/smartypants-%{version}*-info
|
||||||
|
%pycache_only %{python_sitelib}/__pycache__/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
x
Reference in New Issue
Block a user