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 55 additions and 121 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,23 @@
-------------------------------------------------------------------
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>
- Convert to pip-based build and libalternatives
-------------------------------------------------------------------
Mon Sep 25 08:24:56 UTC 2023 - Ondřej Súkup <mimi.vx@gmail.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-smartypants
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,9 +16,14 @@
#
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%{?sle15_python_module_pythons}
Name: python-smartypants
Version: 2.0.1
Version: 2.0.2
Release: 0
Summary: Python fork of perl SmartyPants
License: BSD-3-Clause
@@ -26,16 +31,21 @@ Group: Development/Languages/Python
URL: https://github.com/leohemsted/smartypants.py
Source: https://github.com/leohemsted/smartypants.py/archive/v%{version}.tar.gz#/smartypants-%{version}.tar.gz
Patch0: use-sys-executable.patch
Patch1: fix-312.patch
BuildRequires: %{python_module docutils}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pygments}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires(post): update-alternatives
Requires(postun):update-alternatives
BuildArch: noarch
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
%python_subpackages
%description
@@ -47,10 +57,10 @@ typographic punctuation HTML entities.
%autosetup -p1 -n smartypants.py-%{version}
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%{python_expand sed -i '1{/^#!/d}' %{buildroot}%{$python_sitelib}/smartypants.py
%fdupes %{buildroot}%{$python_sitelib}
}
@@ -62,6 +72,9 @@ typographic punctuation HTML entities.
%postun
%python_uninstall_alternative smartypants
%pre
%python_libalternatives_reset_alternative smartypants
%check
%pyunittest discover -v tests

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.1/tests/test_cli.py
--- smartypants.py-2.0.2.orig/tests/test_cli.py
+++ smartypants.py-2.0.2/tests/test_cli.py
@@ -7,6 +7,7 @@ import os
import tempfile
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([sys.executable, CLI_SCRIPT], T)
self.assertEquals(output, E)
self.assertEqual(output, E)
def test_pipe_attr(self):
@@ -41,11 +42,11 @@ class TestCLI(unittest.TestCase):
@@ -25,12 +25,12 @@ Index: smartypants.py-2.0.1/tests/test_cli.py
E = T
- output = self._p([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;"""
- output = self._p([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):
@@ -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>'
- output = self._p([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>'
- output = self._p([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>'
- output = self._p([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
- output = self._p([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):
@@ -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])
finally:
os.remove(F)
self.assertEquals(output, E)
self.assertEqual(output, E)