Compare commits
6 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| b8e151ea95 | |||
| 88d83eca0e | |||
| 53b913be5d | |||
| 1c677aeb11 | |||
| 6459197020 | |||
| f3b26ebdf9 |
@@ -1,99 +0,0 @@
|
|||||||
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,18 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Aug 25 12:30:18 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
||||||
|
|
||||||
|
- Convert to libalternatives on SLE-16-based and newer systems only
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Jun 17 16:46:42 UTC 2025 - Benoît Monin <benoit.monin@gmx.fr>
|
||||||
|
|
||||||
|
- update to version 2.0.2:
|
||||||
|
* Fix double closing quotes after an HTML block
|
||||||
|
* Fix regular expressions and tests for Python 3.12+
|
||||||
|
* Move documentation to ReadTheDocs
|
||||||
|
- drop fix-312.patch: merged upstream
|
||||||
|
- refresh use-sys-executable.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Jun 12 12:07:46 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
Thu Jun 12 12:07:46 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-smartypants
|
# spec file for package python-smartypants
|
||||||
#
|
#
|
||||||
# Copyright (c) 2025 SUSE LLC
|
# Copyright (c) 2025 SUSE LLC and contributors
|
||||||
#
|
#
|
||||||
# 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,10 +16,14 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
%if 0%{?suse_version} > 1500
|
||||||
%bcond_without libalternatives
|
%bcond_without libalternatives
|
||||||
|
%else
|
||||||
|
%bcond_with libalternatives
|
||||||
|
%endif
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-smartypants
|
Name: python-smartypants
|
||||||
Version: 2.0.1
|
Version: 2.0.2
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Python fork of perl SmartyPants
|
Summary: Python fork of perl SmartyPants
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
@@ -27,17 +31,21 @@ 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
|
||||||
Patch0: use-sys-executable.patch
|
Patch0: use-sys-executable.patch
|
||||||
Patch1: fix-312.patch
|
|
||||||
BuildRequires: %{python_module docutils}
|
BuildRequires: %{python_module docutils}
|
||||||
BuildRequires: %{python_module pip}
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module pygments}
|
BuildRequires: %{python_module pygments}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: %{python_module wheel}
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: alts
|
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: alts
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
%if %{with libalternatives}
|
||||||
|
BuildRequires: alts
|
||||||
|
Requires: alts
|
||||||
|
%else
|
||||||
|
Requires(post): update-alternatives
|
||||||
|
Requires(postun): update-alternatives
|
||||||
|
%endif
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@@ -58,6 +66,12 @@ typographic punctuation HTML entities.
|
|||||||
}
|
}
|
||||||
%python_clone -a %{buildroot}%{_bindir}/smartypants
|
%python_clone -a %{buildroot}%{_bindir}/smartypants
|
||||||
|
|
||||||
|
%post
|
||||||
|
%python_install_alternative smartypants
|
||||||
|
|
||||||
|
%postun
|
||||||
|
%python_uninstall_alternative smartypants
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
%python_libalternatives_reset_alternative smartypants
|
%python_libalternatives_reset_alternative smartypants
|
||||||
|
|
||||||
|
|||||||
BIN
smartypants-2.0.1.tar.gz
LFS
BIN
smartypants-2.0.1.tar.gz
LFS
Binary file not shown.
3
smartypants-2.0.2.tar.gz
Normal file
3
smartypants-2.0.2.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:560ae7485a27c288f5bd63131f5c3c7b8f0745f50e7c3f85f0bbc65d87799d19
|
||||||
|
size 28770
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
Index: smartypants.py-2.0.1/tests/test_cli.py
|
Index: smartypants.py-2.0.2/tests/test_cli.py
|
||||||
===================================================================
|
===================================================================
|
||||||
--- smartypants.py-2.0.1.orig/tests/test_cli.py
|
--- smartypants.py-2.0.2.orig/tests/test_cli.py
|
||||||
+++ smartypants.py-2.0.1/tests/test_cli.py
|
+++ smartypants.py-2.0.2/tests/test_cli.py
|
||||||
@@ -7,6 +7,7 @@ import os
|
@@ -7,6 +7,7 @@ import os
|
||||||
import tempfile
|
import tempfile
|
||||||
import unittest
|
import unittest
|
||||||
@@ -16,7 +16,7 @@ Index: smartypants.py-2.0.1/tests/test_cli.py
|
|||||||
|
|
||||||
- output = self._p([CLI_SCRIPT], T)
|
- output = self._p([CLI_SCRIPT], T)
|
||||||
+ output = self._p([sys.executable, CLI_SCRIPT], T)
|
+ output = self._p([sys.executable, CLI_SCRIPT], T)
|
||||||
self.assertEquals(output, E)
|
self.assertEqual(output, E)
|
||||||
|
|
||||||
def test_pipe_attr(self):
|
def test_pipe_attr(self):
|
||||||
@@ -41,11 +42,11 @@ class TestCLI(unittest.TestCase):
|
@@ -41,11 +42,11 @@ class TestCLI(unittest.TestCase):
|
||||||
@@ -25,12 +25,12 @@ Index: smartypants.py-2.0.1/tests/test_cli.py
|
|||||||
E = T
|
E = T
|
||||||
- output = self._p([CLI_SCRIPT, '--attr', '0'], T)
|
- output = self._p([CLI_SCRIPT, '--attr', '0'], T)
|
||||||
+ output = self._p([sys.executable, CLI_SCRIPT, '--attr', '0'], T)
|
+ output = self._p([sys.executable, CLI_SCRIPT, '--attr', '0'], T)
|
||||||
self.assertEquals(output, E)
|
self.assertEqual(output, E)
|
||||||
|
|
||||||
E = """"foo" “bar”"""
|
E = """"foo" “bar”"""
|
||||||
- output = self._p([CLI_SCRIPT, '--attr', 'b'], T)
|
- output = self._p([CLI_SCRIPT, '--attr', 'b'], T)
|
||||||
+ output = self._p([sys.executable, CLI_SCRIPT, '--attr', 'b'], T)
|
+ output = self._p([sys.executable, CLI_SCRIPT, '--attr', 'b'], T)
|
||||||
self.assertEquals(output, E)
|
self.assertEqual(output, E)
|
||||||
|
|
||||||
def test_skipped_elements(self):
|
def test_skipped_elements(self):
|
||||||
@@ -53,19 +54,19 @@ class TestCLI(unittest.TestCase):
|
@@ -53,19 +54,19 @@ class TestCLI(unittest.TestCase):
|
||||||
@@ -39,22 +39,22 @@ Index: smartypants.py-2.0.1/tests/test_cli.py
|
|||||||
E = '<a>“foo”</a> <b>“bar”</b>'
|
E = '<a>“foo”</a> <b>“bar”</b>'
|
||||||
- output = self._p([CLI_SCRIPT], T)
|
- output = self._p([CLI_SCRIPT], T)
|
||||||
+ output = self._p([sys.executable, CLI_SCRIPT], T)
|
+ output = self._p([sys.executable, CLI_SCRIPT], T)
|
||||||
self.assertEquals(output, E)
|
self.assertEqual(output, E)
|
||||||
|
|
||||||
E = '<a>"foo"</a> <b>“bar”</b>'
|
E = '<a>"foo"</a> <b>“bar”</b>'
|
||||||
- output = self._p([CLI_SCRIPT, '--skip', 'a'], T)
|
- output = self._p([CLI_SCRIPT, '--skip', 'a'], T)
|
||||||
+ output = self._p([sys.executable, CLI_SCRIPT, '--skip', 'a'], T)
|
+ 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>'
|
E = '<a>“foo”</a> <b>"bar"</b>'
|
||||||
- output = self._p([CLI_SCRIPT, '--skip', 'b'], T)
|
- output = self._p([CLI_SCRIPT, '--skip', 'b'], T)
|
||||||
+ output = self._p([sys.executable, CLI_SCRIPT, '--skip', 'b'], T)
|
+ output = self._p([sys.executable, CLI_SCRIPT, '--skip', 'b'], T)
|
||||||
self.assertEquals(output, E)
|
self.assertEqual(output, E)
|
||||||
|
|
||||||
E = T
|
E = T
|
||||||
- output = self._p([CLI_SCRIPT, '--skip', 'a,b'], T)
|
- output = self._p([CLI_SCRIPT, '--skip', 'a,b'], T)
|
||||||
+ output = self._p([sys.executable, CLI_SCRIPT, '--skip', 'a,b'], T)
|
+ output = self._p([sys.executable, CLI_SCRIPT, '--skip', 'a,b'], T)
|
||||||
self.assertEquals(output, E)
|
self.assertEqual(output, E)
|
||||||
|
|
||||||
def test_file(self):
|
def test_file(self):
|
||||||
@@ -78,7 +79,7 @@ class TestCLI(unittest.TestCase):
|
@@ -78,7 +79,7 @@ class TestCLI(unittest.TestCase):
|
||||||
@@ -65,4 +65,4 @@ Index: smartypants.py-2.0.1/tests/test_cli.py
|
|||||||
+ output = self._p([sys.executable, CLI_SCRIPT, F])
|
+ output = self._p([sys.executable, CLI_SCRIPT, F])
|
||||||
finally:
|
finally:
|
||||||
os.remove(F)
|
os.remove(F)
|
||||||
self.assertEquals(output, E)
|
self.assertEqual(output, E)
|
||||||
|
|||||||
Reference in New Issue
Block a user