17
0

6 Commits

Author SHA256 Message Date
b8e151ea95 Accepting request 1301265 from devel:languages:python
- Convert to libalternatives on SLE-16-based and newer systems only

OBS-URL: https://build.opensuse.org/request/show/1301265
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-smartypants?expand=0&rev=11
2025-08-26 12:56:13 +00:00
88d83eca0e - Convert to libalternatives on SLE-16-based and newer systems only
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-smartypants?expand=0&rev=23
2025-08-25 12:30:46 +00:00
53b913be5d Accepting request 1286461 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1286461
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-smartypants?expand=0&rev=10
2025-06-18 20:28:35 +00:00
1c677aeb11 - update to version 2.0.2
- drop fix-312.patch: merged upstream
- refresh use-sys-executable.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-smartypants?expand=0&rev=21
2025-06-17 20:38:42 +00:00
6459197020 Accepting request 1285134 from devel:languages:python
- Convert to pip-based build and libalternatives

OBS-URL: https://build.opensuse.org/request/show/1285134
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-smartypants?expand=0&rev=9
2025-06-13 16:42:38 +00:00
f3b26ebdf9 - Convert to pip-based build and libalternatives
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-smartypants?expand=0&rev=19
2025-06-12 12:08:08 +00:00
6 changed files with 48 additions and 118 deletions

View File

@@ -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>&#8220;foo&#8221;</a> <b>&#8220;bar&#8221;</b>'
output = self._p([sys.executable, CLI_SCRIPT], T)
- self.assertEquals(output, E)
+ self.assertEqual(output, E)
E = '<a>"foo"</a> <b>&#8220;bar&#8221;</b>'
output = self._p([sys.executable, CLI_SCRIPT, '--skip', 'a'], T)
- self.assertEquals(output, E)
+ self.assertEqual(output, E)
E = '<a>&#8220;foo&#8221;</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 = "&#8217;"
else:
t = "&#8216;"
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 = "&#8221;"
else:
t = "&#8220;"
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 = '&#8220;foo&#8221; -- 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 = '&#8220;foo&#8221; &#8212; bar'
- self.assertEquals(T, E)
+ self.assertEqual(T, E)
def test_dates(self):

View File

@@ -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>

View File

@@ -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

Binary file not shown.

3
smartypants-2.0.2.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:560ae7485a27c288f5bd63131f5c3c7b8f0745f50e7c3f85f0bbc65d87799d19
size 28770

View File

@@ -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" &#8220;bar&#8221;""" E = """"foo" &#8220;bar&#8221;"""
- 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>&#8220;foo&#8221;</a> <b>&#8220;bar&#8221;</b>' E = '<a>&#8220;foo&#8221;</a> <b>&#8220;bar&#8221;</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>&#8220;bar&#8221;</b>' E = '<a>"foo"</a> <b>&#8220;bar&#8221;</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>&#8220;foo&#8221;</a> <b>"bar"</b>' E = '<a>&#8220;foo&#8221;</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)